#DOTS Design for multiple parallel simulations

1 messages · Page 1 of 1 (latest)

lost brook
#

Hello everyone! I am looking to use DOTS for a machine learning simulation and trying to figure out a good ECS-centric design for having multiple similar simulations running simultaneously. Multiple simulations is useful for speeding up learning (as shown in Unity MLAgents docs).

My first thought is to create one simulation World, then duplicate that same World with adjusted parameters in different positions (so N same Worlds in the same scene). But each World needs to take parameters in and output the simulation results. How would I communicate to/from the Worlds?
Also, how would I indicate the different World positions? I'm thinking loading a subscene but would still need to programmatically create and set the position for subscenes which I do not know if it is possible.

#

DOTS Design for multiple parallel simulations

faint bluff
lost brook
#

The simulations have to be functionally identical - the overall simulation logic/systems should be the same across all simulations. Entities are not shared between simulations. Basically, a "server" tells each simulation where to position the entities within at the start, lets them run, and waits for them to send back a result. The simulations should run asynchronously, server doesn't wait for all to respond. I would like 100+ simulations to run at once if possible.

Since the simulations all behave the same but should not interact with each other, I figured the best model would be to treat each simulation as a separate World. That way the systems don't query entities in other simulations and less entities are kept track of per-simulation. No need to run a system for all simulations if only 1 needs the update, etc.
Alternative methods are maybe to associate a tag with all entities to indicate which simulation they are in, but the number of tags would be a lot and we cannot query based on a tag value so still need to query all entities before filtering based on the tag. Or I can put each simulation's entities in separate chunks and limit all queries within system to specific chunk?