Fun With Artificial Intelligence
Created using OpenGL and my personal C++ Engine
Overview
This project features dynamic A.I. that interact with the environment around them in many different ways. The large, olive colored circles represent Orcs, the smaller, green circles are Goblins, and the Yellow, Blue, and Pink circles are playable characters that the user can move around. Some of the features in this project include:
- Multiple playable characters all with different statistics and attacks.
- Two different A.I. Monsters that interact with each other.
- Orcs and Goblins do not like each other, so they will fight.
- Orcs will gather in Villages and only create Paths that keep them in the Village
- Goblins are more likely to run away when they are at low health
- XML Parsing of Tile and Creature Blueprints.
This project is the first project using my personal engine, the Green Engine, that implements Artificial Intelligence. The A.I. uses A* to calculate their paths. The player has the choice of playing as any of three playable characters which can be switched between at any time. Each of the three playable characters can do different things. The pink circle represents the Mage character who is smaller and faster than the other two circles. The Mage can also cast magic missiles at any enemies. The blue circle is the Warrior who is slower than the other two characters, but is much stronger and has more health. The yellow circle is the Cleric who is slightly weaker than the Warrior, but also has the ability to heal. The Cleric is slower than the Mage, but faster than the Warrior, which creates a good balance between the three.
The monsters that are on the map are Orcs and Goblins. The Orcs do not like the Goblins and vice versa. If either one enters the aggro range of the other, they will fight. However, Goblins are more likely to run away if their health is getting low and they are much faster than Orcs are. On the other hand, the Orcs like to gather in Villages. Once an Orc has found a village, he will only create paths that keep him within the Village's influence. They do this because they gain a boost to their strength stat when they are in a Village.
I was trying to create a dynamic relationship between the two different monsters in this project, and I feel like that was a success. The two creatures interact very differently with different parts of the environment, but they share an equal hatred of the player characters. So if either one spots a player character, they will attack them.
The monsters that are on the map are Orcs and Goblins. The Orcs do not like the Goblins and vice versa. If either one enters the aggro range of the other, they will fight. However, Goblins are more likely to run away if their health is getting low and they are much faster than Orcs are. On the other hand, the Orcs like to gather in Villages. Once an Orc has found a village, he will only create paths that keep him within the Village's influence. They do this because they gain a boost to their strength stat when they are in a Village.
I was trying to create a dynamic relationship between the two different monsters in this project, and I feel like that was a success. The two creatures interact very differently with different parts of the environment, but they share an equal hatred of the player characters. So if either one spots a player character, they will attack them.
The thing I like the most about this particular project is the use of XML to create the maps. I defined the Tiles and the Creatures in their own XML "blueprints" and these are parsed into the application which figures out what to render where depending on what was in the map. To the right is the XML "map" of what is seen in the game. The different letters indicate what kind of tile is to be drawn there and help determine which "blueprint" each tile needs to have. These "blueprints" determine everything about the tile such as the color and if it's solid or not. Of all the things created in this project, the XML parser / Map Maker is the thing that I made a permanent part of the Green Engine. I still use it to create maps for any 2D games that I make using Green. |