De-synchronization with Collisions

So now, that I move my characters with AddForce, so It can take in account collisions, they actually de-synchronize themselves between two instances of the game, because of it.

I don't understand why?
Because, I'm using TrueSync components ; I'm moving my characters with the TrueSunc methods, they collider well, untill the collision occurs differently between two instances. It doesn't seem deterministic then.


  • Ok I seem to have fixed the problem! But I don't really know how... I've added a TSRigidbody on the floor, I don't know if it's it.
  • Hi @KIKS007, it is strange, how it was your setup before? I will try to reproduce this issue.
  • Hi! Sorry, but I couldn't tell you exactly what was my setup because in the meantime i've tried many different things and I can't tell what changed since.
  • I think that the problem comes from the rollbacks!
    My last setup was a Sync Window of 4 and a Rollback one of 4 too, and the rollbacks in one instance were de-synchronizing the collisions.
    But here with a Sync WIndow of 6 and a Rollback Windows of 2 it seems fine.

    By the way, I'd really enjoy much more documentation and examples on those settings, as they are really important, and aren't really explained in detail.
  • Hi @KIKS007, you are right, we have still a lack on documentation, as we are fixing and adjusting code we focus on improve the API, but we are going to include more examples and documentation.
  • I'd like to add that I noticed some de-synchronization as well and I was suspicious that it was related to the physics collisions I was using (but I haven't been able to determine the cause).

    As KIKS007 eluded to, when I turned off rollbacks, I noticed that the previous de-synchronization symptoms I observed were no longer occurring.
  • I was able to track down my de-sync problem with some more clarity. Perhaps it might be related to your issue @KIKS007 .

    In my test game, I have melee units (M) and ranged units (R) that attack against each other in a line. They simply walk forward and detect an enemy using OnSyncedTriggerEnter (OSTE) and attack until the enemy dies. The unit will choose a target based on the last OSTE() call. When two units face each other, I don't experience any desyncing, but when many units face each other, some units may be in position to collide with two different enemies at the same time. At this time, I have observed the target pattern to be different between two peers. Consider the following situation of a battle between player and player'

    Base R M M' R' Base'

    Sometimes, on one client, the targeting is as follows:
    R -> R'
    R' -> R
    M -> R'
    M' -> R

    but on the other client, it is as follows:
    R -> R'
    R' -> R
    M -> R'
    M' -> M

    and therefore the result of the battle is non-deterministic. If rollbacks aren't related, this scenario should be random and should occur when rollbacks aren't active. However, with no rollbacks, the simulation seems deterministic, so I'm wondering if the rollbacks are what's making the OSTE () calls random (perhaps related to my other post). Let me know what you think about my observations @JeffersonHenrique , thank you!
  • Hi @Mukikaizoku, it is a good catch and understanding of TrueSync's flow, as you said I think this issue is related to rollbacks because you are based on a call to OSTE, but if you have rollbacks the peer client can be related to OSTE that didn't happen to other client, so you will have a de-synced environment.