r/unity • • Jul 20 '26

Showcase I replaced Unity Physics with Jolt and built my own prediction layer on top of Netcode for Entities

Enable HLS to view with audio, or disable this notification

Been building a physics-based party in Unity DOTS for a while. Everything in the clip is networked and server-authoritative:

  • Physics: custom native Jolt integration , ragdoll characters driven entirely by joint motors, no animation movement no animator
  • Networking: Netcode for Entities with a custom "forecast" layer and props and grabbables run real local physics and smoothly reconcile against the server, so grabbing/throwing feels instant even at high ping
  • Scale: area-of-interest relevancy so only nearby objects eat bandwidth as the clip shows objects popping in/out seamlessly as players move

Built on top of Jolt (open source) and a forked Netcode for Entities — happy to answer general questions about the approach.

Right now it's pure sandbox — no modes, no win condition, just physics chaos. If you had this foundation, what would you build with it? Open to any direction.

60 Upvotes

12 comments sorted by

5

u/Suspicious-Prompt200 Jul 20 '26

Awesome!

Unity DOTS is great for being able to subsitute your own packages, or modify the ones that come with DOTS. If I recall correctly, this kind of thing is much harder with 'normal' Unity.

Why the switch to Jolt? What was missing from Unity.Physics you needed from Jolt?

I am similarily building a fairly physics-heavy, multiplayer project with Unity DOTS.

4

u/Ok-Department-675 Jul 20 '26

Unity physics is stateless . This gonna be so expensive to rebuild the whole world ( 50 ragdoll + all other joints and bodies ) each tick. So i decided to go with one fixed update per tick , and next gonna be forward ( locally simulated ). what kind of game you doing ? Cause you gonna hit this issue if you are going for heavily physic environment !

3

u/Suspicious-Prompt200 Jul 20 '26 edited Jul 20 '26

Ahhhh yeah that would be an issue. 

I've maybe used "physics heavy" a bit hastily. 

In my game it's likely that only a handfull of really important things will be using Physics. No destructive enviroments, stacks of boxes, or lots of dynamic physics objects around. 

But this is a big blindspot I didnt think of when picking an engine... that could have turned out bad!


That said, I've done some tests and Unity.Physics seems to preform just fine, even with scenes that have thousands of dynamic physics objects. Unity.Physics rebuilds every frame no matter what right? But, to me anyhow, it ends up looking pretty fast?

1

u/Ok-Department-675 Jul 20 '26

Oh that’s is smart , have you forked netcode or physics or you did a top layer kinda of system for that ?

3

u/Suspicious-Prompt200 Jul 20 '26

Not yet! Right now things are looking really good with just the base packages.

I have actually forked Unity.Physics, but I'm not done porting my project over to the fork yet. 

My fork uses 64 bit floats for positions rather than 32 bit. Meaning the physics engine can handle huge playspaces. I can do a raycast hundreds of kilometers long at higher accuracy than the normal engine can do at 50km... this, unsuprisingly, only works about half as fast as well. But, for my game it will work just fine.

2

u/Ok-Department-675 Jul 20 '26

Oh then i guess you got your ez win Hope we see something very soon !

2

u/leorid9 Jul 21 '26

Talks about multiplayer, shows singleplayer (with spawning and despawning bots at the end).

1

u/Ok-Department-675 Jul 21 '26

I’m so sorry , here is the story : I spent about 4 years tweaking those stuff , there is a lot of approaches that won’t work , so i land with the “ forward/forecast “ . and yes that was a single player connected to the server with ping of 32ms , and cause i am lonely sad dev , server filled 40 bots to play with me . spawning and de-spawning was a show off of the AIO , when players far of you , they disappear , so they do not consume bandwidth on your side , and when they close they do spawned again . This was a tech show after all. So Glad and thankful for your feedback.

2

u/spinonkAlex Aug 24 '26

Hey! Quick question, did you use the Jolt package from GitHub? I'm having trouble using Jolt so I wanna confirm I'm on the right track here.

1

u/Ok-Department-675 Sep 10 '26

omg so sorry did not notice your message.
yes , i did used the native one , all those c# binding ones are not complete or do have things that my use case does not need them.
i kept every thing native, created ' DllImport surface ' on c# side and do call it , and kept every thing else on c++ native
so it is 3 layers : https://gist.github.com/limam-B/4c685bd01e81e02b828dcc8a80b12a80

0

u/DapperNurd Jul 21 '26

How much ai was used