 So, hello, everyone. I hope you still have a bit of energy left. Cool. Welcome to my talk on Crowds for Battle. I am Monique. I'm a developer of Crowdsum 3D and I'm also a Blender developer. Crowdsum 3D is an agent-based crowd and traffic simulation add-on for Blender. You can easily create a complete traffic system with your lanes, junctions, traffic lights, and you can even configure some traffic rules. The traffic system supports cars, public transportation, pedestrians, and also very long vehicles. The crowd simulation, with the crowd simulation, you can create any type of crowd, moving or not, with path-following, avoidance, target navigation, and even a bit of animation blending for a seamless motion. Animations can still be edited after the simulation using the NLA editor. Past one and a half year, I've been focusing a bit more on battle. Why? Well, I wanted to know how they create this battle scene. And I must say there is also some community support to do a bit more battle. So I'm going to talk a bit about what we've been doing. When you start with battle, you first need a crowd and you need animations. So I started with a Viking and a British soldier and using the mesh and material varieties in the crowd scene, I could create a bit of a fried crowd. I've seen quite some crowds in battles where kind of looks, many of the soldiers look much alike. I personally love it when a crowd is a bit more of a riot. And yes, I've watched quite some movies and series with battles. The March. So lots of battles start with a march. The march is kind of like building up the tension towards the actual battle. But if you look at, well, many of the marches, they're very neat, they're very correct, they're very static, all agents have the same speed. There is no interaction between the agents. You can easily see that they're following a path. So I was a bit curious, how can I create a bit more variety? How can I create a bit more interaction within the crowd? So I started playing a bit with having different agent speed. Still using path following, but all agents having a different speed. So you can already see that they're already are passing each other, they're avoiding each other. There's a bit more interaction going on, but they're still following a path. So I played a bit around with using two curves. And the idea of two curves is that they will move between the curves. So I'm using the curves to guide them. They're not following one curve, they're trying to move between the curves. And even though the agents have the same speed, you can still see a bit more interaction going on. Here's another example, where I want the soldiers to move a bit apart and then merge together. Already a bit more dynamic than giving all agents the same speed, having them walk the same walk cycles and just moving forward. I find that a bit boring. So having a bit more action, I think makes it a bit more nice. So I, again, started to play with the agent speed and you get a bit more chaos. You can see the agents passing each other, avoiding each other, leading a bit more into a bit more interaction. And having watched a lot of, well, battle scenes, I don't see much interaction within the crowd. There is interaction of the crowd with their environment, but within the crowd itself, you don't see much interaction. It's usually very neat. So I think we have a way to make it a bit more dynamic. I also played with the curve speed. So giving the agents the same speed, but giving the curve a speed so that agents near the curve would adapt the speed of the curve, also give a different dimension to the crowd. So given all these possibilities, it was time for me to play a bit with battle scenes. So here I'm using path following to have three groups of Vikings kind of merge together, but not totally merge and then split to go around the leg. And I wanted the green and the blue soldiers to mix a bit and also have the green soldiers move along with the red soldiers and the blue soldiers to go around the leg just to get a bit more dynamic and make it look less static, less neat, less mathematically correct. Now, one of the major challenges that I was facing was avoidance. Having interaction within a crowd means that I needed a good and proper avoidance. You already see that they are avoiding each other, but many avoidance algorithms don't work that well. So now I kind of understand why many marches, they don't use much interaction within the crowd because it's very hard to get the avoidance working. Lucky for me, in 2017, a paper was presented at SIGGRAPH and it's about using implicit force algorithms for crowd simulation. In 2018, the same group of researchers, they updated this algorithm and they called it the implicit force time to collision and that's basically the one I'm using. So I tried this algorithm and I was really happy with the results. If it weren't for this algorithm, I wasn't able to get a proper avoidance here. The challenge I did have was making the algorithm work for moving objects and still objects. So in this case, the vikings are avoiding each other, but they also need to avoid the trees and that was a bit of tricky. I did spend a lot of time tweaking the algorithm and finally I managed. So hopefully now that we have a good avoidance algorithm, we can do a bit more dynamic crowds and make it less boring. Another challenge I had was the animation blending. So the crowds have already supported animation blending, but I still had some challenges here. So creating work cycles for every speed and every pose is very time consuming and in my case, very costly because I'm not an animator. So I'm working together with a modeler and an animator to create these models and these animations and the basic idea is that you don't have to create all the key poses for every speed and for every pose. You just create a set of key work cycles that can be blended and per key work cycle you configure the speed. So in this example, you can see the viking running and I'm using the speed to determine which key work cycles to apply and how much these need to be applied. So for the viking, you can see per frame that I am basically mixing the run left, the fast walk and the run for a certain percentage. And by blending these animations, you get a bit of a seamless motion because he's avoiding the trees and he's also trying to avoid other agents. Keep in mind if you have more key poses, the animations will be a bit more fluent. I'm just using one, two, three, four, five, six here. Another challenge I had with the animation blending was that the animations or the cycles don't have the same duration. So you can imagine that a walk cycle will take much more frames than a run cycle. So you still need to be able to blend these different walk cycles of different length duration. Here you see another example. This is a very, it starts with a very neat march. And I'm using two cylinders as collision objects. So when the soldiers collide with the cylinder, they start running. And I needed to blend the animations here where they go from, well, a simple walk to a fast walk to running. And in the meantime, also avoiding each other. And that was the difficulty here because it's not just, oh, you go from one cycle to another to another. The, for example, the avoidance would say, now you need to go a bit slower. And then the agent needs to adapt to that speed. And the proper animation should be blended. So you're constantly switching a blending different animation because, for example, the avoidance is giving back, go slower because otherwise you'll bump into someone. Or you run into three. Or you need to turn left now because you need to avoid two other soldiers. And it kind of made it possible to blend these animations properly based on the speed. Here's another example where I'm using formations. I'm not using the implicit force avoidance here. I was running into some issues that I couldn't get the soldiers to stand still. I guess there's always a force at work, so they would constantly move. I'm using the RVO2 algorithm here for the avoidance. But also here you can see the soldiers going from standing still to running to standing still and sometimes slowing down if they need to avoid someone else. What's next? The battle. The idea is to work on battle scenes to go to the actual battle. But before I can do that, I need to fix a few issues in Blender. One is the performance of working with lots and lots of objects in Blender. Blender is very slow when working with many objects. If I want to have 20,000 soldiers in a battle, that's a challenge in Blender. But luckily, past months, I've been working on some patches to improve the performance. And a few of these patches have landed in Master and will also be available in Blender 3.4. So do watch out for Blender 3.4 because it's going to come with a lot of performance improvements when working with lots of objects, lots of meshes. It's going to be way much faster. I also do have to thank some other developers, Bastien, Campbell, Hans Arras, who have been also working actively in getting Blender faster for working with really massive scenes. Another challenge I have is playback. When you have a stadium, 68,000 chairing people, and you want to review that in Blender, good luck on that in the 3D viewport. When you have a simulation, you want to just have a quick review of the animation. Is it correct? Is it what I want? You want it to have it seamlessly so you can decide if you need to change something. Blender's viewport is a bit very slow on that. So I know there's some discussion going on in the animation team, how to cope with that. But for the meantime, in the crowd simulation, we're going to add an overlay so you can seamlessly check your simulation. Examples, examples, examples. Doing crowd simulation is quite complex. It's not easy. Luckily, we've had quite a group of people who are actively involved in giving feedback, and they were asking for example files to be able to learn and to be able to also do some work for customers. We couldn't share example files because I was using assets bought in the Blender market on Gumroad, so I couldn't share the example files. But thanks to the community who supported us with this add-on, we were able to create our own assets, so the Viking and the British soldiers and the animations for that. And with our own assets, we could create example files. If you purchase the add-on, the example files are available, so you can download them. It includes the Viking, the British soldier, and the animations for that. And you can play around and create your own scenes. If the battle scenes are ready, then they will also become available for you to play with. Next project. When I'm finished with the battle scene, then the next project will be about... I'll be focusing more on crowds for cities. So the idea is to have a stadium crowd, and then something happens. I still need to think about what. And then there is panic, and you'll have a city scene and people running around in panic. Why am I focusing on this? Because I'm expecting a bit more fuzzy logic. And I want to see how I can improve the crowd simulation to work a bit better with fuzzy logic. And we've already had the characters created and some animations. And again, these will become available in the crowd simulation when it's there. So that's it. Thank you very much. You can download the crowd simulation from our website. There is a free version available, so you can play around with the crowd and traffic simulation. And you can follow on YouTube. We have some tutorials and a playlist. And sometimes I use Twitter as well. But thank you very much.