Fast demons have a slow pain

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Fast demons have a slow pain

Post by Gez »

Since there was some discussion about the subject on the Doom wiki, I've noticed this:

Vanilla Doom:

Code: Select all

	for (i=S_SARG_RUN1 ; i<=S_SARG_PAIN2 ; i++) 
	    states[i].tics >>= 1; 
Still vanilla:

Code: Select all

    {SPR_SARG,0,2,{A_Chase},S_SARG_RUN2,0,0},	// S_SARG_RUN1
    {SPR_SARG,0,2,{A_Chase},S_SARG_RUN3,0,0},	// S_SARG_RUN2
    {SPR_SARG,1,2,{A_Chase},S_SARG_RUN4,0,0},	// S_SARG_RUN3
    {SPR_SARG,1,2,{A_Chase},S_SARG_RUN5,0,0},	// S_SARG_RUN4
    {SPR_SARG,2,2,{A_Chase},S_SARG_RUN6,0,0},	// S_SARG_RUN5
    {SPR_SARG,2,2,{A_Chase},S_SARG_RUN7,0,0},	// S_SARG_RUN6
    {SPR_SARG,3,2,{A_Chase},S_SARG_RUN8,0,0},	// S_SARG_RUN7
    {SPR_SARG,3,2,{A_Chase},S_SARG_RUN1,0,0},	// S_SARG_RUN8
    {SPR_SARG,4,8,{A_FaceTarget},S_SARG_ATK2,0,0},	// S_SARG_ATK1
    {SPR_SARG,5,8,{A_FaceTarget},S_SARG_ATK3,0,0},	// S_SARG_ATK2
    {SPR_SARG,6,8,{A_SargAttack},S_SARG_RUN1,0,0},	// S_SARG_ATK3
    {SPR_SARG,7,2,{NULL},S_SARG_PAIN2,0,0},	// S_SARG_PAIN
    {SPR_SARG,7,2,{A_Pain},S_SARG_RUN1,0,0},	// S_SARG_PAIN2
ZDoom:

Code: Select all

int AActor::GetTics(FState * newstate)
{
	int tics = newstate->GetTics();
	
	if (isFast())
	{
		if (flags5 & MF5_FASTER)
		{
			if (InStateSequence(newstate, SeeState)) return tics - (tics>>1);
		}
		if (flags5 & MF5_FASTMELEE)
		{
			if (InStateSequence(newstate, MeleeState)) return tics - (tics>>1);
		}
	}
	return tics;
}
In vanilla, the demon has the duration of its state halved in the sequences S_SARG_RUN* (See), S_SARG_ATK* (Melee), and S_SARG_PAIN* (Pain). In ZDoom, only See and Melee are halved in this way.

There needs to be an MF6_FASTPAIN flag too, I guess.

It might be complicated by the existence of custom pain types, but vanilla accuracy only requires to handle the generic Pain state with no need to handle more complex things. (Especially given how the FASTER and FASTMELEE flags are a bit useless with the complicated actor scripting that goes on nowaday with A_JumpIfs everywhere and dozens of labels.)


Alternatively, it could be a boolean flag on the state themselves. Kinda like the Bright keyword, there'd be a Fast keyword? The demon's code could look like this:

Code: Select all

States
  {
  Spawn:
    SARG AB 10 A_Look
    Loop
  See:
    SARG AABBCCDD 2 Fast A_Chase
    Loop
  Melee:
    SARG EF 8 Fast A_FaceTarget
    SARG G 8 Fast A_SargAttack
    Goto See
  Pain:
    SARG H Fast 2
    SARG H Fast 2 A_Pain
    Goto See
  Death:
    SARG I 8
    SARG J 8 A_Scream
    SARG K 4
    SARG L 4 A_NoBlocking
    SARG M 4
    SARG N -1
    Stop
  Raise:
    SARG N 5
    SARG MLKJI 5
    Goto See
  }
User avatar
Xtyfe
Posts: 1490
Joined: Fri Dec 14, 2007 6:29 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: Fast demons have a slow pain

Post by Xtyfe »

Why would this be for demons only? Interesting eitherway

I would also like to see a fast keyword thing
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Fast demons have a slow pain

Post by Graf Zahl »

The 'Fast' keyword is a good idea.
The question is, what to do with these flags. They are crude hacks at best and I have no idea how many people might use some monsters inherited from the Demon in fast mode. The flags are inheritable, the state keyword of course is not, if the states are changed.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Fast demons have a slow pain

Post by Edward-san »

Pain.Nightmare state in Demon actor definition?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Fast demons have a slow pain

Post by Gez »

Edward-san wrote:Pain.Nightmare state in Demon actor definition?
That would be a colossal mixup which would make everything impossible to understand. People would go saying "You cannot grasp the true form of ZDoom's custom pain states".

Seriously, though. Pain.Whatever is for Whatever damage. What happens if someone has a weapon that inflicts Nightmare damage and doesn't play in Nightmare! mode?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Fast demons have a slow pain

Post by Xaser »

Cue Psychic.

Code: Select all

ACTOR NiteShot : PlasmaBall
{ 
    Scale 0.3
    Alpha 0.75
    Damage 8
    Speed 20
    SeeSound "weapons/nightmarebounce"
    DeathSound ""
    Reactiontime 10
    + DOOMBOUNCE
	Damagetype "Nightmare"
	Obituary "%o let %k become %p new nightmare."
    States
    {
    ...
    }
}
;)
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Fast demons have a slow pain

Post by XutaWoo »

Graf Zahl wrote:The question is, what to do with these flags. They are crude hacks at best and I have no idea how many people might use some monsters inherited from the Demon in fast mode. The flags are inheritable, the state keyword of course is not, if the states are changed.
Make 'em act like +BRIGHT for states after specific labels that don't have the keyword and deprecate 'em? Seems like a simple solution conceptually.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Fast demons have a slow pain

Post by Graf Zahl »

After some thinking I decided to deprecate the flags and render them inoperable.

The thing is, both solutions will create incompatibilities.
The flags haven't been Dehacked-compatible and affected older monsters they shouldn't have so keeping them will cause problems here
Removing the flags will affect a few WADs that derive monsters from the Demon and here's 2 cases: Mods that weren't aware of this behavior and mods that were.

In the end I just think that the mods that are adversely affected by keeping the flags are clearly in the minority - I'm not even sure how well some of these newfangled 'gameplay' mods work with Nightmare mode - and these flags constitute a robustness issue so removing them seems like the best solution in my book.

The new 'Fast' keyword is a much better way to handle this.
User avatar
Xtyfe
Posts: 1490
Joined: Fri Dec 14, 2007 6:29 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: Fast demons have a slow pain

Post by Xtyfe »

How would this keyword be used? Would it only work on the frames its placed on during fast monsters?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Fast demons have a slow pain

Post by Graf Zahl »

See Gez's initial post. It's used just like 'Bright' and only affect the states it's on, not the entire sequence.
Post Reply

Return to “Closed Bugs [GZDoom]”