• Register
Post news Report RSS Unity3D’S crowd physics vs Trigghy’s crowd physics

As the new year charges on Trigghy (RIOT- Civil Unrest’s coder) wanted to update you on the biggest challenge he’s had to deal with. Let’s see what he has to say.

Posted by on

One of the biggest problems and challenges we faced with RIOT – Civil Unrest was handling the crowd. Some of the game’s scenarios only feature a hundred or so people on screen while others feature a cast of thousands! What’s more that doesn’t take into account any useable objects, scenario elements or the like… it all adds up to one heck of a lot of physics to manage as each individual needs to react to the others in its immediate vicinity. The result should look like a single mass moving and modifying itself as though it was a unique body. It really does use a lot of physics and processor power and when I say a lot, I mean A LOT!

However, when I joined the project and got a grip on how the original code worked it became apparent that it wasn’t going to work for with large crowds. Using Unity3D does have a lot of positive benefits but the code was throwing up way too many conflicts between the navmeshes and physics. Looking back I probably should have reached my conclusion sooner; characters moved in strange ways and blocked the path of others. The way the original code worked was just a mess with no fluidity to the crowd’s movement. There really was only one thing to do, drag and drop it into the recycling bin and start again.

So that’s what we decided to do, scrap the original Unity crowd physics and start over. Of course, it had been a valuable lesson I guess, leaning what didn’t and wouldn’t work. Starting from scratch on my own code I adopted a different approach. I took every character in the crowd and developed a system with which each individual applies a varying amount of positive or negative pressure on the crowd members directly next to them. The end result is a far more fluid mass of individuals that react as a crowd would in a real world situation.

Take a look at these short videos and notice in the example of the old physics how when pushed back by the advancing police line the crowd has a very chaotic, digital feel to it. Compare that to the far more fluid way in which the crown responds in the example of the new physics. You’ll also see the difference in the crown sizes too.

Post comment Comments
DonleyTimeFoundation
DonleyTimeFoundation - - 409 comments

Been following this game for a long while. Love the concept and the look of things. Really looking forward to the final release but please god take your time and make it the game you feel it can be! You have something special here and releasing this 'when it's done' is better than some arbitrary deadline.

KEEP THE FAITH!!!! You can do it!

-Tim

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: