So, I decided to give it a go on our platform - Hadean (full disclosure, I’ve only been an employee here for 5 weeks). In 5 weeks, I built this demo [1, 2] which I think is already shaping up to be more impressive. I have my own ideas [2], but I want to know what suggestions you have/improvements you’d like to see. If you have any questions about the demo or the platform I’ll be around for a while, comment or message me.
I decided to take a different approach to their grid, while the 2D hexagons they use may be better in a few cases, their approach seems overly generic for many use cases [3].
My approach uses an octree with cells stored by Morton (Z-Order) index. A leaf cell in the tree corresponds to a single worker/core. New cells will be dynamically spawned when the entitIes move out of the live area, and despawned when they’re empty. Cells will also be subdivided when the load in a single cell increases beyond a threshold, this will maintain an almost constant amount of computation per worker. All of this is made fairly trivial on Hadean, which handles spawning and communication between workers across machines and clouds.
[1] Youtube video https://www.youtube.com/watch?v=w2fKRy5zC54
[2] github repo https://github.com/hadeaninc/spatial-tree-simulation-public
[3] SpatialOS load balancing https://docs.improbable.io/reference/12.0/workers/configuration/loadbalancer-config
[4] SpatialOS video demo https://www.youtube.com/watch?v=k7RCFoY2d-k&t=3m43s