Some Toaster AI improvements

I made some more improvements to Toaster yesterday and this morning. Specifically:

Have Toaster look for an enemy tile to place Grenades on

Before, Toaster looked for an empty space on the grid to place whatever tile it was holding. Now, if that tile is a grenade, it looks for an enemy tile to place it on. If it can’t find one, it picks another tile from its queue instead because placing grenades on empty grid spaces is pointless. Right now this will break the game if all three tiles in Toaster’s queue are grenades (because it’ll keep trying them one after the other indefinitely, never actually making a move) and that’s something I’ll be fixing today.

More variation in placement

Before, Toaster looped through its chosen line and placed a tile on the first empty space it could find. For example:

If the human had an infinite number of grenades and kept blowing away that one tile, Toaster would just keep placing a tile there over and over. In theory this isn’t a problem if position 4 is actually the best place for it to move, but that’s not the reason Toaster would be doing this - the reason would be simply that Toaster uses the first empty position it finds and places its tile in that place. Now, there’s a bit more variety because I’m having Toaster make a list of all possible positions that it could place its tile onto and then pick one at random. Not really the most strategic approach, but at least a little more varied.

I should note that these updates aren’t live yet. I’m still testing and making some more changes.

comments powered by Disqus