Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Is there an "academic" way to have NPC walking randomly on a map, but having a believable comportment ?

The obvious scenario is a armed guard who is walking around a basement to secure it. It's quite easy to set up a "believable" path.

What I'm looking for is a way to simulation a crowd in a small town, in fact. How can I make their move look like they aren't goalless robots.

share|improve this question
1  
Are you interested in collision avoidance of large crowds, or giving each crowd member a purpose and a destination? –  tenpn Oct 8 '10 at 16:29

4 Answers 4

up vote 6 down vote accepted

I suggest you have a look at Craig Reynolds Steering Behaviors. To make things more interesting, you could also switch behaviors depending on the situation the NPC is in.

share|improve this answer
    
Steering behaviours are perfect for this, as long as you don't mind a lot of feet-sliding. –  tenpn Oct 8 '10 at 16:33
    
Thanks for this! I'm really enjoying this paper! –  James Bedford Mar 9 '11 at 8:21

aren't goalless robots.

Easy, give them goals. Give each NPC a destination depending on the map you may not even have to path find for them just Steering, or precompute the path between doors in town.

share|improve this answer

A combination of node-navigation and steering behaviors actually produces some nice results, if you believe research documents (I personally haven't tried this approach): Link to paper:Steering a Virtual Crowd Based on a. Semantically Augmented Navigation Graph

share|improve this answer

Create goal nodes at logical places of interest in your world and then have the NPCs navigate between these nodes. Ideally you also have animations associated with the goals such as looking at a billboard, throwing trash into a trash can, sitting on a bus bench.

Then as NPCs spawn give them a target to go to and use. Once they've finished the animation at a target, give them a new one.

To break this up further, having some random idle time after finishing a goal, so they don't all go to the next thing immediately. Also spawn some NPCs at their first target so they immediately start playing the goal animation. The more interesting objects you have in the world the more it will feel like a place.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.