Creating Hinekora’s Engine
Hinekora’s Engine is the independent crafting system behind Hinekora’s Codex. It was developed with Codex assistance to bring item rules, crafting actions, outcome previews, and saved item state into one local workflow. Its purpose is to make supported crafts repeatable and understandable, with an inspectable path from source data to the result shown on an item.
This account draws on the original development report and the engine’s implementation and source records. Coverage and probability assumptions below describe the available implementation at this checkpoint.
Research and foundation
Development began with a separate research engine. The first task was to represent an item precisely enough to answer a basic crafting question. Given a base, item level, rarity, and existing modifiers, which modifiers can be added next?
The initial importer read local Path of Building generated Lua data without executing those tables. Base and modifier definitions were normalized into a shared representation, with source-file hashes retained for traceability. The ordinary engine then added item-level gates, ordered spawn-tag rules, prefix and suffix capacity, and exclusion checks for modifiers that cannot coexist.
Weighted selection was built on top of that legal pool. Basic addition currencies followed, then removal, replacement, value rerolls, and bounded recipes. This sequence made it possible to test each layer before connecting the engine to the workbench. The engine was then copied into Hinekora’s Codex, where a dedicated adapter connected it to the existing crafting interface.
Sources and data preparation
The engine combines an independent implementation with externally sourced game definitions and community modeling inputs. Each source contributes a different part of the model.
- Path of Building 2 Community. The initial research importer used its generated base and modifier tables. PoB also provides useful definitions, ranges, tags, essence mappings, and special modifier tables. Build calculations use a separate PoB runtime. Path of Building source.
- RePoE. Exported game definitions contribute base-item and modifier information. The crafting supply extraction records its source URL, snapshot label, and SHA-256 hash. Base-item definitions and modifier definitions.
- PoE2DB and community inputs. Published modifier tables were normalized into category pools, with source context and mapping coverage retained. The resulting weights are accepted community modeling inputs, with uncertainty recorded in the catalog. Modifier reference.
- Craft of Exile. Isolated research captures supplied reference cases for comparison with the independent rules. Those comparisons were part of development. The Hinekora crafting runtime executes its own implementation and local snapshot. Craft of Exile reference.
Normalization maps source rows to modifier identifiers, preserves exclusion groups and required levels, and keeps ordinary sections separate from essence, corrupted, desecrated, and other special pools. Invalid mappings and missing ordinary weights are rejected. Published weights of one remain recorded community assumptions.
The current snapshot labels its definitions as 0.5.5.5. Its weight patch is unknown. The saved coverage record maps all 9,398 ordinary source rows, including 2,709 rows with a published weight of one. These are mapping counts across source sections, which can repeat modifiers. They establish the reach of the importer, while probability accuracy still requires separate evidence.
Source provenance remains part of maintenance. A data refresh must preserve where the definitions and weights came from, which patch labels are supported, and which entries remain uncertain. Software licenses and game-data ownership also need to be tracked for the material distributed with the engine. PoB license and notices.
From a crafting action to an item result
1. Read and validate the starting state
The item carries its base, level, rarity, modifier identities, and stored rolls. The extended model also tracks states such as fractures, corruption, sanctification, quality, and pending Abyss choices. An action first checks that the item and currency are compatible, that required slots or targets exist, and that protection and lock rules permit the operation.
2. Build the eligible pool
The engine combines the base tags with tags supplied by existing modifiers, checks required levels, excludes conflicting groups, and applies the available prefix or suffix capacity. Spawn-tag entries have ordered precedence. A matching zero-valued rule can block eligibility even when a later entry would allow it. Tiered currencies and targeting omens add their own constraints.
3. Calculate the conditional chances
For a weighted addition, each eligible modifier’s chance is its weight divided by the sum of weights in that pool. Every change to the legal pool can change those chances. Missing, negative, or nonfinite weights cause a failure instead of a fabricated percentage.
Three eligible modifiers with weights 100, 300, and 600 have next-draw chances of 10%, 30%, and 60%. If an exclusion removes the third modifier, the remaining chances become 25% and 75%.
These are chances for one draw from a particular state. A complete craft can involve several draws, changing pools, removal branches, and stopping conditions. Its overall success rate must account for that sequence.
4. Select a modifier and roll its values
A random value is compared with cumulative probability intervals to choose a modifier. Its numerical values are then rolled separately within the supported ranges. The ordinary range model handles inclusive integer and decimal ranges, preserves fixed display text, and stores the values alongside the rendered lines. Stat-specific rounding and linked values require additional rules where applicable.
5. Commit the completed transition
The action returns a new item state for the workbench. Existing rolls and protected modifiers are preserved where required. Multi-step actions must finish successfully before the workbench accepts their result, so a failure can leave the item unchanged even if random values were consumed during the attempted operation.
Expanding the mechanics
Ordinary addition currencies established the first complete path from a normal base to a rare item with multiple affixes. Alchemy builds a legal four-affix result. Annulment removes an eligible modifier, Divine changes supported numerical rolls, and Chaos constructs its replacement pool after removal. This ordering matters because the removed modifier can change the conflicts and capacity of the next draw.
Greater and Perfect currencies add level floors and category rules. The current tier fallback retains the original eligible tiers for a modifier type when the floor would otherwise remove that type entirely. That behavior is an explicit interpretation that still needs stronger game validation.
Omens are represented as action state, with supported combinations, targeting constraints, and consumption reported by the result. The advanced implementation records 20 supported omens. Essences and alloys use guaranteed outcomes or modeled alternatives for eligible bases. A listed supply still has to pass the selected item’s eligibility checks.
The extended item model added fractures, quality and catalysts, Abyss choices, corruption scenarios, and sanctification. Fractures protect a modifier during supported later operations. Abyss crafting uses a pending state so a player can inspect and select an offered outcome, with a supported reroll recorded in history. These mechanics require their own transition rules and evidence.
Connecting the workbench
The workbench adapter translates the selected base, current item, currency, and omens into engine commands. It returns the resulting item, feedback, and supported previews to the interface. The Modifier Reference exposes the local pools, tags, levels, ranges, tiers, and weights used to understand those crafts.
Integration work also addressed failed imports, detached item state, slot previews, and undo behavior. History and export data must preserve enough information to restore an item’s rolls and special state. Pasted item text is matched against the catalog, while JSON exports retain the engine’s structured state.
The ordinary recipe layer supports bounded sequences, target conditions, seeded random runs, explicit action costs, and stop reasons. Repeated runs can summarize success and cost distributions under the chosen model. Extending that recipe layer to every advanced mechanic and integrating complete strategy planning remain further work.
Testing and evidence
Validation developed alongside the implementation. Synthetic fixtures isolate eligibility, exclusions, weighted selection, and action transitions. Seeded runs make failures repeatable. Integration checks exercise real catalog items and workbench operations, including history, save and restore, and failures that must preserve state.
The first saved reference comparison matched all 24 selected next-draw cases when the independent formula was supplied with reference weights. A later transition comparison replayed 24 captured rarity and modifier-set results by forcing a draw into the relevant selection interval. Its next-draw pools matched in 20 cases, with four Regal pool discrepancies recorded. These experiments checked specific rules under controlled inputs and left broader distribution accuracy open.
The advanced crafting checkpoint recorded 77 passing application tests. An accompanying audit exercised 260 mapped essence and alloy category-row scenarios, with 248 passing and 12 blocked Essence of the Abyss cases. Those counts include repeated names and alternatives. They describe that saved checkpoint and measure implementation coverage rather than observed in-game frequencies.
Further accuracy work needs a fixed benchmark corpus, independent expected rules, repeated distribution comparisons, and observations from the game. Each mechanic needs evidence for its legal outcomes, selection chances, value rolls, and interactions with protected or special items.
Current limits and next steps
The engine’s most important uncertainty is the relationship between community weights and current game probabilities. Definitions and weights can come from different snapshots. An accurate weighted-selection formula still depends on a correct pool and trustworthy inputs.
- Abyss reveal currently uses an experimental equal-choice model for its supported special pool. Ordinary reveal choices and measured option distributions remain incomplete, and 52 unmapped desecrated source entries were excluded in the saved coverage record.
- Fracturing uses a uniform eligible-target model. Infinite essence alternatives also use an equal-choice model. Their complete interactions need further validation.
- Corruption supports explicit no-change and added-implicit scenarios. Random Vaal outcome selection is disabled because the outcome probabilities are unknown.
- Sanctification uses an experimental uniform integer range of 78–122% with magnitude-floor rounding. Discrete-stat exceptions and the actual distribution need verification.
- Quality and catalysts support matching-tag display scaling. Equipment base-property recalculation, special caps, and combined-stat rounding remain incomplete.
- Some omen families, special bases, socket currencies, and advanced recipe combinations remain outside the supported coverage.
The next development steps are to establish stronger ordinary-equipment benchmarks, version the probability inputs, validate special transitions individually, and extend recipes only as their underlying actions become dependable. Progress is measured by reproducible rules, explainable results, and evidence for each supported mechanic.