Making Physics Deterministic on a single machine?

I am writing my Bachelor’s thesis about Networked Game Physics Strategies. To make this (pretty abstract) topic more graspable, I am developing a Unity application to simulate different networking strategies, drawing a lot of inspiration from this tutorial (Deterministic Lockstep is one of the strategies I want to showcase using my simulation).

Now, in order to achieve side-by-side comparison in Unity, I need to make Unity’s Physics simulation deterministic. I know this is a long-discussed topic and because of floating point arithmetic imprecisions and the way Unity is build up, this is something that’s basically impossible to do across different machines. However, I was wondering if there is a way to achieve this on a single machine.
Since Unity is not allowing multiple scenes to be active at once, I had to create this setup in a single scene, using the same setup in two different locations in the game world, far enough from each other to guarantee no physical interactions between the two setups.

This is what I came up with (file is also attached). You can control the player cube using the arrow keys, Holding shift is pushing close cubes away while holding space drags them towards you.

As you can see, even though I’m using the exact same setup in different locations of the world, physics are still not deterministic.

Is there any way to fix this or is this a waste of time and energy?

3347591–261675–Networking Sync Demo.zip (30.7 KB)

You cannot make Unity physics (NVIDIA PhysX) deterministic, because it was designed to be performant and versatile rather than deterministic.

You can, however, write your own physics solution for Unity. Example

But with that said, you don’t actually need physics to be deterministic in order to use physics for networked games. Here is a great article about that. From the article:

Thank you for your answer! This is exactly what I will do for my thesis, I will compare snapshot interpolation to deterministic lockstep and other strategies.

I’ll look into bullet physics, but I feel like I might try for another engine to do this in, then.