tonihele / OpenKeeper

Dungeon Keeper II remake
GNU General Public License v3.0
428 stars 41 forks source link

Improve AI and makes states more transparent #462

Open tonihele opened 2 weeks ago

tonihele commented 2 weeks ago

Improve AI and makes states more transparent. Currently we are just using a simple state machine and too few states. It is often cumbersome to figure out what a creature is actually doing. Like the state WORK, the creature can be working or traveling to work, there is no distinction there. And complex behaviors like being jailed, researching or training are hard to model with our current system. Not impossible but messy. Those behaviors have kinda sub states, more naturally expressed in another way.

I suggest we move to use behavior trees. We can even have some simple editor to script these out. And have separate ones for workers and different creature types.

We are currently using libgdx-ai, I suppose it is a decent choice. If we want something else, that is of course allowed too. See https://github.com/libgdx/gdx-ai/wiki/Behavior-Trees