MantisBT - Zandronum
View Issue Details
0001882Zandronum[All Projects] Bugpublic2014-07-09 05:042024-03-20 05:00
haxmurderer 
 
normalminoralways
closedno change required 
MicrosoftWindowsXP/Vista/7
1.2 
 
0001882: A_SetUnsolid desync in multiplayer
If you call A_SetUnsolid on an actor in multiplayer, it causes a player passing through the unsolid actor to have jittery motion. I believe this is because the client and the server disagree about the solidness of the actor. In singeplayer, walking through the unsolid actor is completely smooth and behaves as it should.

I've created a small WAD that demonstrates the issue and it's reproducible 100% of the time.

Thanks!
Hax
1. Create a local server (I launch it from Doomseeker) with the WAD I've attached (unsetsolid_desync.pk3).
2. Launch Zandronum, connect to the server.
3) Shoot the torch a few times and it'll disappear, going into a DECORATE state where A_UnsetSolid and A_UnsetShootable are set.
4) Try to walk through where the torch is (over the red tile). You will notice your player movement becomes jittery.
Here's a paste of the DECORATE from the WAD:
(It's adapted and boiled down from my Survivalism WAD that I'm working on)


Actor ChoppableTree 12345
{
  +SHOOTABLE
  +NOBLOOD
  +SOLID
  
  Mass 0x7FFFFFFF
  Health 20000
  PainChance 256 //100% chance of going into Pain state
  Height 48

  States
  {
      Spawn:
         TNT1 A 0
        SMRT A 0 A_SetSolid
        SMRT A 0 A_SetShootable
        //TNT1 A 0 A_UnhideThing
        SMRT A -1
        Stop
      HealAndSpawn: //Part of regrowing. This state makes inheritance easier.
        TNT1 A 0
        TNT1 A 0 ACS_ExecuteAlways(937) //Heal us. HealThing doesn't have a max in Zandronum 1.2 :(
        TNT1 A 35 A_Jump(256, "Spawn")
      Grow:
        TNT1 A 0 //Dummy frame so A_Jump works
        //TNT1 A 5 A_NoBlocking
        //TNT1 A 0 A_HideThing
        TNT1 A 1 A_UnsetSolid
        TNT1 A 0 A_UnsetShootable
        TNT1 A 0 A_Jump(256, "GrowCheck") //Dynamic dispatch
      GrowCheck:
        TNT1 A 0 //Dummy frame so A_Jump works
        //There's a 1/256 chance that this tree will respawn
        //every second (35 ticks).
        TNT1 A 35 A_Jump(1, "HealAndSpawn")
        TNT1 A 35 A_Jump(256, "GrowCheck")
      Pain:
        TNT1 A 0 //Dummy frame so A_Jump works
        TNT1 A 0 A_JumpIf(health < 20000-200, "Grow") //A_JumpIfHealthLower(20000-200, "Grow") <-- does not work
        TNT1 A 0 A_Jump(256, "Spawn") //A_Jump is evaluated at run-time so this makes inheritance work
        goto Spawn //Weird hack to make the trees not go invisible in multiplayer, Zandro bug?
      Death:
        TNT1 A 0
        Stop
  }
}


Also note that there's a second (BONUS!) bug, which could be related but might not be. If you remove that last "goto Spawn", then try shooting the torch once with the pistol, you'll notice it goes invisible right away, which is NOT what's supposed to happen according to the DECORATE. (It should only go invisible if you damage it for 200 health, which one pistol shot doesn't do.) However, it hasn't actually fully jumped states, as you'll notice that you can still bump into it. So somehow, it's become invisible without becoming unsolid, which is totally not what the DECORATE says should happen. Could this be desync between the client and the server again? (This only happens in multiplayer, not singleplayer!)
No tags attached.
Issue History
2014-07-09 05:04haxmurdererNew Issue
2014-07-09 08:01ZzZomboNote Added: 0009916
2014-07-09 13:38haxmurdererNote Added: 0009918
2014-07-09 23:28ZzZomboNote Added: 0009927
2014-07-10 03:18ZzZomboNote Edited: 0009927bug_revision_view_page.php?bugnote_id=9927#r5315
2024-03-20 05:00Ru5tK1ngNote Added: 0023436
2024-03-20 05:00Ru5tK1ngStatusnew => closed
2024-03-20 05:00Ru5tK1ngResolutionopen => no change required

Notes
(0009916)
ZzZombo   
2014-07-09 08:01   
-_-
If you remove the last "goto Spawn", it will go to the next instruction, and it is "TNT1 A 0" from the "Death" state, as it should ACCORDING to Decorate, if you read that carefully.
(0009918)
haxmurderer   
2014-07-09 13:38   
ZzZombo:

        TNT1 A 0 A_JumpIf(health < 20000-200, "Grow") //A_JumpIfHealthLower(20000-200, "Grow") <-- does not work
        TNT1 A 0 A_Jump(256, "Spawn") //A_Jump is evaluated at run-time so this makes inheritance work
        goto Spawn //Weird hack to make the trees not go invisible in multiplayer, Zandro bug?

The line A_Jump(256, "Spawn") should branch with a 100% chance (256/256) if the A_JumpIf doesn't branch. The goto should never, ever get executed.

Am I mistaken in how A_Jump(256, blah) works?

Thanks for taking a look at this!
(0009927)
ZzZombo   
2014-07-09 23:28   
(edited on: 2014-07-10 03:18)
You should know that online clients don't do jumps on their own, they await the server to tell them where to go, and until then they just continue, so such desyncs happen occasionally.

(0023436)
Ru5tK1ng   
2024-03-20 05:00   
Coding issue with DECORATE. Adding 'TNT1 A 5' right before 'goto spawn' fixed the issue online.