Programming Project, day 20 – Artificial Intelligence working!

The artificial “intelligence” works now! It was really fun working with. Right now it only has one state, “Farming”.

Actually, the state works in two ways and I will transfer one of these ways to another state which I will call “Fleeing”, “Escaping” or something like that. The “Farming” AI checks the nearby tiles, moves and places a bomb if the conditions are right. Then it runs away (this will be transferred to the “Flee” state) and repeats. It only checks for nearby blocked tiles right now and it doesn’t care what exists within the tiles which makes it really stupid.

The code is now flexible enough so that I can set any player to either be AI-controlled or player-controlled. Each player has pre-determined keyboard buttons for controls and I might make that customizable later but I guess it’s not worth the work because it probably wont add any points to the project. So if there is time, I’ll do it but it’s low prio. I can set the AI-/player-control only in the code right now but I’m about to add AI-options to the GameSetupState. I’ve already added some objects and some flexibility to their position.

I changed the “best of” setting to “total wins for victory”. It makes more sense for the four player mode I think.

I spent the last hours mostly pitting four AI players against each other and see my minions go at it =) … making small changes to their behaviour.

Btw, I wrote yesterday that I would say how I placed the AI-statemanager and states. I have the manager as a member of the PlayerObject and if the player is controlled by an AI, it uses it to determine inputs.

And some pictures!

The new GameSetupState, which will change even more soonish. I guess that’ll be what I’ll do net.

Image

My minions killing each other (but mostly themselves because they’re stupid).

Image

More minion action, game over!Image

The GameEndState.

Image

This entry was posted in 5SD022. Bookmark the permalink.

Leave a comment