D
Dramier
Guest
Some quick background:
I'm developing a game with one of the emphasis of design being sophisticated AI.
Currently I have a simple ecosystem modeled on a map that is 120 cells by 120 cells. Each cell represents 1 meter or roughly three feet. In this map I have a randomized procgen terrain consisting of dirt, grass, trees, rocks, bushes and water cells. The rocks and trees are non-passable. The exterior edges of the map are blocked solid with walls so nothing can leave the map on purpose or accidentally. I have two entities with AI in the form of a behavior tree. The first is a pig and the second is a wolf. Both entities have hunger, thirst, and fatigue and they active search for food and water and sleep when tired. They both can remember the last place they found water or food and return to it when necessary. They also have hitpoints and can die. When either entity dies it drops meat. The pigs eat grass, the wolves eat meat by hunting and killing pigs or eating already found meat on the map. Both entities have full line of sight and can recognize each other on sight. Pigs flee wolves 95% of the time, the other 5% they actually fight back. Wolves have a 95% chance of attacking each other and a 5% chance of fleeing.
The problem:
Everything is working splendidly at this point. In fact, that's actually the problem. I'm trying to figure out how to model the wolves hunting behavior. Currently since they are faster and stronger than the pigs on average, they always catch them. In nature, most predators are only successful something like one in seven times at best. I can't figure out how to implement some way of making the pigs escape. Basically the pathfinding is too perfect and generally the pigs can't escape because of it.
I would greatly appreciate any suggestions.
For the curious, the reason I'm modeling this behavior is because it is a building block for the AI that the humanoid entities in the game will use and I'm starting with simpler creatures. I'm also using simpler creatures to model just how complex the AI can be and still run a reasonably large map and alot of entities. Right now on that map at 120x120 it handles around 5,000 objects in the terrain with an unknown max amount of entities at a steady 60FPS. Resolution is 1280x1024 and can be zoomed in and out. Stress testing has yielded that it maxes out at around a 480x480 cell map with around 100,000 entities active not including terrain of about 20,000 objects. My machine is fairly powerful so I don't think that's an 'average' result to expect, but the goal is to have a map size of roughly 1200x1200 with a few thousand entities. It's currently unoptimized with no "off-screen" deactivation of objects, and the memory footprint is around 100mb with about 20% CPU load. Obviously the bigger maps increase that substantially. If you have any other questions about it feel free to ask. I've included a screenshot just so you can visualize what it looks like, no really needed but just trying to be polite.
I'm developing a game with one of the emphasis of design being sophisticated AI.
Currently I have a simple ecosystem modeled on a map that is 120 cells by 120 cells. Each cell represents 1 meter or roughly three feet. In this map I have a randomized procgen terrain consisting of dirt, grass, trees, rocks, bushes and water cells. The rocks and trees are non-passable. The exterior edges of the map are blocked solid with walls so nothing can leave the map on purpose or accidentally. I have two entities with AI in the form of a behavior tree. The first is a pig and the second is a wolf. Both entities have hunger, thirst, and fatigue and they active search for food and water and sleep when tired. They both can remember the last place they found water or food and return to it when necessary. They also have hitpoints and can die. When either entity dies it drops meat. The pigs eat grass, the wolves eat meat by hunting and killing pigs or eating already found meat on the map. Both entities have full line of sight and can recognize each other on sight. Pigs flee wolves 95% of the time, the other 5% they actually fight back. Wolves have a 95% chance of attacking each other and a 5% chance of fleeing.
The problem:
Everything is working splendidly at this point. In fact, that's actually the problem. I'm trying to figure out how to model the wolves hunting behavior. Currently since they are faster and stronger than the pigs on average, they always catch them. In nature, most predators are only successful something like one in seven times at best. I can't figure out how to implement some way of making the pigs escape. Basically the pathfinding is too perfect and generally the pigs can't escape because of it.
I would greatly appreciate any suggestions.
For the curious, the reason I'm modeling this behavior is because it is a building block for the AI that the humanoid entities in the game will use and I'm starting with simpler creatures. I'm also using simpler creatures to model just how complex the AI can be and still run a reasonably large map and alot of entities. Right now on that map at 120x120 it handles around 5,000 objects in the terrain with an unknown max amount of entities at a steady 60FPS. Resolution is 1280x1024 and can be zoomed in and out. Stress testing has yielded that it maxes out at around a 480x480 cell map with around 100,000 entities active not including terrain of about 20,000 objects. My machine is fairly powerful so I don't think that's an 'average' result to expect, but the goal is to have a map size of roughly 1200x1200 with a few thousand entities. It's currently unoptimized with no "off-screen" deactivation of objects, and the memory footprint is around 100mb with about 20% CPU load. Obviously the bigger maps increase that substantially. If you have any other questions about it feel free to ask. I've included a screenshot just so you can visualize what it looks like, no really needed but just trying to be polite.