[Addressed] Fast demons have a slow pain

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Fast demons have a slow pain

Postby Gez » Tue Jun 12, 2012 12:59 pm

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

Vanilla Doom:
Code: Select allExpand view
   for (i=S_SARG_RUN1 ; i<=S_SARG_PAIN2 ; i++)
       states[i].tics >>= 1;


Still vanilla:
Code: Select allExpand view
    {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 allExpand view
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 allExpand view
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
  }
Gez
 
 
 
Joined: 06 Jul 2007

Re: Fast demons have a slow pain

Postby Xtyfe » Tue Jun 12, 2012 9:15 pm

Why would this be for demons only? Interesting eitherway

I would also like to see a fast keyword thing
User avatar
Xtyfe
Neque Deos, Neque Dominos
 
Joined: 15 Dec 2007
Location: The Intertubes

Re: Fast demons have a slow pain

Postby Graf Zahl » Wed Jun 13, 2012 1:57 am

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Fast demons have a slow pain

Postby Edward-san » Wed Jun 13, 2012 7:01 am

Pain.Nightmare state in Demon actor definition?
Edward-san
Mathematics is the language with which God has written the universe. (Galilei)
 
Joined: 17 Oct 2009

Re: Fast demons have a slow pain

Postby Gez » Wed Jun 13, 2012 3:10 pm

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?
Gez
 
 
 
Joined: 06 Jul 2007

Re: Fast demons have a slow pain

Postby Xaser » Wed Jun 13, 2012 4:04 pm

Cue Psychic.

Code: Select allExpand view
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
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: Fast demons have a slow pain

Postby XutaWoo » Wed Jun 13, 2012 8:21 pm

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
XutaWoo
one day when going to see the rabbit, there was a previous visitor ...
 
Joined: 30 Dec 2006
Location: beautiful hills of those who are friends

Re: Fast demons have a slow pain

Postby Graf Zahl » Sat Jun 16, 2012 2:23 am

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Fast demons have a slow pain

Postby Xtyfe » Sat Jun 16, 2012 10:38 am

How would this keyword be used? Would it only work on the frames its placed on during fast monsters?
User avatar
Xtyfe
Neque Deos, Neque Dominos
 
Joined: 15 Dec 2007
Location: The Intertubes

Re: Fast demons have a slow pain

Postby Graf Zahl » Sat Jun 16, 2012 10:54 am

See Gez's initial post. It's used just like 'Bright' and only affect the states it's on, not the entire sequence.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests