Caching agents - Houdini
In Atoms you can save your simulation on disk using the Atoms cache, then it is possible to reuse these caches with the "cacheReader" behaviour module. The Atoms Cache is lightweight and fast. It can increase the performances of your scene dramatically compared to using live simulation.
With the cache reader and the agents layout tool you can edit and tweak your cache.
Exporting a cache
You can open the cache exporter GUI using the shelf button or via the Atoms Menu: Atoms > Export > Cache Exporter
Create an agent group
Add a grid layout behaviour module and set the size attribute to (5,1,5)
Add a state machine behaviour module and set the state attribute to 1
Create some other agent groups and move them
Open the cache exporter form the Atoms menu: Atoms > Export > Cache Exporter
Select the agent groups you have created from the list, then choose a path where your cache will be saved.
Finally select your start and end frame.
Click on the "Export" button.
Importing a cache
You can import a cache in a scene using the cacheReader behaviour module
Create and agent group.
Add a cacheReader behaviour module.
in the cachePath attribute of the cache reader module pick the cache file (the file named youCacheName.atoms)
Rewind the scene and atoms will load the cache. It also automatically load all the agent types that are missing from your scene.
You can create multiple agent group to load different caches or the same cache multiple times. You can also move then around and rotate them.
Editing a cache
When a cache is loaded in your scene you can still edit it to change your layout or simulation.
Apply a new height field
Even if you exported the cache from some agent groups on a height field you can apply a new height field to your cache
Create a new height field
Create an agent group and import your cache using the cacheReader behaviour module
In the height field attribute of the cache reader module set the new height field name you created
Rewind the scene or press UpdateSim from the shelf and press play
Move agents
Create an agent group and import your cache using the cacheReader behaviour module
To move agents you can use the transitionOffset attribute or you can use the Agents Layout Tool
Select the agent group and activate the agents layout tool from the Atoms menu: Atoms → Tools → Agents Layout Tool or just press enter
Press Q to switch to the selection mode or press from the agent layout tool ui (press P to show the ui)
Select the agents you want move
Press A to switch to the move mode or press from the ui
Use the manipulator to move the agents where you want
Rewind the scene or press UpdateSim from the shelf and press play
Rotate agents
Create an agent group and import your cache using the cacheReader behaviour module
To rotate agents you can use the rotationOffset attribute or you can use the Agents Layout Tool
Select the agent group and activate the agents layout tool from the Atoms menu: Atoms → Tools → Agents Layout Tool
Press Q to switch to the selection mode or press from the agent layout tool ui (press P to show the ui)
Select the agents you want rotate
Press Z to switch to the rotate mode or press from the ui
Press the LMB and move the mouse on the left or on the right to rotate the agents or press SHIFT+LMB to rotate around the group pivot
Rewind the scene or press UpdateSim from the shelf and press play