Riot Control Simulator ~ Devlog #6 "Dealing with crowd."

Riot Control Simulator

Take on the role of a Riot Control officer and control a riot. You can either brutally deal with the crowd or use more reasonable options. Will you decide to support a nascent dictatorship?

Hey everyone, Today's blog post is about working with crowds in our game. In this video we will talk about how we achieved it: [previewyoutube=74qxLhrg7AA;full][/previewyoutube] Game engines are not optimized for rendering such amounts of characters simultaneously on the screen. The engine we are working on starts to slow down significantly when there are around 100 characters on the screen, and we don't only have to render the crowd characters. We also have to render other police officers who are helping us in the action, and often there are as many of them as there are rioters. Even AAA games avoid such amounts of characters and usually we will see a maximum of 15-20 characters on the screen at the same time. A big distinction in AAA games was the game Days Gone where hordes of zombies could have up to 500 characters at the same time and it was quite an achievement. We tackled this topic and managed to develop a very efficient technology thanks to which we were able to introduce crowds of 500-1000 characters into the game. Our limitations were maintaining full physics in contact with a water cannon, interaction with the player and inverse kinematics (when, for example, the character looks in the direction of the player). To achieve a large crowd, we used a technique of instancing a character model through the GPU. This is a standard technique for accelerating the rendering of a large number of objects. Unfortunately, this was not enough. The bottleneck turned out to be the skeletal animations of the characters and the "Animator" engine that controls the transitions between animations. The solution was to replace the skeletal model (skinned mesh) with a standard animated model. The animations of this model were baked into a special shader that animates the model's vertices on the GPU. Additionally, animation switching was done from code rather than from the animator. This way we got animated characters whose number can reach up to 10,000 at the same time. Unfortunately, this solution has its big limitations, such as lack of physics ragdoll of characters, lack of inverse kinematics. The number of animations also has to be small, as it consumes memory. We therefore decided to use a hybrid of the classic approach to characters and one that allows to achieve a crowd. When the player is close to the character, it behaves in a classic way. Thanks to our technique, we were able to create large crowds that will be a challenge for the player. Thanks for supporting our project! Best regards, Riot Control Simulator team