Does anyone have a general idea about efficient path finding and collision avoidance for a crowd simulation?
Thanks 
Does anyone have a general idea about efficient path finding and collision avoidance for a crowd simulation?
Thanks 
I have pondered something similar to this for my current project. What I though about is this: I get the positions of the (10) nearest objects to the owner. I then find the distances between each of those objects and find the smallest distance. I get the average position of the two objects (right in between them), and move the owner there. I came to this idea by asking myself: How would a human do it?
There’s a good tutorial on path following and group behaviour http://natureofcode.com/book/chapter-6-autonomous-agents/
This should be a good start. The code is in processing but should be easily translated.
Per actor pathfinding is most likely right out the window.
What is the crowd supposed to do?
As a group move to a place?
Simulate a busy environment?
Is the map dynamic and complex or simple?
Complex mazes, or static streets/terrain?
I have had a lot of luck with semi-random movements.
I would basically have the npc move in a random direction, where the objective direction has better weights.
They would only respond to npc in the immediate vicinity.
As there is no actual path-finding required, simulating 2000 npc was no hassle 
They were fairly competent on simple terrain.
Maybe the main point for me is that path-finding and collision avoidance are not the same thing.
Think robotics, like roombas, ir-sensors and whiskers 
I’d humbly get down on my knees and beg a developer to expose detour’s built-in crowd management.
Think robotics, like roombas, ir-sensors and whiskers
Having done a mechatronics (robotics) engineering degree, I can say with confidence that AI in games is very very similar to AI in robotics. AI in games is slightly easier because you don’t have to justify the cost of sub-micrometer-accurate Lidar sensors every time you want to cast a ray…
For a crowd? Probably the simplest trick I can think of is that you don’t need to simulate all of them. Examples:
If #1 and #2 are done properly, most agents do nothing at all except move from one defined location to another without needing any checks to avoid collisions. Only the edge ones need clever obstacle avoidance.
Also look up boids.
I have had success with this by having simple behavior add up,
Like the closest agent to the door pathfinds out,
Another useful scenario was the zombie ai that if they saw a zombie chasing a player, they chased the zombie, the next zombie chases the second and so on.
Find a path for the group then move them in the same direction using per agent basic collision avoidance.