AddForce on Character has different results on different machines / PIE launches

a bit of background as to what is going on:

As part of our game the movement of the PlayerCharacter is done in “bursts” in a given direction…as such we set up the following parameters for designers: Mass, PushAmount, PushTime. Using this, we “push” the PlayerCharater for PushTime seconds, for a force of Mass * PushAmount.

In order to do this, I just take the direction vector (normalized) and multiply if by Mass * PushAmount. I then set this in AddForce for the character in its EventTick. This goes on for the set PushTime (I use a boolean which is enabled / disabled by a timer set for PushTime which EventTick checks to see if it should AddForce that tick).

as debug info, I also output the distance traveled and max velocity over the distance traveled, and I have found what I think is a bug:

Depending on how I launch the game, the distance traveled and the max speed differ. For Example, when I launch the game in PIE, standalone, new Editor Window, I travel less and am slower than if I launched the game as Mobile Preview. Also, I have tested this on different machines; Depending on the machine, the distance traveled and speed varies greatly. This isn’t a matter of 1 or 2 units, but almost 50~100 units at a time.

We are running UE 4.6.1 and this is currently all being done in Blueprints.

I have a hard time believing the PhysX engine is this sloppy…physics engines shouldn’t be this varying…in fact it should be the opposite. Either I have not done something correctly or there is a bug, but I’ve checked all possible parameters I can think of and I can’t see any flags that suggest “ensure PlayerCharacter’s physics calculation is consistent.” Or is there something I have to set in C++ that isn’t exposed in Blueprints?

Any assistance would be greatly appreciated!

For my final project at Uni (in UE3) we had a character controlled by adding force. We discovered through tons of research the PIE physics simulation was an “approximation” of what it would be like in the actual game. It sounds as though this might be what you’re experiencing. Unfortunately we were never able to correct this in a way that would resemble the final product so we had to tweak it in a way that would be satisfactory in the final game and just deal with it in the editor. Perhaps someone with more recent experience than me could chime in and maybe speak about the differences between machines. Curious: are the machines specked the same way? (Same amount of ram, cpu, etc).

This is the conclusion I’m coming to, but I really need confirmation from someone at Epic that this is the case. If so, we will use deployment packages of the game for them to do balancing.

The machines themselves are different specs, but similar. Also, as mentioned, I have differences in performance even on different launch types on the SAME machine

Anyone from Epic able to answer?

Me as well. My studio will be working with physics very soon and I’m curious to see if there is a way to get the editor to more closely resemble the final game. Good question.

Cheers.

As an update: I tried packaging a Win64 build and running it from different computers. Unfortunately, this problem is NOT just a PIE issue – even with Development packages, the physics engine seems to give different results per machine.

Epic, please inform us as to what the issue here is.

1 Like