Page 1 of 1

Monster Client Desync

Posted: Tue Jun 30, 2015 6:44 pm
by fr blood
Hi guys I open this thread to talk about bugs that happens only on a server, and not in single player. For the ones who know I'm working on After Doom, and the gameplay itself if fine in single player without any problem that I can't fix, even when I open my own server, if I connect on it I don't meet new bug(maybe because I'm the host).

The problem comes when I open a server with BE to test it online with some friends, and here it's a disaster a tons of bug happens and I really don't know how the hell I can fix them since they come only online.

An example is with the zombies, when they hunt you, or try to dodge you, in single player it's fine, but online they teleport so I can't kill them easily.

Same with the weapons, in single player they are nicely balanced(in my view) and make their job, but online I kill an enemy with the double amount of ammo(and not because their hp is raised).

I don't know if I have to share some code here maybe that you guys could find the problem.
Spoiler: Zdoom ACC ? (Open)
By the way I've noticed that we can use Zdoom ACC on Zandronum, but here too it works fine only in single player.
Online a lot of funtions just don't start, for example "GetWeapon", in my mode this function is called when the player do an action like launching a grenade because it's launched from another weapon selected with the script and after that it's suppose to give back the old weapon that the player had before. It seems to work, but again online when I see the weapon I'm suppose to have my friends tell me that I'm using a pistol(what I don't see in my own screen), and here too I can't fix it because I don't know where the problem is from.
Thanks for your help.

RE: Bugs that happen only online

Posted: Tue Jun 30, 2015 7:55 pm
by Ænima
fr blood wrote: I don't know if I have to share some code here maybe that you guys could fine
Yes, because otherwise we honestly have no clue what you're talking about based on your vague description of the situation.

fr blood wrote:
Spoiler: Zdoom ACC ? (Open)
By the way I've noticed that we can use Zdoom ACC with slade and it works fine with Zandronum, but here too it works fine only in single player.
Online a lot of funtions just don't start, for example "GetWeapon", in my mode this function is called when the player do an action like launching a grenade because it's launched from another weapon selected with the script and after that it's suppose to give back the old weapon that the player had before. It seems to work, but again online when I see the weapon I'm suppose to have my friends tell me that I'm using a pistol(what I don't see in my own screen), and here too I can't fix it because I don't know where the problem is from.
Sounds like you either need to update ACC.exe or ZCommon.ACS. Open Slade's settings and make sure it's pointing to the latest ACC directory. Honestly I don't even use Slade for ACS, i write it all out in a notepad and use a homemade .BAT batch file to compile it.

RE: Bugs that happen only online

Posted: Tue Jun 30, 2015 8:48 pm
by fr blood
Ok then, so here is the actor on witch all zombies are based:

Code: Select all

ACTOR NewZombie
{
  //$Category "Monsters/Zombie Troppers"
  //$Arg0 Move: 1 Defending, 2 Camping
  //$Arg1 Drop: 1 No
  SeeSound"zombie/see"
  PainSound "zombie/pain"
  DeathSound "zombie/death"
  ActiveSound "zombie/active"
  Obituary "%o was killed by a zombie."
  DamageFactor "Zombie", 0
  DamageFactor "ZombieFlash", 0
  DamageFactor "ZombieFire", 0
  DamageFactor "ZombiePlasma", 0
  Species "Zombie"
  MaxDropOffHeight 32
  MaxStepHeight 32
  MaxTargetRange 2048	
  +FLOORCLIP
  +MISSILEMORE
  +MISSILEEVENMORE
  +QUICKTORETALIATE
  +NODROPOFF
  MONSTER 
  Decal Bulletchip
  Speed 8
  Mass 100
  PainChance 160
  Radius 15
  Height 56
  var int user_script;
  var int user_beacon;
  var int user_wander;
  var int user_dead;
  var int user_patrol;
  States
  {
  	  See:	
	    "####" A 0 A_JumpIf(user_script == 1,6)
        "####" A 0 A_CustomMissile("InfantryStrafingSpawner",0,0,0,CMF_AIMDIRECTION)
		"####" A 0 A_JumpIf(Args[1] == 1,2)
		"####" A 0 A_JumpIf(256,2)
		"####" A 0 A_GiveInventory("NoDrop",1)
        "####" A 0 A_SetUserVar("user_script",1)
        "####" A 0 A_JumpIf(Args[0] == 2,"Camping")
        "####" A 0 A_JumpIf(Args[0] == 1,"SeeStaying")
		"####" A 0 A_SetShootable
		"####" A 0 A_StopSoundEx("SoundSlot7")
		"####" A -1 A_Jump(256,"Chasing")
        Goto Chasing
      Camping:
        "####" A 2 A_FaceTarget
        "####" A 2 A_Chase("","Missile",CHF_DONTMOVE)
        "####" A 0 A_ChangeFlag("Ambush",1)
        "####" A 1 A_Jump(200,2)
        "####" A 0 A_ClearTarget
        "####" A 0 A_ChangeFlag("Ambush",1)
        "####" A 0 A_ChangeFlag("LookAllAround",1)
		"####" A -1 A_Jump(256,"See")
        Goto See
      SeeStaying:
        "####" A 1 A_JumpIfTargetInLOS(8)
        "####" A 4 A_FaceTarget
        "####" A 4 A_Chase("","Missile",CHF_DONTMOVE)
        "####" A 1 A_Jump(200,2)
        "####" A 0 A_ClearTarget
        "####" A 0 A_ChangeFlag("Ambush",1)
        "####" A 0 A_ChangeFlag("LookAllAround",1)
		"####" A -1 A_Jump(256,"See")
        Goto See
        "####" A 0 ThrustThing(angle*256/360+64,4,0,0)
        "####" AAA 2 A_FaceTarget
        "####" B 0 ThrustThing(angle*256/360+64,4,0,0)
        "####" BBB 2 A_FaceTarget
        "####" C 0 ThrustThing(angle*256/360+64,4,0,0)
        "####" CCC 2 A_FaceTarget
        "####" D 0 ThrustThing(angle*256/360+64,4,0,0)
        "####" DDD 2 A_FaceTarget
        "####" A 2 A_Chase("","Missile",CHF_DONTMOVE)
        "####" A 0 ThrustThing(angle*256/360+192,4,0,0)
        "####" AAA 2 A_FaceTarget
        "####" B 0 ThrustThing(angle*256/360+192,4,0,0)
        "####" BBB 2 A_FaceTarget
        "####" C 0 ThrustThing(angle*256/360+192,4,0,0)
        "####" CCC 2 A_FaceTarget
        "####" D 0 ThrustThing(angle*256/360+192,4,0,0)
        "####" DDD 2 A_FaceTarget
        "####" A 2 A_Chase("","Missile",CHF_DONTMOVE)
		"####" A -1 A_Jump(256,"See")
        Goto See	
      TooClose:
	  	"####" A 1 A_Jump(188,"See")
	    "####" A 0 A_Chase("","Missile",CHF_DONTMOVE)
        "####" A 2 A_FaceTarget
		"####" A 2 A_Recoil(2)	
		"####" B 2 A_FaceTarget
		"####" B 2 A_Recoil(2)
		"####" C 0 A_Chase("","Missile",CHF_DONTMOVE)
		"####" C 2 A_FaceTarget
		"####" C 2 A_Recoil(2)	
		"####" D 2 A_FaceTarget
		"####" D 2 A_Recoil(2)	
	    "####" A 0 A_Chase("","Missile",CHF_DONTMOVE)
        "####" A 2 A_FaceTarget
		"####" A 2 A_Recoil(2)	
		"####" B 2 A_FaceTarget
		"####" B 2 A_Recoil(2)
		"####" C 0 A_Chase("","Missile",CHF_DONTMOVE)
		"####" C 2 A_FaceTarget
		"####" C 2 A_Recoil(2)	
		"####" D 2 A_FaceTarget
		"####" D 2 A_Recoil(2)		
		"####" A -1 A_Jump(256,"See")
        Goto See
	  Strafing:
	    "####" A 0 A_Jump(50,"Jump")
		"####" AABB 3 A_FastChase
		"####" C 0 A_Jump(160,2)
		"####" C 0 A_GiveInventory("Jumping",1)
        "####" CCDD 3 A_FastChase
		"####" A -1 A_Jump(256,"See")
        Goto See
	  GiveUp:
	    "####" A 0 A_JumpIfTargetInLos("See")
	    "####" A 0 A_ClearTarget
		"####" A 0 A_PlaySound("zombie/clear")
	    "####" A -1 A_Jump(256,"Idle")
	    Goto Idle
      Idle:
	    "####" A 0 A_JumpIf(Args[0] == 2,"Camping")
        "####" A 0 A_JumpIf(Args[0] == 1,"SeeStaying")
	    "####" A 0 A_JumpIf(user_wander >= 6,"Checking")
	    "####" A 0 A_Look
		"####" A 0 A_ChangeFlag("Ambush",1)
        "####" AA 3 A_Wander
	    "####" B 0 A_Look
        "####" BB 3 A_Wander
	    "####" C 0 A_Look
        "####" CC 3 A_Wander
	    "####" D 0 A_Look
		"####" D 0 A_SetUserVar("user_wander",user_wander+1)
        "####" DD 3 A_Wander
		Loop
	  Checking:	
	  	"####" A 0 A_JumpIf(Args[0] == 2,"Camping")
        "####" A 0 A_JumpIf(Args[0] == 1,"SeeStaying")
	    "####" A 0 A_SetUserVar("user_wander",0)
		"####" A 0 A_SetAngle(angle+40)
		"####" A 15 A_Look
		"####" A 0 A_SetAngle(angle+40)
		"####" A 15 A_Look
		"####" A 0 A_SetAngle(angle+40)
		"####" A 15 A_Look
		"####" A 0 A_SetAngle(angle+40)
		"####" A 15 A_Look
		"####" A 0 A_Jump(128,"Checking")
		"####" A -1 A_Jump(256,"Idle")
        Goto Idle
	  MissileEnd:
	    "####" E 4 A_Jump(60,"Jump","Dash")
		"####" E -1 A_Jump(256,"See")
	    Goto See	
	  MissileEnd2:
	    "####" E 4 A_Jump(60,"Jump")
		"####" E -1 A_Jump(256,"See")
	    Goto See	
	  Jump:	
		"####" A 0 A_JumpIf (momz != 0,3)
	    "####" A 0 ThrustThingZ(0,25,0,1)
	    "####" A 3 A_Recoil(-6)
	    "####" A -1 A_Jump(256,"See")
		Goto See	
	  BigJump:	
		"####" A 0 A_JumpIf (momz != 0,3)
		"####" A 0 A_SpawnItemEx("JumpDashEffect",0,0,32) 
	    "####" A 0 ThrustThingZ(0,48,0,1)
	    "####" A 3 A_Recoil(-18)
	    "####" A -1 A_Jump(256,"See")
		Goto See	
	  Dash:
	    "####" E 0 A_JumpIfTargetInLos(2)
		"####" E -1 A_Jump(256,"See")
        Goto See
		"####" E 2 A_FaceTarget
        "####" E 0 ACS_ExecuteAlways(154,0,100,0,0)
        "####" EEEEEEEEEEEEEEE 1 Bright A_SpawnItemEx("ZombieDashTrail")
		"####" E -1 A_Jump(256,"See")
		Goto See
	  Teleport:
	    "####" E 0 A_JumpIfTargetInLos(2)
		"####" E -1 A_Jump(256,"See")
        Goto See
        "####" E 10 A_FaceTarget
	    "####" E 0 A_SpawnItemEx("TeleportDashEffect",0,0,32)
	    "####" E 0 A_UnsetShootable
        "####" E 20 ACS_ExecuteAlways(154,0,103,0,0)
        "####" AAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	    "####" AAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	    "####" E 70 A_FastChase
	    "####" E 0 A_SpawnItemEx("TeleportDashEffect",0,0,32)
        "####" E 20 A_FaceTarget
	    "####" E 1 A_SetShootable
		"####" E -1 A_Jump(256,"See")
        Goto See	
	  FragGrenade:
        "####" E 0 A_JumpIfCloser(1000,2)
		"####" E -1 A_Jump(256,"See")
        Goto See
		"####" E 0 A_JumpIfCloser(280,"Missile")
        "####" E 10 A_FaceTarget
        "####" EEEEE 4 A_FaceTarget
        "####" E 6 A_CustomMissile("ZombieGrenade",32,0,0,2,10)
		"####" E 35
		"####" E -1 A_Jump(256,"See")
		Goto See
	  FlashBang:
        "####" E 0 A_JumpIfCloser(1000,2)
		"####" E -1 A_Jump(256,"See")
        Goto See
		"####" E 2 A_JumpIfCloser(280,"Missile")
        "####" E 10 A_FaceTarget
        "####" EEEEE 4 A_FaceTarget
        "####" E 6 A_CustomMissile("ZombieFlashBang",32,0,0,2,10)
		"####" E 35
		"####" E -1 A_Jump(256,"See")
		Goto See
	  FlyingGrenade:
        "####" E 0 A_JumpIfCloser(1000,2)
		"####" E -1 A_Jump(256,"See")
        Goto See
		"####" E 0 A_JumpIfCloser(280,"Missile")
        "####" E 10 A_FaceTarget
        "####" EEEEE 4 A_FaceTarget
        "####" E 6 A_CustomMissile("ZombieFlyingGrenade",32,0,0)
		"####" E 35
		"####" E -1 A_Jump(256,"See")
		Goto See	
	  PlasmaGrenade:
        "####" E 0 A_JumpIfCloser(1000,2)
		"####" E -1 A_Jump(256,"See")
        Goto See
		"####" E 1 A_JumpIfCloser(280,"Missile")
        "####" E 10 A_FaceTarget
        "####" EEEEE 4 A_FaceTarget
        "####" E 6 A_CustomMissile("ZombiePlasmaGrenade",32,0,0,2,10)
		"####" E 35
		"####" E -1 A_Jump(256,"See")
		Goto See
	  IncendiaryGrenade:
        "####" E 0 A_JumpIfCloser(1000,2)
		"####" E -1 A_Jump(256,"See")
        Goto See
		"####" E 1 A_JumpIfCloser(280,"Missile")
        "####" E 10 A_FaceTarget
        "####" EEEEE 4 A_FaceTarget
        "####" E 6 A_CustomMissile("ZombieIncendiaryGrenade",32,0,0,2,10)
		"####" E 35
		"####" E -1 A_Jump(256,"See")
		Goto See		
	  SmallBeacon:
        "####" E 0 A_JumpIf(user_beacon == 1,"Missile")
        "####" E 6 A_FaceTarget
		"####" EEEEEE 2
		"####" E 0 A_SetUserVar("user_beacon",1)
		"####" E 0 A_SpawnItemEx("ZombieSmallBeacon",0,0,16,8,0,4,0)
		"####" E 35
		"####" E -1 A_Jump(256,"See")
		Goto See
	  Beacon:
        "####" E 0 A_JumpIf(user_beacon == 1,"Missile")
        "####" E 6 A_FaceTarget
		"####" EEEEEE 2
		"####" E 0 A_SetUserVar("user_beacon",1)
		"####" E 0 A_SpawnItemEx("ZombieBeacon",0,0,16,8,0,4,0)
		"####" E 35
		"####" E -1 A_Jump(256,"See")
		Goto See
	  HeavyBeacon:
        "####" E 0 A_JumpIf(user_beacon == 1,"Missile")
        "####" E 6 A_FaceTarget
		"####" EEEEEE 2
		"####" E 0 A_SetUserVar("user_beacon",1)
		"####" E 0 A_SpawnItemEx("ZombieHeavyBeacon",0,0,16,8,0,4,0)
		"####" E 25
		"####" E -1 A_Jump(256,"See")
		Goto See
	  NormalPain:
        "####" G 6 A_Pain
		"####" G -1 A_Jump(256,"See")
        Goto See
	  ProPain:
	    "####" G 0 A_Jump(10,"Teleport")
	    "####" G 0 A_Jump(40,"Dash")
        "####" G 6 A_Pain
		"####" G -1 A_Jump(256,"See")
        Goto See
	  SuperProPain:
	    "####" G 0 A_Jump(25,"Teleport")
	    "####" G 0 A_Jump(75,"Dash")
        "####" G 6 A_Pain
		"####" G -1 A_Jump(256,"See")
        Goto See	
	  Pain.Flash:
	    "####" G 0 A_StopSoundEx("SoundSlot7")
	    "####" G 0 A_ChangeFlag("NOPAIN",1)
		"####" G 0 A_Pain
	    "####" GGGGGGGGGGGGGGGGGGGGGGGGGGGG 8 A_Wander
		"####" G 0 A_ChangeFlag("NOPAIN",0)
	    "####" G -1 A_Jump(256,"See")
        Goto See
      Death:
	    "####" A 0 A_SetUserVar("user_dead",1)
        "####" A 0 A_GiveInventory("ImDead",1)
		"####" A -1 A_Jump(256,"Dead")
		Goto Dead
	  Death.Fire:
	    "####" A 0 A_SetUserVar("user_dead",1)
	    "####" A 0 A_GiveInventory("ImDead",1)	
		"####" A 0 A_GiveInventory("NoBlocking",1)
		"####" A 1 A_SpawnItemEx("ZBurningCorpse")
		Stop
	  Death.Plasma:
	    "####" A 0 A_SetUserVar("user_dead",1)
	    "####" A 0 A_GiveInventory("ImDead",1)	
		"####" A 0 A_GiveInventory("NoBlocking",1)
		"####" A 0 A_Scream
		"####" A 1 A_SpawnItemEx("LiquifiedBody")
		Stop			
      XDeath:
	    "####" A 0 A_SetUserVar("user_dead",1)
        "####" A 0 A_GiveInventory("ImDead",1)
		"####" A -1 A_Jump(256,"XDead")
		Goto XDead	
	XDead:
		ZASG O 0 A_PlaySound("gibbage/xsplat")
        ZASG O 3 A_SpawnItemEx("GibGenerator")
        ZASG P 3 A_XScream
        ZASG Q 3 A_GiveInventory("NoBlocking",1)
        ZASG RSTUV 3
        ZASG W -1
        Stop	
      Raise:
        "####" A 0 A_SetUserVar("user_script",0)
		"####" A 0 A_TakeInventory("ImDead",1)
		"####" A 0 A_SetSolid
		"####" A 1 A_Jump(256,"Raising")
        Goto Raising
  }
}
And here one of the zombies that you could encounter:

Code: Select all

ACTOR ZombieSoldier : NewZombie 18300
{
Health 150
DropItem "NewArmorBonus" 64
DropItem "FragGrenadeAmmo" 8
DropItem "BouncingBettyAmmo" 4
DropItem "AdrenalineKit" 2
DropItem "LightArmor" 2
DropItem "AssaultRifle" 16
DropItem "NewClip" 256 30
AttackSound "arifle/fire"
Obituary "%o was killed by a zombie soldier."
States
{
	Spawn:
        ZPOS A 10 A_Look
        Loop
	  Chasing:
	    "####" A 0 A_JumpIf(user_patrol == 1,2)
	    "####" A 0 A_JumpIfCloser(100,"TooClose")
		"####" A 0 A_Jump(10,"GiveUp")
        ZPOS AABBCCDD 3 A_Chase
        Goto See		
	Missile:
        ZPOS E 10 A_FaceTarget
		ZPOS E 0 A_GiveInventory("StrafeTime",3)
        ZPOS E 0 A_CustomMissile("BulletCasing",32,0,315+random(-8,8))
        ZPOS F 2 Bright A_CustomBulletAttack(4,4,1,3,"ZBulletPuff")
        ZPOS E 3 A_FaceTarget
        ZPOS E 0 A_CustomMissile("BulletCasing",32,0,315+random(-8,8))
        ZPOS F 2 Bright A_CustomBulletAttack(4,4,1,3,"ZBulletPuff")
        ZPOS E 3 A_FaceTarget		
        ZPOS E 0 A_CustomMissile("BulletCasing",32,0,315+random(-8,8))
        ZPOS F 2 Bright A_CustomBulletAttack(4,4,1,3,"ZBulletPuff")
        ZPOS E 3 A_FaceTarget		
	    ZPOS A 0 A_CustomMissile("BulletCasing",32,0,315+random(-8,8))
        ZPOS F 2 Bright A_CustomBulletAttack(4,4,1,3,"ZBulletPuff")
        ZPOS E 3 A_FaceTarget			
		Goto See
	Pain:
        ZPOS G 1
        Goto NormalPain
	Dead:
        ZPOS H 5  
        ZPOS I 5 A_Scream
        ZPOS J 5 A_GiveInventory("NoBlocking",1)
        ZPOS K 5
		ZPOS L -1
        Stop
	XDead:
		ZPOS A 0 A_PlaySound("gibbage/xsplat")
        ZPOS M 3 A_SpawnItemEx("GibGenerator")
        ZPOS N 3 A_XScream
        ZPOS O 3 A_GiveInventory("NoBlocking",1)
        ZPOS PQRST 3
        ZPOS U -1
        Stop
	Raising:
        ZPOS KJIH 5
        Goto See
		}
}
As I said the problem is when they walk around online, sometimes it's fine and sometimes they teleport by that I mean that their sprite it still at the same position when the actor itself is somewhere else, and when he enters in his fire state the teleport end.

RE: Bugs that happen only online

Posted: Tue Jun 30, 2015 9:30 pm
by Ænima
That sounds like client desync. I noticed you use a lot of jump states and checks in the actor's DECORATE. Could that be it? Maybe a script is checking for desyncronized information.

RE: Bugs that happen only online

Posted: Tue Jun 30, 2015 10:26 pm
by fr blood
I didn't have the choice with the jump states, if I didn't use it the zombies would just be invisible online, that solution was found by Zombo.

I wanted to thank him but my comment was sent to trash with the [necro] witch I don't know what it means.

RE: Bugs that happen only online

Posted: Wed Jul 01, 2015 12:11 am
by Ænima
Yeah something in those jumps is getting desync'd. Could it be your user variables?

Also maybe i'm not aware of something but

Code: Select all

        "####" E 0 A_JumpIfTargetInLos(2)
        "####" E -1 A_Jump(256,"See")
        Goto See
is that necessary when you can just have this?

Code: Select all

        "####" E 0 A_JumpIfTargetInLos(1)
        Goto See
Or does that cause things to be invisible? Based on Torr's explanation of the sync perils of client/server jump prediction, I'm assuming that's what you're trying to circumvent, although I've used similar code in the past using inheritance and never had any problems. I also jump using state names instead of number offsets nowadays, although I'm not sure if that has anything to do with it.

RE: Bugs that happen only online

Posted: Wed Jul 01, 2015 7:22 am
by fr blood
Yeah that cause things to become invisible.
I'm gonna try this:

Code: Select all

"####" E -1 A_JumpIfTargetInLos("AnotherState")
Goto See
Hoping it will fix the problem.

RE: Monster Client Desync

Posted: Thu Jul 02, 2015 3:26 pm
by fr blood
It didn't worked, I really can't tell from where the problem is, could the devs check this when they'll have the time ?

RE: Monster Client Desync

Posted: Thu Jul 02, 2015 5:29 pm
by ibm5155
on a case where you have just one or two monsters on the server, the problem happens too?

RE: Monster Client Desync

Posted: Thu Jul 02, 2015 6:03 pm
by fr blood
ibm5155 wrote: on a case where you have just one or two monsters on the server, the problem happens too?
I don't know I didn't checked if it happens depending on monsters number, but it looks like that I've found a way to reduce this problem, I've replaced the old state by that:

Code: Select all

"####" E -1 A_Jump(256,"AnotherState")
Wait
It makes sure that the actor do nothing until he hasn't changed his state on both clientside and serverside, it could maybe be THE SOLUTION.

RE: Monster Client Desync

Posted: Fri Jul 03, 2015 4:06 pm
by ibm5155
-1.
I never get why there's a need of -1 over decorate
0 for me it'll run in zero tics.
1 will delay 1 tic ( I think it's in tics...)
-1, hmmm, I'm coming back in time? :lol:

RE: Monster Client Desync

Posted: Fri Jul 03, 2015 4:13 pm
by Sean
ibm5155 wrote: -1.
I never get why there's a need of -1 over decorate
0 for me it'll run in zero tics.
1 will delay 1 tic ( I think it's in tics...)
-1, hmmm, I'm coming back in time? :lol:
-1 means forever.

RE: Monster Client Desync

Posted: Fri Jul 03, 2015 5:18 pm
by fr blood
Look at that:

Code: Select all

Missile:
POSS E 10 A_FaceTarget
POSS F 8 A_PosAttack
POSS E 8
Goto See
That the code we finfd in the original zombieman when he attacks, for now there is no problem offline and online.

So now if I want to make a new monster based on the zombieman and that I would like it to conserve his original attack, then I would have this:

Code: Select all

ACTOR NewZombieMan : ZombieMan
{
  States
  {
  Spawn:
    POSS AB 10 A_Look
    Loop
  See:
    POSS AABBCCDD 4 A_Chase
    Loop
  Pain:
    POSS G 3
    POSS G 3 A_Pain
    Goto See
  Death:
    POSS H 5
    POSS I 5 A_Scream
    POSS J 5 A_NoBlocking
    POSS K 5
    POSS L -1
    Stop
  XDeath:
    POSS M 5
    POSS N 5 A_XScream
    POSS O 5 A_NoBlocking
    POSS PQRST 5
    POSS U -1
    Stop
  Raise:
    POSS K 5
    POSS JIH 5
    Goto See
  }
}
As always offline it will work fine, but it's here where start the problem online, if the missile state(or any state) is used from another monster, then the monster who used this state will become invisible online.

So the only way that I found to fix that bug was to edit the original ZombieMan itself with that:

Code: Select all

Missile:
POSS E 10 A_FaceTarget
POSS F 8 A_PosAttack
POSS E 8
POSS E 0 A_Jump(256,"See")
Goto See
The jump will make sure that new zombie man go back to his "See" state online, so he won't become invisible anymore.
But even here we got another problem the client desync, they will start to teleport(on clientside) making them very hard to kill.
And I guess that is because of the short delay "0" that they have to make the jump.

After searching on the forum I found Zombo's solution:

Code: Select all

Missile:
POSS E 10 A_FaceTarget
POSS F 8 A_PosAttack
POSS E 8
POSS E -1 A_Jump(256,"See")
Wait
And actually it's the best proper way to avoid both bugs and desync that I found, "-1" means that the delay is infinite until the monster make the jump state, and wait will force the monster to go back to this line until he makes the jump.

If you guys have encounter this problem when making a project with new monsters and found a solution then your help is the welcome.

RE: Monster Client Desync

Posted: Fri Jul 03, 2015 6:20 pm
by Ivan
I think there's a problem related to inheritance of actors, or maybe a possible misuse on your end. I encountered some inheritance problems while I was trying to make a base actor with special death states all added, but none of them actually worked and the actor just went invisible as soon as it happened. Might be worth a report on the bugtracker as it sounds awfully similar.

RE: Monster Client Desync

Posted: Fri Jul 03, 2015 6:36 pm
by Ænima
Have you tried using Goto Super::See?

RE: Monster Client Desync

Posted: Sat Jul 04, 2015 8:44 am
by fr blood
Ænima wrote: Have you tried using Goto Super::See?
I just tested it, and it didn't solve the problem.

RE: Monster Client Desync

Posted: Sun Jul 12, 2015 4:17 pm
by Cruduxy
Don't rely on states in the original actor if you modify the see\spawn and pain states only. You'll end with unpredictable execution sequences in the code. Copy paste the original zombieman missile to that newzombieman and see if it'll work better (almost sure it will).

I think the movement desync online is because you used A_Recoil and ThrustThing. They'll appear to teleport all over the place online (Somehow calling a_stop after them makes it less visible online).

Edit : Your fix is more of a walk around than a real fix. All you did was tell it to go specifically to the "see" state. Instead of it being goto super::see when you use the old missile state because of inheritance :P.

RE: Monster Client Desync

Posted: Sun Jul 12, 2015 4:25 pm
by Combinebobnt
I don't remember good results when using "####" as the sprite in zandronum.

RE: Monster Client Desync

Posted: Sun Jul 12, 2015 9:10 pm
by fr blood
Cruduxy wrote: Don't rely on states in the original actor if you modify the see\spawn and pain states only. You'll end with unpredictable execution sequences in the code. Copy paste the original zombieman missile to that newzombieman and see if it'll work better (almost sure it will).

I think the movement desync online is because you used A_Recoil and ThrustThing. They'll appear to teleport all over the place online (Somehow calling a_stop after them makes it less visible online).
As you can see my zombies are very complex that why I use inheritance, if I didn't then it would take a tons of codage, but I'll do as you said for these states.

I will make a test by removing all A_Recoil/ThrustThing movement it could maybe solve the problem.
Cruduxy wrote: Edit : Your fix is more of a walk around than a real fix. All you did was tell it to go specifically to the "see" state. Instead of it being goto super::see when you use the old missile state because of inheritance :P.
You are right it's not a fix at all the problem is still present, if only I was able to predict exactly when it comes then I could fix it by myself but sometimes the zombies work fine and other times start jittering.
Combinebobnt wrote: I don't remember good results when using "####" as the sprite in zandronum.
So it confirme that I'll have to wait for the next Zandronum updates ?
I'm going to make more test using this special sprite and if the problem happens again I'll open a ticket about it.