Anybody got a fix for issues with interpolated EntityState properties of type Quaternion?

Options
Hi,

Im currently working on a project where I need to synchronize a Quaternion through an EntityState.
It works fine, until I put on Interpolation, then I start seeing some Bolt runtime errors popping up.

First, a few of these errors crop up - I presume this is because I'm running 0.4.3.1 (DEBUG), and that these are some Assert statements. The error message goes as follows:
!CompareApproximately (aScalar, 0.0F)
UnityEngine.Quaternion:Lerp(Quaternion, Quaternion, Single)
Bolt.Math:InterpolateQuaternion(BoltDoubleList`1, Int32, Int32)
Bolt.NetworkProperty_Quaternion:OnSimulateBefore(NetworkObj)
Bolt.NetworkState:Bolt.IEntitySerializer.OnSimulateBefore()
Bolt.Entity:Simulate()
BoltConnection:StepRemoteEntities()
BoltCore:StepNonControlledRemoteEntities()
BoltCore:Poll()
BoltPoll:FixedUpdate()
After a few of these, the real runtime error shows up - it somehow mangled the Quaternion value, so that when I try to assign it to a transform in Unity, Unity simply rejects it saying it's not a valid Quaternion. I've found a way to hide the error (by checking if the Quaternion is valid) but that does not fix the issue, that errors are being thrown, and in some frames, the Quaternion value is corrupted/invalid.

Here is the exact error message I'm getting:
transform.rotation assign attempt for 'Aim' is not valid. Input rotation is { NaN, NaN, NaN, NaN }.
UnityEngine.Transform:set_rotation(Quaternion)
PlayerCharacterBehavior:Update() (at Assets/Scripts/Player/PlayerCharacterBehavior.cs:33)
The particular code of mine that the error is referencing does the following:
someOtherTransform.rotation = state.Rotation;
I often quickly exceed 1000 runtime errors after just 30 seconds of playing - which is unacceptable since it tanks the framerate completely.

The game is currently running on my Windows 7 (64 bit) desktop, and hosting & connecting to local game instances through localhost.

So, I'd like to know if anybody has a fix for this, since not interpolating the Quaternion is out of the question (used to drive very visible graphics).

And if there is no fix, consider this a bug report :)

Best regards,
Kasper

Answers

  • Majicpanda
    Options
    Are you compressing the data at all? I would try without if so.
  • KGC
    Options

    Are you compressing the data at all? I would try without if so.

    I am currently not using any compression on any EntityState properties. I plan to add them only when we start finishing up the project for last minute optimizations.
  • ddd
    Options
    Sounds like the state.Rotation is null
  • KGC
    Options
    ddd said:

    Sounds like the state.Rotation is null

    In the error message Unity explains that the Quaternion that I'm trying to use has the values
    { NaN, NaN, NaN, NaN }
    . The Quaternion that I'm setting on the state on the owner of the entity is not null however, as it comes from an active GameObject's transform, which is always present - even if this was not the case for the first frame, the error repeats itself seemingly forever. Also, it works if i turn off the interpolation, so the input rotation was never null.
  • @KGC Have you found a solution? It seems I have the same problem.