So, DOTS v1.0 came out earlier this year. There are two major things that changed:
DOTS worlds must be contained in a sub scene.
Conversion is taking place at build time, through bakers.
Dynamically creating a sub scene when importing a table seems impossible. Dynamically adding entities to the sub scene without the hybrid renderer (now "Entities Graphics") also seemed impossible. Baking wouldn't be available when loading a table during runtime.
There are probably workarounds for all of this, but DOTS didn't seem a right fit since quite a while, for the following reasons:
All the systems are run from the main thread, and there are a lot of them. Even if they are bursted, there is an overhead launching jobs.
We can't really benefit from DOTS' main advantage: Handling insanely many entities efficiently. We usually only have one ball, maybe up to 10 for some games, but nothing was handled in parallel anyway, since we'd have to further split systems, adding more overhead.
While the systems are a nice way of organizing code, it comes with additional complexity when orchestrating the exact order of every system.
Enter the post-DOTS era. The physics loop is now one single bursted job. Data is still packed into structs and available through a PhysicsState that is passed to the systems that need access to it. Everything is passed by reference, so data is not copied between functions. This turned out to be very fast:
This was also the opportunity to replace VPX's octree with a faster and easier to use implementation by bartofzo. Tree creation is also insanely fast, allowing us now to introduce dynamic colliders. This will first be dynamic toggles, with the goal of making them fully dynamic, including velocities.
So, DOTS v1.0 came out earlier this year. There are two major things that changed:
Dynamically creating a sub scene when importing a table seems impossible. Dynamically adding entities to the sub scene without the hybrid renderer (now "Entities Graphics") also seemed impossible. Baking wouldn't be available when loading a table during runtime.
There are probably workarounds for all of this, but DOTS didn't seem a right fit since quite a while, for the following reasons:
Enter the post-DOTS era. The physics loop is now one single bursted job. Data is still packed into structs and available through a
PhysicsState
that is passed to the systems that need access to it. Everything is passed by reference, so data is not copied between functions. This turned out to be very fast:https://github.com/freezy/VisualPinball.Engine/assets/70426/185e32bb-7b86-4060-a5a7-d972fa9410bf
60k colliders at 1ms per frame.
This was also the opportunity to replace VPX's octree with a faster and easier to use implementation by bartofzo. Tree creation is also insanely fast, allowing us now to introduce dynamic colliders. This will first be dynamic toggles, with the goal of making them fully dynamic, including velocities.
TODO before merge