FactorioIO should be a pure callback-driven game driver.
The "basic" logic like Inventory and position tracking, map building, resource patch management and action management (including path planning) should be moved up a layer into one or more separate modules.
E.g. actions should auto-extrapolate the inventory, lag hiding should be performed here.
The scheduler resides another layer up, using actions for crafting, walking and adding "item claims".
Problem: in order to perform item claims, either the basic logic + lua mod need to know about these attributions -> they depend on "Task", or the scheduler needs to maintain these claims separately from the actual inventory -> difficult to avoid race conditions: the inventory update and the claim must be done in the same tick, before (or both after) executing the strategy tick()s
The strategy managers read from the world map and submit tasks to the scheduler
FactorioIO should be a pure callback-driven game driver.
The "basic" logic like Inventory and position tracking, map building, resource patch management and action management (including path planning) should be moved up a layer into one or more separate modules. E.g. actions should auto-extrapolate the inventory, lag hiding should be performed here.
The scheduler resides another layer up, using actions for crafting, walking and adding "item claims". Problem: in order to perform item claims, either the basic logic + lua mod need to know about these attributions -> they depend on "Task", or the scheduler needs to maintain these claims separately from the actual inventory -> difficult to avoid race conditions: the inventory update and the claim must be done in the same tick, before (or both after) executing the strategy
tick()
sThe strategy managers read from the world map and submit tasks to the scheduler