C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
33 stars 9 forks source link

Refactor AI unit strategy assignment #359

Open QuintillusCFC opened 1 year ago

QuintillusCFC commented 1 year ago

Of the three AI decision-making types we have (unit strategy, city production, and strategic priority), unit strategy is currently the least sophisticated. It's essentially a deterministic if-else chain, which is not going to be very maintainable as it grows, and doesn't allow for any element of chance.

City production has a more sophisticated process of weighing each possibility and then deciding among the options, and strategic priorities have that plus an architecture that is at least in theory pluggable. They've both been worked on more recently.

QuintillusCFC commented 1 year ago

Either as part of this or spun off, we should also use the path and moveAlongPath property/methods on Unit/UnitExtensions, rather than duplicating that logic in various AI behavior classes.