WheelTorque is NaN during Vehicle Instantiation

I can see that a lot of work has gone into the WheeledVehicleMovementComponent since the 4.1 release, so perhaps this is already fixed, but I figured it was better to err on the side of caution.

Branch Binary

Build Version 4.1.0-2053869

Description

I have a WheeledVehicle blueprint. I also have a VehicleWheel blueprint using the engine’s DefaultTireType. I’ve been messing with the WheelSetups and VehicleWheel settings a bit; I’m happy to post those if that’s useful.

Something that’s worth mentioning is the way I’ve setup my Vehicle blueprint’s mesh in order to make it behave in a destructible manner when overlapped with an enemy projectile. The root mesh is hidden by default; instead, there is a visible child mesh component. Physics are simulated on the root mesh until the actor is overlapped, at which point the root mesh’s physics simulation is disabled, and the visible, child mesh’s physics asset is swapped out for a very fragile variant (so that it immediately breaks into pieces), and physics are simulated. This child mesh component approach is only necessary at this point because 4.1’s WheeledVehicleMovementComponent doesn’t support multi-body setups. I see that’s already changed in master, so when that’s released I’ll be able to just hot-swap the physics asset on the root mesh, assuming that’s not a generally bad idea.

In any case, after adding replication to the destructible vehicle pawn I started receiving this crash. It’s difficult for me to pinpoint which changes actually caused the crash to start occurring since it occurs inconsistently. It occurs when a networked game begins, when a pawn respawns, and in a single player game (although that was just a single client / no dedicated server setup, so I think that was probably a listen server game with no clients).

For a while I thought it had to do with the height of the PlayerStart instances, but by now I’ve moved those up and down enough that it seems to be unrelated. I think I’m just noticing it more now that the pawns can destroy eachother and respawn, so there’s more opportunity for vehicle instantiation.

System

OS X 10.9.2

Steps to Reproduce

  1. Import and setup my weird blueprint vehicle (if you want all of the necessary assets please let me know)
  2. Press play / respawn a couple of times

Logs

I can’t seem to find any relevant crash files. I’m running the editor from XCode, and what I typically see is a crash back to XCode with the following trace:

[2014.05.09-05.52.49:368][484]LogGameMode: RestartPlayer 259
[2014.05.09-05.52.49:369][484]LogNet: Join succeeded: 259
[2014.05.09-05.52.49:373][484]LogPlayerController:Warning: NULL GameState when trying to spawn spectator!
[2014.05.09-05.52.49:373][484]LogPlayerController:Warning: NULL GameState when trying to spawn spectator!
[2014.05.09-05.52.49:373][484]LogNet: BP_PlayerController_C_2 setplayer LocalPlayer_0
[2014.05.09-05.52.49:373][484]LogNet:Warning: ADDED unmapped property: Offset: 808, Guid: 4, Name: PlayerState
[2014.05.09-05.52.49:373][484]LogPlayerController: ClientRestart_Implementation None
[2014.05.09-05.52.49:377][484]LogPlayerController:Warning: NULL GameState when trying to spawn spectator!
[2014.05.09-05.52.49:377][484]LogPlayerController:Warning: NULL GameState when trying to spawn spectator!
[2014.05.09-05.52.49:399][484]LogNet: BP_PlayerController_C_3 setplayer LocalPlayer_1
[2014.05.09-05.52.49:399][484]LogNet:Warning: ADDED unmapped property: Offset: 808, Guid: 12, Name: PlayerState
[2014.05.09-05.52.49:399][484]LogPlayerController: ClientRestart_Implementation None
[2014.05.09-05.52.49:418][485]LogNet:Warning: ADDED unmapped property: Offset: 824, Guid: 4, Name: PlayerState
[2014.05.09-05.52.49:418][485]LogNet:Warning: ADDED unmapped property: Offset: 152, Guid: 10, Name: Owner
[2014.05.09-05.52.49:423][485]LogNet:Warning: ADDED unmapped property: Offset: 824, Guid: 4, Name: PlayerState
[2014.05.09-05.52.49:424][485]LogNet:Warning: ADDED unmapped property: Offset: 152, Guid: 2, Name: Owner
[2014.05.09-05.52.49:942][497]LogPlayerController: ClientRetryClientRestart_Implementation BP_Trapezoid_Mobile_C_2, AcknowledgedPawn: None
[2014.05.09-05.52.49:942][497]LogPlayerController: ClientRestart_Implementation BP_Trapezoid_Mobile_C_2
[2014.05.09-05.52.49:947][497]LogPlayerController: ClientRetryClientRestart_Implementation BP_Trapezoid_Mobile_C_5, AcknowledgedPawn: None
[2014.05.09-05.52.49:947][497]LogPlayerController: ClientRestart_Implementation BP_Trapezoid_Mobile_C_5
[2014.05.09-05.52.49:975][498]LogPlayerController: ServerAcknowledgePossession_Implementation BP_Trapezoid_Mobile_C_0
[2014.05.09-05.52.49:975][498]LogPlayerController: ServerAcknowledgePossession_Implementation BP_Trapezoid_Mobile_C_1
[2014.05.09-05.54.01:860][252]LogPlayerController: ClientRestart_Implementation None
[2014.05.09-05.54.01:914][253]LogPlayerController: ClientRetryClientRestart_Implementation BP_Trapezoid_Mobile_C_7, AcknowledgedPawn: None
[2014.05.09-05.54.01:914][253]LogPlayerController: ClientRestart_Implementation BP_Trapezoid_Mobile_C_7
[2014.05.09-05.54.01:944][254]LogPlayerController: ServerAcknowledgePossession_Implementation BP_Trapezoid_Mobile_C_6
**/Users/build/BuildFarm/build_++depot+UE4-Releases+4.1/Engine/Source/Runtime/Engine/Private/Vehicles/WheeledVehicleMovementComponent.cpp(448): Ensure condition failed: Output.WheelTorque == Output.WheelTorque
Output.WheelTorque is bad: nan**

Please let me know if you need more information. Thanks!

Hi,

There is one Nan fix that has gone into the vehicle code, this was in a case when the tire’s long and lat slip are almost 0.
https://github.com/EpicGames/UnrealEngine/commit/c16735aeb150350861ad209c8d53d4ba0604d1de

Not sure if this is the same issue but it’s worth a shot.

Thanks! I updated my values but it seems those weren’t the culprits. Stepping past the initial breakpoint, I see that the lat and long stiff values are also nan. I suspect the error is actually replication related – I think that’s when I started noticing this. I’m going to step through my replication code.

I haven’t been able to isolate the cause yet. I first tried disabling specific replication events, and then all replication with no luck. I re-enabled replication and swapped in the flying pawn and that behaves. It seems likely that something is up with my vehicle setup. I have been modifying what I suspect are relevant properties one at a time. Do you have any suggestions for getting more insight?

When you turn off all replication you still get the NaN? If you post a link to your assets I can take a quick look. Is this using 4.1 or master?

Yeah, although it’s definitely possibly that I’m incorrectly disabling replication. Thanks for offering to take a look. I’ve included what I believe should be everything you need:

  1. The trapezoid mobile blueprint
  2. Its wheel and projectile blueprints
  3. The MultiplayerGameMode h/cpp
  4. The BP_VehicleGameMode which should subclass something like the AMultiplayerGameMode (this blueprint will need to be parented after import)
  5. The multiplayer player controller blueprint

Download link: Google Drive: Sign-in

Thanks! Let me know if it looks like anything is missing. Also, I realize my vehicle handles like its wheels are made of marshmallows, let’s assume that’s intentional for now.

Edit: I’m using 4.1 at the moment.

I’m actually thinking that if you haven’t looked at this yet it’s probably not worth doing so. I can build out other aspects of the game using a hovercraft, and I think 4.2 is probably going to address any wheeled vehicle-related issues I might be experiencing at the moment. Thanks for the help!

hey piinecone, sorry about that I haven’t had a chance yet. I’ve downloaded it, but kept getting pulled aside by other tasks. I would say waiting for 4.2 is probably your best bet though as it should be released soon.

Please let me know if you still have issues once the update is out.