Difference between revisions of "Roach Walk Sim"
Views
Actions
Namespaces
Variants
Tools
(Created page with "While the old crowd sim consisted of a walk part and a crowd sim part, both done as Python script, the new one uses the Game Engine for the crowd, but Python for the walk, and ha...") |
|||
Line 1: | Line 1: | ||
− | + | ||
+ | == Intro == | ||
+ | This is the documentation for the current crowd sim setup for cockroaches in act I. This is the second try at simming the cockroaches, the first 'bitrotted' due to changes in the Blender api. This uses much the same method, but a different implementation. | ||
+ | The original script was split into boids crowds simming and walking, both done in Python. The new one uses the Game Engine for the crowd, but Python for the walk. | ||
+ | |||
+ | == Game Engine Boids == | ||
+ | insert text here (from Tal's presentation?) | ||
+ | |||
+ | == Python Walk Engine == | ||
+ | |||
+ | The python walk engine uses a simple method based on the ant autowalker. This method starts off at a rest position in frame 1 of the simulation, and walks based on distance traveled- that is the walk is driven by the motion, based on a basic parameter of stride length: when a foot has moved back (relative to the body) by one half of a stride, it steps forward (the step taking it the other half of the stride). Thus a foot will execute one step during a motion of one stride of the body. | ||
+ | Since the cockroach has 3 sets of legs, the script can pick a pattern of primary and secondary legs. For each set, one side is primary and the other is secondary. The primary steps based on the stride, and the secondary (essentially) steps while the primary is static and vice-versa. | ||
+ | |||
+ | == What you need to start a sim == | ||
+ | |||
+ | You need: | ||
+ | * A Ground mesh that the roaches walk on, with the custom property __floor on the object. This can be created by making a dense mesh, parallel and over the ground, Turning on face/projection snapping, and moving it slightly in the top view. Meshlab (an external program) can then be used to simplify the dense mesh. | ||
+ | |||
+ | * A sim result. This consists of Objects with the name Player.### (where ### represents numbers, e.g. Player.001) The capitalisation is significant. These objects should have animation representing the overall motion of the cockroach over the ground. Please note you do not need to use the Game Engine simulation: hand animated objects are also O.K. | ||
+ | |||
+ | * Working reference desk (so you need certain filepaths set up) In a scene file, you should have the property 'library' with the value '../../library.json' as a custom property on your scene. In addition, you need the reference desk addon enabled (this can be found in tubeSVN/lib/python/addons/refdesk.py) and installed. | ||
+ | |||
+ | == Steps == | ||
+ | |||
+ | === Create the ground mesh === | ||
+ | As seen above, simply create the collision plane, typically done before any sim, and add the __floor property to it. | ||
+ | |||
+ | === Create the Player objects === | ||
+ | This can be done by hand animating empties or cubes, or by using the GE way. | ||
+ | |||
+ | === Import the autowalker === | ||
+ | If you have refdesk setup, you should be able to go to the 3D View Tools, find Reference Desk, and import Roach Crowd. You'll get an Autowalk_ui section in the Tools area. | ||
+ | |||
+ | === Generate the roaches === | ||
+ | Click generate in the autowalk UI and it should make cockroaches where the Player objects are. | ||
+ | |||
+ | === tweak settings, observe, retweak === | ||
+ | Use the UI to tweak parameters, and use the Live or Anim Update buttons to view the results, and retweak to satisfaction. | ||
+ | |||
+ | === Bake to Curves === | ||
+ | When satisfied, bake the animation into curves. | ||
+ | |||
+ | == Autowalk UI parameters == |
Revision as of 17:01, 16 December 2011
Intro
This is the documentation for the current crowd sim setup for cockroaches in act I. This is the second try at simming the cockroaches, the first 'bitrotted' due to changes in the Blender api. This uses much the same method, but a different implementation. The original script was split into boids crowds simming and walking, both done in Python. The new one uses the Game Engine for the crowd, but Python for the walk.
Game Engine Boids
insert text here (from Tal's presentation?)
Python Walk Engine
The python walk engine uses a simple method based on the ant autowalker. This method starts off at a rest position in frame 1 of the simulation, and walks based on distance traveled- that is the walk is driven by the motion, based on a basic parameter of stride length: when a foot has moved back (relative to the body) by one half of a stride, it steps forward (the step taking it the other half of the stride). Thus a foot will execute one step during a motion of one stride of the body. Since the cockroach has 3 sets of legs, the script can pick a pattern of primary and secondary legs. For each set, one side is primary and the other is secondary. The primary steps based on the stride, and the secondary (essentially) steps while the primary is static and vice-versa.
What you need to start a sim
You need:
- A Ground mesh that the roaches walk on, with the custom property __floor on the object. This can be created by making a dense mesh, parallel and over the ground, Turning on face/projection snapping, and moving it slightly in the top view. Meshlab (an external program) can then be used to simplify the dense mesh.
- A sim result. This consists of Objects with the name Player.### (where ### represents numbers, e.g. Player.001) The capitalisation is significant. These objects should have animation representing the overall motion of the cockroach over the ground. Please note you do not need to use the Game Engine simulation: hand animated objects are also O.K.
- Working reference desk (so you need certain filepaths set up) In a scene file, you should have the property 'library' with the value '../../library.json' as a custom property on your scene. In addition, you need the reference desk addon enabled (this can be found in tubeSVN/lib/python/addons/refdesk.py) and installed.
Steps
Create the ground mesh
As seen above, simply create the collision plane, typically done before any sim, and add the __floor property to it.
Create the Player objects
This can be done by hand animating empties or cubes, or by using the GE way.
Import the autowalker
If you have refdesk setup, you should be able to go to the 3D View Tools, find Reference Desk, and import Roach Crowd. You'll get an Autowalk_ui section in the Tools area.
Generate the roaches
Click generate in the autowalk UI and it should make cockroaches where the Player objects are.
tweak settings, observe, retweak
Use the UI to tweak parameters, and use the Live or Anim Update buttons to view the results, and retweak to satisfaction.
Bake to Curves
When satisfied, bake the animation into curves.