Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
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


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.