Windfisch / factorio-bot

Work-in-progress factorio bot
GNU General Public License v3.0
33 stars 4 forks source link

separate game driver, basic controlling logic and strategy #18

Open Windfisch opened 5 years ago

Windfisch commented 5 years ago

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

Windfisch commented 5 years ago

beb75e94c22800dff25d7a672835413e07729372 and 090617d21b83835ad8f54a56d9abbc46ee265a31 work towards some separation.

to do: clear subdirectories for the modules, and enforce that separation