Diving into Artificial Intelligence

A.I. has been a daunting shadow-beast lingering over my head for a while now. I have created the basic foundation for a fighting game (Suburban Scavengers), and in order to broaden its appeal, I will need to make it playable by a single player as well as two players. This will require that I learn the intricacies of competitive gameplay, the nuances of a human player, and what it takes to create a gradual progression of difficulty that is easily scalable on the back end.

I have chosen to approach this by using my own logic to create an intelligence system. This may not be the best or most efficient way to do this, but it is already providing me with great insight on how to make a cohesive system. I am currently on my second attempt at an A.I., and I feel that I'm headed the right direction.

Here's the break down of what I have chosen to do for this system:

1) Determine the most essential, core mechanics needed to make the computer player try to win.

This made me think about how basic movement needed to be handled. In this game, the goal is to push an object (couch) into your house. You can also pull the object up to the door of your house, which is sometimes more strategically sound than re-positioning yourself to push all the time. When the player reaches her house, if she pulled the couch, she will need to move to the other side of the couch to push it in. Walking into the couch will push it, so the player will need to slide or jump past the couch. The player also needs to know how to grab the couch to pull if the couch is in the opposing house and she is about to lose. Those are the most basic fundamentals to my current AI system.

2) Create enough variance to make the computer player less predictable.

When a player notices a pattern, it allows for easy exploits and makes the game less challenging. This got me thinking about odds based variable states based on positioning and past experience. For instance, when the computer is downed and the couch is being pulled past her, when she gets up, she will have a high chance of heading to the side of the couch that is closer since it is generally more efficient. There is still a small chance that the player will head to the other side, though, which is unpredictable. I have also considered choosing the direction the player heads based on the position of the opponent.

Other variance is in the slide. The slide attack is a great tool for mobility and disruption of the opposing player. The computer is set to try to slide when the human player is pushing the couch toward their house and they are within a set distance and the human player is on the ground. Shortening the set distance makes dodging more difficult. Occasionally changing the slide distance is an easy way to make the computer player less predictable. The computer player also has a chance to slide towards you more often when you are near your house.

3) Add extra features after the core A.I. is working

Now that the player is trying to win, it is necessary to add the rest of the game mechanics. Previously, when creating a check for when the computer should use a mechanic, I would first write down the name of the mechanic, then write when the player should use the mechanic (their state) and what percentage of the time they should use it. Making these lists made it easier to progress on my work. 

The mechanics that remain to be used in Suburban Scavengers are the punch, jump, block, elbow drop, and clash. It sounds like a bunch of work, but the states are fairly straight forward for these mechanics. It's funny how competitive the game already feels without these mechanics. I will update more when I have implemented these mechanics.

4) Display important variable states for the computer player on screen

This is important to determine why certain things are going wrong. Something as simple as seeing that the player is stuck between two states can make it much easier to hunt down a bug. Anytime the player acts in a way that is unexpected, I can see why that likely happened and get it cleaned up relatively quickly. I think I would lose my mind if I didn't have those visualizations.

That's pretty much it. I'll post more as I delve further into the A.I. system. I'm hoping to have it ready before the November 22nd demo release. At this rate, it should definitely be possible.

Thanks for reading! 

Until next time.

_Doombrowski

Facebook  -  Youtube  -  Twitter