Vehicle jitters on standalone dedicated server

Build: Source (git SHA: 69b5693)

Problem: Vehicle pawns connected to a standalone dedicated server appear to have constant collision issues; PIE pawns on a dedicated server are fine.

Details:

When using the editor, I’m able to launch a PIE dedicated server and 2 clients and drive around just fine. Today I went through the process of packaging a standalone dedicated server. When I run it locally and connect (eg, via 127.0.0.1:7777), everything appears to work as expected except my vehicles stutter like they’re constantly colliding. My initial thought was that the terrain transform’s global Z component of its location was somehow different between the dedicated server and client, but other objects appear to be fine.

I created a video that shows the PIE experience first, then the dedicated server experience: - YouTube

I stripped everything out of the vehicle to see if it was any of the attached components; the jittering behavior still happens even without subobjects.

Any insight is appreciated. I have no idea what’s going on and no clues (or, at least, I haven’t spotted any clues).

I’m happy to upload an archive of my project if anyone wants to have a look.

I did some testing today in an attempt to isolate the issue.

  1. I unchecked “Always Relevant” from my vehicle’s replication settings, as this is also unchecked in the Vehicle Template’s Sedan’s replication settings. This appeared to have no effect, other than disabling replicated movement entirely for custom maps (example map still works fine). This is a result of another issue I was experiencing, detailed here: https://answers.unrealengine.com/questions/82592/map-specific-replication-issues.html
  2. I created a vehicle project from scratch (using the blueprint vehicle template) and built a dedicated server for this project. I was able to reproduce the issue exactly; running 2 vehicle pawns on a dedicated server in PIE mode works fine, running them on a standalone dedicated server by connecting to 127.0.0.1:7777 results in vehicles that mostly stay in the same location and stutter. It appears the server is not allowing the vehicle to move, so the vehicle’s transform is constantly being corrected after a bit of client-side prediction exerts some local movement.

Test #2 makes me think that there is an issue with the way I’m building my standalone dedicated server. I don’t think it’s project-specific since the vanilla vehicle template results in the same issue.

Here are the steps I take to build a dedicated server for an existing project: piinecone — Building a dedicated server in Unreal Engine 4

Any insight would be appreciated! I’m stuck!

Oddly enough, everything works fine if I start with a 3rd person character template and build the client and server binaries the exact same way. This makes me think there is either something inconsistent about the way I’m building the dedicated server executable, or that there is a disagreement between the WheeledVehicleMovementComponent and the way I’m building the standalone dedicated server.

The solution is to add

Mesh->bEnablePhysicsOnDedicatedServer = true

to the vehicle’s constructor. This property is not exposed to Blueprints, so content-only vehicle games will need to subclass a C++ vehicle super class which sets this property in order to replicate movement correctly on a standalone dedicated server.

The details are covered in my related, more general question for this issue: https://answers.unrealengine.com/questions/97074/vehicle-template-issues-with-standalone-dedicated.html#answer-101321

Thanks to HateDread for suggesting this in IRC!

thanks for solving this problem :slight_smile:
my heard stoped after I saw the stuttering on my first deployed build