Okay so I made a bit of an embarrassing mistake (I had a missing !
) and I actually tested the opposite of what I wanted with Jolt. So the numbers for convex are actually for the sphere case and vice versa.
So turns out that sphere collision shapes are actually more efficient by about maybe 25-40% in terms of speed (when not literally all bodies are in a huge clump colliding).
Which is pretty nice as it will be a bit simpler to convert the current code to use Jolt when I don’t need to overhaul the order of operations (for convex generation the membrane shape is needed to be computed one frame earlier for collisions to be created on microbe spawn).
Also the physics speed seems to pretty much scale less than linearly with the number of spheres each collision consists of (performance is still fine with 60 random mutation steps as compared to 25). Even with 100 mutation steps the simulation still gets around 400 physics frames per second. Though, at this point it is starting to be the case that convex collisions are more efficient. So maybe microbe colonies is the point where the performance for sphere collisions explodes and convex shapes are needed?
I’ll give that some thought as I’ll now start trying to get the microbe benchmark (which requires most of the normal microbe stage logic to be working) working with the new physics.
Update: with Godot physics using spheres the 100 step massive test results in physics FPS limit of around 80-95, so a fourth of the performance. Using Godot convex bodies results in: 80-105 FPS (with it staying abit on average closer to the higher end). I think this close performance shows that it was not a mistake to originally design Thrive to create microbe collisions out of spheres rather than using a convex body.
So as things get bigger the gap between Jolt and Godot performance stays, and even gets bigger. I think this might give some clues as to why the multicellular performance is especially complained about as it might get almost linearly worse when you have 10 big cells glued together into one physics body.