In version 0.5.0 the AI has its own building logic. Meaning, it could build whatever it wants, and using its own timers.

Using own timers means that the AI can build things at different speeds (with different rules even) than the human player would.

However, in 0.5.0 the introduction of a new sidebar meant I also kind of made sure it could be made / respected for any player. Although this was in theory I expanded on this further in this issue.

It makes it easier to debug the AI when you can see what it is doing; so I really wanted to make it visible when playing the game. This meant I had to let the AI use the sidebar logic (which includes all upgrade logic, etc) as well.

It took a bit more work than anticipated, but the result is that you can (if running the game in debug mode) switch players on the fly. Using the key combination TAB-<nr> (where <nr> can be 1 to 4; 0 is back to human player).

here you can watch an AI play

With this possibility I had to make sure the AI uses some upgrade logic (before it could build everything, and required no upgrades); it also respects the power and spice capacity limitations.

All in all this makes the AI play more fair.

The downside is that campaign mode now breaks, because the Dune 2 AI cheats. One example is the final mission where there is not enough power for the AI players.

So now I have to fix the AI once more, but this time make it cheat occasionally so it is still fun to play against in campaign mode…

#

Comments are closed

Want to support? Please consider donating via Kofi.