Bumper Bash: Creating AI for the Computer Controlled Players.

Posted on December 28, 2007. Filed under: Bumper Bash, Projects |

When I was developing the initial concept of Bumper Bash, I realized immediately that the level of fun and re-playability would depend not so much on the player controlled bumper car, but on the behavior of the bumper cars controlled by the computer.

I needed to find a method of controlling the cars that gave the appearance of intelligent choices and actions by the cars.

So right away that narrowed down the choices. I will be the first to admit that python probably could have done this faster and more efficiently. But since we all know that I can’t write python code to save my life, I was left with finding a way to create my “intelligent AI” with logic bricks.

Keeping in mind that the object of the game is the same for the computer controlled cars as well as the main player, namely to collect fruit/coins to gain points while avoiding other players and the various traps in the ring, I needed the “enemy” cars to have two goals or behaviors, movement and collection of points.

To begin with let’s focus on the movement behavior. The enemy cars need to move about the ring with a purpose. I was inspired by the “Simple AI” created by Mmph! and p00f, where the “enemy” was made to follow a path of invisible cubes placed strategically about the play area. This is a great method for having an “enemy” patrol an area, but didn’t quite fit what I needed.

Upon further review of the node path system, I realized although it was meant for patrolling an area, it could be adapted to my needs with a minor modification. Since the path node system was designed for corridors or tunnels and my arena didn’t fit that description, once I placed my nodes, I gave each of them a small area to cover. It was a simple case of placing a loc key (at frame 1) at one side of the nodes area and another loc key (at frame 60) at the other side. Then I set up an always sensor connected to an IPO Actuator, set to ping pong. It is not a very complex movement (just a simple back and forth), but when the enemy car is searching for its next node, it gives a more random appearance, as it has to chase down the next node as it is moving back and forth.

The AI path node system has an ingenious way to change the direction of tracking the nodes (forward VS. backward) and alter speeds while doing so. Giving various objects in the play area a “property” that will trigger direction and speed changes upon collision, allows a randomness to the changes that look deliberate. At present I have a moving cube crisscrossing the arena in a back and forth motion to trigger direction and speed upon collision with the enemy car. As I see how the game develops, I may also set collisions with the other cars and maybe the arena walls to trigger direction and speed changes.

At this point I am pretty happy with the movement behavior of my enemy cars. For now it creates the illusion I am looking for, but for future games, it would be worth investigating a method of randomly choosing which node the “enemy” tracks to.

Next task is determining the best method for collection of the fruit /coins/points. It’s possible that I could set up another node network and have the car switch node networks when near a collection object. Then switch back to the path node when the object has been collected. But then again, I have also been toying with the idea of having the bumper cars shoot fire balls at the object to collect it. A third alternative would be to set up the collection objects and run the game to see if the random movement of the enemy cars would end up with the cars collecting enough objects just by running over them. This of course will require a little more thought.

Make a Comment

Make a Comment: ( 1 so far )

blockquote and a tags work here.

One Response to “Bumper Bash: Creating AI for the Computer Controlled Players.”

RSS Feed for ThruDreamsgate’s Blog Comments RSS Feed

Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru


Where's The Comment Form?

  • Top Posts

  • Some of my Blender Images

    Winter

    Spring

    Summer

    More Photos
  • SocialVibe


Liked it here?
Why not try sites on the blogroll...