Predator vs Prey Simulation

Description

This simulation showcases two types of AI behavior. First, the prey agent, uses a Neural Network with a genetic algorithm to update the network weights. Prey agents that consume three food objects split themselves, copying their network with small random adjustments to it’s network weights. Learning rate is also passed onto prey offspring with the same potential for small fluctuations in the child prey agent. The prey recieves it’s current movement vector as input as well as the closest food, enemy and wall from each of it’s three vision cones. If a prey does not consume food before it’s energy runs out it will die.

The predator agents uses Goal Oriented Action Behaviors coupled with a genetic algorithm to determine behaviors. The three possible behaviors are to hunt (red), sleep (blue) and look for a mate (white). Predators also have multiple attributes that work on a point system. A set number of points are randomly allocated amongst all possible attributes. These attributes include acceleration, top speed, vision cone size etc. When two predator procreate portions of each parents point allocation are passed to the offspring. These allocations also have a small chance for random mutations. If a predator collides with a prey while it is hunting it will gain energy and kill the prey. If a predator goes too long without food it will die.

Next
Next

Hit targets to stay alive as the screen collapses