#Physics & Collision Networking Test for Walking Inside of Simulated Spaceships While in Planet Orbit

1 messages · Page 1 of 1 (latest)

upper coral
#

Both views are clients, with Average Latency Emulation (30-60ping + 1% packet loss) for each client.
The ships are also in the orbit of the planet with simulated orbital mechanics.
(I'm constantly pushing the ships into each other to force a collision)

terse mortar
#

Well done, actually got recc'd this by YouTube before finding it here

upper coral
#

Thank you

#

Im surprised Youtube recommended it

ashen vessel
#

I’ve been trying to do networked physics for so long, for a project similar to this one. I had indeed watched the Rocket League talk but didn’t think it would be easy to integrate Bullet into a UE5 project. I’ve explored every possible route to get chaos prediction working, including modifying the engine. Is your code open source, or do you have any guidance on how to replicate (heh) this? Thanks a bunch

upper coral
#

So decided to give it a shot and Bullet was extremely easy to set up

#

It's pretty much just a plugin, you create a bp actor inheriting from its own C++ class and you're good to go

#

It's also easy to modify its source code, I made some of its functions callable from blueprints and it works like a charm

#

I can give you my modified version of the Bullet plugin if you want, all I did is to make stuff blueprint callable

ashen vessel
#

Thats great to hear.

ashen vessel
#

Definitely will have to dig more into how plugins work

upper coral
#

There are still many unexposed functions, I only exposed the ones I needed like add force, torque etc

ashen vessel
#

If you want, i can contribute to this and you can put it on GitHub or something. I’m sure there are many other poor souls struggling with the same problem

upper coral
#

Also watch this, to see how to set it up after the plugin is installed

upper coral
#

For now it works good enough for my project

#

If I ever make it more optimized and convert it to C++ I may put it on github

upper coral
#

It's so satisfying to see stable physics even at high speed collisions

ashen vessel
#

That’s amazing

#

I have the basic structure down but debugging has me thinking I have a long way to go

#

Can I ask how you managed IDs? Since many actors might be spawned at the same time across server and client their IDs might get confused

upper coral
# ashen vessel Can I ask how you managed IDs? Since many actors might be spawned at the same ti...

I made an actor component that manages the connection between the actor and the bullet engine, and it has an additional custom ID that I replicate.
So I basically have 2 IDs, one that represents the Actor itself and is replicated, and one that represents the Physics state (Rigid body ID) and is local only.
I use the custom ID for network stuff, and when it comes to applying physics changes I simply use the Bullet ID on the client

ashen vessel
#

I’m keeping a TMap of serverID->clientID on each client’s physics world, seems to work so far.

terse mortar
#

Interesting, what is the value of bullet physics integration over Chaos? Is it that you have more fine tuned control over the physics simulation for network prediction purposes?

ashen vessel
terse mortar
ashen vessel
ashen vessel
#

Hell yeah, ID sync and server authoritative physics works amazingly. TODO: implement frame synchronization, then resimulation/prediction logic, then input buffering (I should probably make a new thread instead of hijacking this one, sorry) Thanks again for the inspiration @upper coral