Hey guys, I was messing around with Unity 3 for the first time last night and put together a simple test level that includes a couple of different common AI behaviors. I thought maybe someone could get some use out of it, so I decided to post my project. If you’re interested in creating some simple NPC AI behaviors but don’t really know where to start… this might just help you out. No promises though.
This looks pretty cool. I ran through the webplayer version and will definitely check out the project (not at home at the moment). I plan on adding some wandering monsters to my game I am working on currently (offthepathgames.com) so this might be just the trick. I was reading part of the blog where you were discussing adding on to the AI by having them point at something rather than just straight ahead and was thinking that should be doable (by someone like me who might mess it up!) to have it point at a target rather than the way it is now.
This should definitely be doable. I’m pretty sure there’s some kind of aiming script already included in the Bootcamp demo, and there’s always the headlook example - both of those should be solid resources in getting this done. Good luck!
A cool technique for these soldiers would be a Subsumption Architecture for the AI.
Pseudocode I have in mind:
while( true )
{
[FSM Layer 0] - Pathfinding
{
Location to move to = Find Path Somehow;
}
[FSM Layer 1] - Individual Objective (Follow Player, Patrol with Buddies, etc.)
{
Location to Move To = Dot( Location to Move To, Other Position I'm keeping track of );
}
MoveTowards( Location to Move To );
yield;
}
I haven’t downloaded your project file, but I’m having a great time with Subsumptive AIs in Zombies vs. Knights; it’s proving so effective, I’m berating myself for not having tried it before.
I haven’t had a chance to try out a subsumption architecture in a game yet (only a project in college), but it’s on my list to try out for a while. Maybe I’ll give it a shot and post another project…