Support multi-ingredient recipes with per-item factory demand #23
Labels
No labels
burndown-2026-08
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/advocate
role/director
role/exec
role/frontend
role/gamedev
role/human
role/platform
role/qa
role/science
role/sysadmin
state
ambient
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/factory-game-v3#23
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Build the next core simulation step after #22. This is core Rust logic, not Bevy/viewer/deploy work.
Current state on
main:GameState::newrejects any product whose recipe has more than one ingredient, andRecipeRuntimemodels a single input item.DispatchBoardholds a singleOption<DispatchIntent>.Goal:
Generalize recipes to multiple ingredients and factory demand to per-item intents, so a scenario can run two source types (one finite, one manifest) feeding one recipe.
Implementation guidance:
RecipeRuntimeholdsinputs: BTreeMap<ItemId, u32>. Crafting starts only when every input is stocked, then consumes all of them.CraftSnapshotexposes the inputs map.DispatchBoardbecomesintents: Vec<DispatchIntent>for both sources (0..1) and the factory (one per under-buffered input, in item-id order for determinism).GameState::newrejects only recipes with zero ingredients.building_materials(2 iron ore + 2 stone) and abuilding-materialsscenario: a finite iron ore source, a manifest stone source, two haulers.Acceptance criteria:
cargo test --workspacepasses.docs/factory-sim.mdanddocs/FEATURES.mdupdated.Out of scope:
Landed on
mainineaa6d5a(feat: support multi-ingredient recipes).What shipped:
RecipeRuntimeholdsinputs: BTreeMap<ItemId, u32>. Crafting starts only when every ingredient is stocked, then consumes all of them.CraftSnapshotexposes the inputs map.DispatchBoardcarriesintents: Vec<DispatchIntent>for sources (0..1) and the factory (one per under-buffered input, item-id order). The #22 arbitration runs per factory intent with per-item need and in-flight accounting.GameState::newrejects only zero-ingredient recipes.building_materials(2 iron ore + 2 stone, crafts 4) and thebuilding-materialsscenario: finite iron ore source, manifest stone source, two haulers.Verification:
cargo test --workspacepasses - 14 sim tests plus the CLI test, including per-input intent generation and a 20-tick building-materials determinism run asserting both source types were mined and output produced.ward exec testandpre-commit run --all-filesgreen. The iron-bars and iron-bars-fleet timelines are unchanged.WARD-OUTCOME: done