How do I optimise the Vehicle Advanced Template for Multiplayer?
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!
asked Jan 06 '19 at 05:35 AM in C++ Programming
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: https://www.unrealengine.com/marketplace/blue-man-vehicle-physics
answered Jan 06 '19 at 05:24 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here