x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Physics simulation issues on Standalone Dedicated Server

Branch: Source (git SHA: 69b5693, ~4.4)

System: 2013 Razer Blade: dxdiag.txt

Description:

I cannot drive a vehicle in a networked game running on a standalone dedicated server.

Video of the bug in action: http://youtu.be/Wv9WxX3LjgU?t=7s

In experimenting with building standalone dedicated server executables I came across a problem replicating vehicle movement (with my project). I suspected this was due to the nature of my project so I created a vehicle template project and built a standalone dedicated server in an attempt to isolate the issue. The same problem occurs: you cannot move your vehicle. It moves a little bit (due to client-side prediction, I suspect) but is then snapped back to its original location.

I've been digging through engine code to see if I can understand where this location correction would occur but I haven't figured it out yet. It's also entirely possible that I'm building my dedicated server executable incorrectly, since everything works just fine in PIE mode with a dedicated server. However, I did test my process with the third person character template and movement on a dedicated server works correctly. It is for this reason that I started digging into the WheeledVehicleMovementComponent, but I can't tell where there would be a difference between the PIE dedicated server and the standalone; both report their NetMode as NM_DedicatedServer .

Steps to Reproduce:

  1. Create a blueprints vehicle template project

  2. Build a standalone dedicated server with these steps: http://blog.piinecone.com/post/96800987702/building-a-dedicated-server-in-unreal-engine-4

  3. Run the server binary (eg, [Game]Server.exe -log)

  4. Run the game binary (eg, [Game].exe) and connect to the server (`open 127.0.0.1:7777`) (I also tried connecting to the local network IP but the movement issues persist)

  5. Once connected, the vehicle should stutter and you shouldn't be able to move forward

Product Version: Not Selected
Tags:
more ▼

asked Sep 12 '14 at 02:02 AM in Bug Reports

avatar image

piinecone
537 22 32 369

avatar image piinecone Sep 12 '14 at 07:48 PM

After some more experimentation, I think this issue might be related to the wheels and not client-side prediction/rewind and replay. It seems like the wheels can't make up their mind. I'm going to try to identify what could be different about a standalone dedicated server versus the PIE dedicated server when it comes to determining the wheel position. I estimate this will take me 1-5 years to figure out.

avatar image piinecone Sep 15 '14 at 11:04 PM

I placed a cube in the scene with simulated physics. In the editor, running 2 clients on a dedicated server, the cube falls to the floor. In the standalone server, the cube doesn't fall. So I think perhaps something is up with simulated physics on the standalone dedicated server. This would also explain why my projectiles work (they're translating) and my vehicles don't.

I'm going to try to find out why physics simulations aren't running on the standalone server.

avatar image piinecone Sep 17 '14 at 11:49 PM

Engine deveveloper rcl recommended that I verify that the server isn't expecting a local controller, as this wouldn't be available to a standalone dedicated server. To check this in a simple setting, I created a C++ VehicleTemplate project and surrounded any calls to

 GetController()

with

 if (Role < ROLE_Authority)
 {
     ...
 }

and logged everything. It doesn't appear that the server is trying to access any controllers; with or without this Role check, movement is impossible and physics simulations do not run.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Thanks to a tip from user HateDread I was able to fix this!

The SkeletalMeshComponent.bEnablePhysicsOnDedicatedServer property was preventing physics simulations from running in a standalone dedicated server environment (where the IsRunningDedicatedServer() check returns true).

The solution was to set Mesh->bEnablePhysicsOnDedicatedServer = true. This property is currently not exposed to Blueprints, so Blueprint vehicles will need to subclass a C++ vehicle superclass with this line in the constructor.

I created a pull request (https://github.com/EpicGames/UnrealEngine/pull/454) to expose this property to Blueprints so content-only multiplayer vehicle games can run on a standalone dedicated server without having to subclass a C++ vehicle class.

I probably never would have figured this out if HateDread didn't mention it in IRC.

more ▼

answered Sep 19 '14 at 05:38 PM

avatar image

piinecone
537 22 32 369

avatar image hiili Sep 25 '14 at 04:59 PM

There is a nasty pitfall related to SkeletalMeshComponent::bEnablePhysicsOnDedicatedServer. Just in case that also someone else has stumbled on it and is reading this: enabling physics for the skeleton using the editor checkbox and then setting bEnablePhysicsOnDedicatedServer=true in code will lead to erratic behavior. You must call SetSimulatePhysics(true) after setting bEnablePhysicsOnDedicatedServer=true, even if you have the Simulate Physics box checked in the editor!

(see https://answers.unrealengine.com/questions/104567/ for the whole issue)

avatar image piinecone Sep 25 '14 at 06:04 PM

That's a great find!

avatar image Kieranator Jun 25 '18 at 07:05 PM

Thank you so much for this.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question