Pathfinding for crowds?

Posted By: gameplan

Pathfinding for crowds? - 10/22/16 00:40

Hi,

I want to implement a pathfindung solution for a big crwod of dynamically moving entites. Every entity should avoid contact with each other entity while finding a path through a moving crowd of entities over a unevan surface.

I just want to ask, if someone does know a good starting point? Does there exist a specific algorithm, that suits best for this excercise? What do you recommend?

Thanks.
Posted By: sivan

Re: Pathfinding for crowds? - 10/22/16 07:26

WJBender made a navmesh plugin called Peragro of the Recast/Detour/DetourCrowd. By the way, it is available in Unity and UE4 by default. I don't know whether it is still available or not, he switched to Unity. It has good performance I think only max 100 characters. To make your own plugin:
http://masagroup.github.io/recastdetour/
https://github.com/recastnavigation/recastnavigation

another open source solution is RVO2:
http://gamma.cs.unc.edu/RVO2/

by the way if you need larger crowd, you can implement a vector field pathfinding and movement system, or use simply a potential field. I have recently implemented my solution based on this, but it does not deal with avoidance (but possible to add little repulsion to the heat map around units):
https://gamedevelopment.tutsplus.com/tut...g--gamedev-9007

But it really depends on you what you mean by crowd, and what is the exact purpose, what limitations you can accept on quality and performance...
Posted By: rayp

Re: Pathfinding for crowds? - 10/22/16 13:25

To keep performance high use a single while that controlls all ents stored in a array.
this mass ai tip changed my life.

My mass ai project
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=460893#Post460893

Greets
Posted By: gameplan

Re: Pathfinding for crowds? - 10/22/16 19:49

Hm, most of the implementations that I have locked at, seem to need a navmesh or nodes, that need to be placed by hand. I would appreciate a solution, that works without manually setting navmeshes, nodes or similar things.

I want to implement a navigation / pathfinding for around 500 NPCs, that works for a dynamically changing enviroment (many moving objects). Examples for similar implementations are Picmin, Age of Empires or Left4Dead.
Posted By: Quad

Re: Pathfinding for crowds? - 10/22/16 20:58

Recast is for autogenerating navmeshes from level geometry.
Posted By: rayp

Re: Pathfinding for crowds? - 10/23/16 00:46

500 npcs with acknex?
that is not realistic. Even left4dead source engine cant handle such amount of ents. Dead rising maybe. That was the reason why capcom was impressed an bought bluecastle.
It took me years to have 50 pathfinding moving and animated ents with 60fps.
anyway good luck wink

Greets
Posted By: 3run

Re: Pathfinding for crowds? - 10/23/16 08:45

Hi!
Originally Posted By: gameplan
I want to implement a navigation / pathfinding for around 500 NPCs, that works for a dynamically changing enviroment (many moving objects). Examples for similar implementations are Picmin, Age of Empires or Left4Dead.
Well, it may work but don't forget about models, bone animations, shaders etc... They will probably ruin the whole thing and at the end you'll get around 15-25 fps (that's what rayp is talking about I think). Maybe if it's going to be hardly optimized (well, it depends on the type of the game you make), well, I can't guess, let's see how it turns our, I'm curious.

Best regards!
Posted By: Aku_Aku

Re: Pathfinding for crowds? - 10/23/16 13:33

The Conitec had a demo that showed hundreds of animated models in an infinite loop.
As i remember it was cca. 6 years ago.
Here: MMO test you can download a special version of A7 what aimed exactly the same, showing 500 animated models at 60 fps.
Maybe A8 can give more performance nowadays.
In the zip there are two test executables.
1. for testing crowd.
2. for testing terrain.
Good luck!
Posted By: rayp

Re: Pathfinding for crowds? - 10/23/16 14:51

Standing animated models is one thing. Pathfinding moving and animated another thing.
looking forward to this.
greets
Posted By: sivan

Re: Pathfinding for crowds? - 10/23/16 21:23

the best to check what other games use in the similar genre you want to make. probably most of them select different methods not accidentally.

With 3DGS, I could achieve only 25 FPS as an average, handling about 400 characters (moving in group formations) in my RTS testbed level (filled with buildings, trees, and using shaders like water, shadowmapping etc.), when reached a good enough quality, after many-many optimizations. It required to implement my own complex pathfinder and movement system... with A8 Pro edition where I have terrain LOD and GPU animation.

But a lot depends on what quality you need, how many of units are visible, their bone and vertex number etc. If the behavior is very simple you can have more, but game engines are in general not for this purpose, rather for something like an FPS.
© 2024 lite-C Forums