More bot tweaks and while we’re automating anyway: auto-firing towers!

More tweaking on the bots this weekend! I created lots of auxiliary functions, moved some bits and pieces around, and also tweaked the bot’s core logic a bit more,  to achieve the following:

  • If there’s no candidate enemy units within attack range, scan in a wider perimeter and moveTowards() the interesting target if one is found. Since the natural ‘enemy’ of an ore truck is the ore field, this means ore trucks will find and occupy nearby ore fields now.
  • Some parameters are centralized in a botSettings object, such as: avgTimePerMove, maxMovesPerRound, buyProbability … This allows for easy tweaking and experimenting with bot behavior and ‘difficulty setting’.
  • With those new helping functions (scanning for enemy units nearby …) it was straightforward to add as a bonus: auto-firing towers, hooray! Towers will now automatically attack all nearby enemies: these are extra moves appended without even a timing penalty. This instant multi-move behaviour may make towers a bit too powerful actually, we’ll see.
    In any case we may have an interesting new ‘construction engineer plus tower rush’ added to the possible strategies now….

All this ‘automated movement’ code opens up another interesting gameplay approach, beyond bots and towers: in principle it isn’t too easy to make all units auto-attack nearby enemies now (and use some random generator for ‘move time’ or whatever). This is something that’s come up as a suggestion from testers sometimes. After all, ‘regular’ RTS games behave like this, you just send hordes of units in the right direction but when a unit is near an enemy it will automatically attack. This would make the game more ‘overview’ and less ‘move by move’ in a way. More like Age Of Kings, less like chess.

I have a feeling this would make the most sense when combined with larger playing fields, whereas with the current small board the ‘placing moves’ aspect is still rather central and nice. But still an interesting thing to keep in mind for later.

Leave a comment