Wednesday, January 5, 2011

Pack AI

Okay, I'm starting to study DirectX today, although hockey is definitely getting in the way, along with my panic disorder which had me fearing a heart attack for about an hour today because of an evil, evil treadmill and a stupid, stupid Matt... Anyways, feeling better now and sitting down at the computer, which is definitely among the first steps to studying programming. There's very little to talk about the studying though so, I'm going to talk about the prototype, because it's super cool.

The plan is to have a three tiered AI system:

The first tier is the world, which will move the packs around on a large scale. It will keep track of predator-prey relationships and keep those in consideration as the pack moves around. It will run from predators and chase after prey (losing/gaining population as incidents occur), the world will be in control of these incidents as well as returning the pack to it's den at the end of the day (where they may procreate and gain population).

The second tier is the pack. When the player comes within a certain distance of the pack, it will be initiated. The number of creatures in the pack will be created and placed and they will start interacting. The tribe will be the backbone of the AI by setting objectives for each creature AI. Along with simple patrolling movements, it will be in control of location through howling, as this is what the AI is mainly about, I'm going to go a bit more in depth as to how I see this working.

When a creature notices a prey it will howl (if it is judged wise to do so, if the other creature is weak but fast, it won't spook it, if it's slow and impossible to take out alone, it will howl), all the tribe members will then converge on the creatures spot. This will result in another creature seeing the prey, that creature will then howl as will the first creature, then the rest of the tribe will converge on the middle of these to. And so on and so forth, a constant stream of howls and reply howls, until enough creatures are there to take down the prey.

The tribe system will then position the creatures in the best location to fight the prey (generally around it). Once that's done it'll trigger when creatures attack (the one behind the prey, generally).

The creature AI is the last and lowest tier. It will be in control of simple things, like pathfinding and actions.

I hope this will allow for a more realistic world without too much more overhead.

On the prey side, the pack AI plays less of a part. When a pack member is attacked it'll emit a sound. All other members that can see that pack member will run in the direction it is running. Others will run away from wherever the sound was emitted. It could also be the case that the pack will be close enough together and have defensive abilities at which point the pack AI will set them in a defensive formation.

The main point of the AI is to make hunting/being hunted more fun for the player. So pack AI versus pack AI should not be too much of a priority. But, I hope to eventually make a Tribe AI (human AIs instead of creature) based on this so there will be some priority given to AI interaction.

The tribe AI is a topic for another day, though.

Tuesday, January 4, 2011

New Year, New Beginning, New Goal

First of all, happy new year to all. I wonder how many blogs are "created" during the first week of the year. I bet it's a lot more than the number that are still active after a few days. Hopefully this one'll keep going, and going, and going... But who knows. So that's about all for the "New Year" part.

The "New Beginning" is what this blog isn't going to track. I've been programming on and off for five or so years. But I feel like I've barely made any real progress. And that's why there's a new beginning. I'm starting over, although not completely, but in many respects. I'm going to be going over things I already know and it'll be frustrating but, I've got to do it. I've got to round off everything I know. I'm going to start with the basics, DirectX 3D. I'll do the tutorials and what not and then move on and move up. But to where?

The "New Goal" is where this is all going to end. By the end of the year, I want to be in the industry, or at least at a level where I should be in the industry. I haven't figured out what skills I want exactly, I have some ideas.

For now though, it's time to start reading some DirectX, then Bullet, then I plan on making a hunting prototype based on some AI ideas I've come up with. Hopefully it'll work, maybe it won't. Then OpenGL... It's going to be fun.