I started to develop a crowd simulator with blender’s game engine.
after working with 3dsmax biped crowd simulator, i noticed that the crowd simulator is basically very similar to a game engine.
I’m currently developing it for the cockroaches in the open source short film ‘Tube’ , there is also the crowd sim from josh that will be used, which is more based on particle systems.
you can download the blend file from HERE
and the python script from HERE
Right now i finished the first step of the Crowd sim, which they need to avoid each other, and have a target. the yellow group need to get to the orange box and the green group need to get to the blue box.
I can write more explantion about the AI if people are interested but you can also just check the python script.
the next thing i need to work on is climbing system, so that the cockroaches climb on some objects.
after that i will make some objects that will trigger them, like something that will fall and make them run away using the near sensor.
It’s my first script with python, so i would really appreciate if people can have a look on it and give advices or ask questions, I had some problems with python like setting up some variables for the movement (my) for example. instead, I had to use the object property to set it up, but i don’t really need it as a property just variable that change all the time in python.
actually it’s not exactly my first script, I started to build the crowd sim with character from my work (I work as character animator in video game company so I already had all the clips like walk, run, turn left, turn right, idle…) you can check the old version of the sim here
but it’s without the characters since I don’t “own” them i couldn’t upload them as well. the main difference is that the characters have 2 different turning modes, one is bending and the other turn exactly 90 degrees with f-curve and then the character was using turn left or right clip.
in the current version the use only motion actuator for turning, and they are a little bit smarter
here is some problems I’m still facing (with the current sim):
when you open the current version of the simulation there is 2 scenes. if you go into scene2, you can see that i build kind of a small maze for the cube that need to get out, well, it doesn’t. at some point it get stuck with endless turning, and this i guess i will solve with the timer.
I’m assuming that it’s conflicting with the target trackTo and also mainly the near distance is conflicting with the far distance radar. I still didn’t manage to solve it
Recording, somehow i can record the cubes only on 60 fps. does any1 have an idea why? is it possible to record on other frame rates.
also another MAIN problem is to record armatures animations, if there would be a way to cache the animations, or even better, getting it into NLA clips, then i think we will cross a big bridge from the game engine into the crowd sim.
A good crowd sim could also go backward in the sim to look for new solutions when he get stuck, I guess this would be completely into the game engine and changing it. it could be cool, but i guess i will just need to settle down on a good AI for my boxes.
the objects have priorities that also affect on their behaviors.
Could be cool also to write a script that give them automatically priorities for the objects, but before starting the simulation, so i can still alter them, right now i need to give priorities one by one.
in the end i would like to make it somehow user friendly. with some interface or maybe at least to use the object properties as the interface.
if there is people that could help somehow with this project, then fill free to join aboard. I guess right now the main thing I could use is the armature recording.