1.17.2006

Artificial Intelligence

I'm beginning to set up the AI for the enemies in my Mapes' Bunker level. I could be doing such as snapping in doors and switches at this point as well, so that the level is 'fully functional,' but considering that the prefabs to be released with FEAR patch 1.03 should include a number of sliding and swinging doors already set up, I've decided to avoid doing any potentially redundant work until I see the exact contents of that patch.

Fascinating, eh?

For being so robust, setting up the AI characters ("CAI" from here on) in FEAR is relatively easy. Basically you just lay out a ground plane that dictates the boundaries that they can run around within, then place AI Nodes around which tell the CAI where to take cover, where to jump over or crawl under something, where a window is to dive through, and so forth. You set the variables of these nodes and let the CAI run loose. It makes its pathfinding decisions dynamically based upon the AI nodes and the position of the player.

So, in my first combat space, I set up the AI navigation meshes (navmeshes) like this:
Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us

Which translates into this ingame:

Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us

I spent a while trying to get the CAI to jump down from that ledge, and finally got it working. It was very satisfying to run around in godmode provoking the CAI for a few minutes, and finally to catch one jumping down just as I'd been wishing it would.

You'll notice how flat and dull-looking everything is. I expect that after I set up all the AI, my next step will be finalizing the shell geometry (the contours of walls, pillars, etc.,) texturing it, and then lighting the whole shebang (followed then by placing prefab decorative objects and atmospheric sounds, and whatever else needs to be done.) In the meantime it's all lit with a flat ambient light across the level with no textures or artistic details. It's ugly, but it's heading towards functional at least, which is exactly what I'm going for at this point.

Also, those stairs didn't used to be there. I originally had ramps leading from the upper to lower level, but found that the AI had trouble with clipping through the floor when it was going up or down the ramps. So I replaced them with stairs, and an AINavMeshLinkStairs path. But they would still weirdly float above or clip down through the stairs when ascending or descending. Eventually what I figured out is that the CAI can only navigate the AINavMeshLinkStairs path in an exact 45 degree angle, meaning that the only coordinate that really matters is X; the distance from one end of the stairs to the other will be traversed by the AI at a 45 degree angle regardless, so more gently-sloping flights of stairs are impossible. FEAR is kind of weird. It's stuff like that where you can really begin to feel the baggage left over from earlier Monolith projects like No One Lives Forever. I remember that in that game, if you killed an enemy on stairs, they would pop into a rolling animation, play that as they descended the staircase, and then pop into a death pose at the bottom. I assume that they could only play that animation in a 45 degree path as well. If it ain't broke don't fix it, I guess. Though, it kind of is.

Side note:

Free Image Hosting at www.ImageShack.us
That's nazty!

There are some things that are better left unseen fullbright!


No comments: