10
\$\begingroup\$

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ Are you interested in collision avoidance of large crowds, or giving each crowd member a purpose and a destination? \$\endgroup\$ – tenpn Oct 8 '10 at 16:29
6
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Steering behaviours are perfect for this, as long as you don't mind a lot of feet-sliding. \$\endgroup\$ – tenpn Oct 8 '10 at 16:33
2
\$\begingroup\$

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.

\$\endgroup\$
2
\$\begingroup\$

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

\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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