How do I optimise the Vehicle Advanced Template for Multiplayer?

Hello,

I am working on a car-based combat game, and I realized through testing that when more than 4-6 players join (or AI) then everything starts to get very laggy. However, this is not necessarily a result of my networking blueprints, as this occurred extremely early on in development. (Note: I don’t have much experience in C++, but I’d be willing to convert the project to C++ if a solution is found)

How do I fix this? Any help at all would be fantastic!

The discussion around networked Physics/PhysX is a long one.

The root issue is that it is not easy to support Client Prediction and Replay for PhysX-driven vehicles. What this means is that you get a lot of stutter and a lot of input lag as soon as any network latency is introduced.

Most solutions to this problem that I’ve seen have ended up rolling a bespoke physics solution - in some cases not using PhysX at all (aka, Rocket League). Personally, I’ve just written my own solvers for vehicles and integrated similar netcode to Character Movement. There are pros and cons to each solution.

In C++, you can relatively easily switch PhysX vehicles to a client-authoritative model which will at least eliminate the input lag - but this won’t suffice for a competitive game as players can easily cheat.

There is a Marketplace Plugin that claims to support multiplayer vehicles. I can’t attest to whether it works or not or whether it suffers problems of it’s own, but you can find that here:

“In C++, you can relatively easily switch PhysX vehicles to a client-authoritative model which will at least eliminate the input lag - but this won’t suffice for a competitive game as players can easily cheat.”

Answering a bit late but I haven’t found a way to make this work, I haven’t reeally looked into physx c++ but I was wondering if you could point me into the right direction to do this? I just want my cars to be smooth on the driver with no input lag and smooth for others, no anti cheat needed.