[User error] [GZDooM 3.4.1] Buged flags

Bugs that have been investigated and resolved somehow.

Moderator: Developers

[GZDooM 3.4.1] Buged flags

Postby Arch-vile90 » Wed Jul 11, 2018 1:01 pm

I start with the premise that, honestly, I do not know what could have happened so I might not be exhaustive with the explanation so ask me; despite my lack of knowledge, i will try to be as clear as possible!

Since I downloaded version 3.4.1 I started to find this "bug", which turns the player into an enemy, in several episodes.

The first time it showed up, my beta tester reported it to me, stating that the monsters did not attacking him, as if there was NOTARGET active, but while activating / deactivating the console flag the result did not change.

I do not think it is a bug related to the map because he used is a finished project and never touched up since 2016.

Today, however, I encountered the same problem playing the "Community Chest 3", in the map 12. Restarting the map and the bug does not appear, then - Open conosole - Myinfo and I get these results:

Because the pics are too big and was impossible made a screenshot, i uploaded the pics in my dropbox so here the links.
1) Normal Flags:
https://www.dropbox.com/s/bic2vou5aykbc ... s.jpg?dl=0

2) Bugged flags:
https://www.dropbox.com/s/r40qpt1xzfgf5 ... o.jpg?dl=0

I did not know the existence of the JUSTHIT flag since now but I do not know why it was assigned to me, what's more, the PICKUP flag is also removed for witch reasons :?:
The most ironic thing is that this situation does not always happen so I do not know what to think about.

If necessary I will provide a link of the mod, even if, for now, I could not make it pubblic for credit problems.
User avatar
Arch-vile90
Do you poba? if yes, you're welcome!
 
Joined: 01 Jul 2014
Location: Italy, the place of pizza

Re: [GZDooM 3.4.1] Buged flags

Postby Zhs2 » Wed Jul 11, 2018 3:20 pm

GZDoom 3.2.0 release wrote:Unfriendly players - when a PlayerPawn object has -FRIENDLY set, they become a playable monster and interact with the game world as one. Additionally, they become deathmatch opponents, capable of dealing and taking damage from other players.
User avatar
Zhs2
Power of three.
 
Joined: 07 Nov 2008
Location: Maryland, USA, but probably also in someone's mod somewhere

Re: [GZDooM 3.4.1] Buged flags

Postby Graf Zahl » Wed Jul 11, 2018 3:54 pm

Yes, we defnitely need the mod, something in there clears the FRIENDLY flag, from the looks of it.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [GZDooM 3.4.1] Buged flags

Postby Rachael » Wed Jul 11, 2018 4:10 pm

If you must do it privately, please CC me in the message, as I am the one who developed that feature.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: [GZDooM 3.4.1] Buged flags

Postby Rachael » Wed Jul 11, 2018 7:36 pm

So from what I can see, this mod makes extremely extensive use of the FRIENDLY flag, and I really can't understand why.

Code: Select allExpand view
C:\GZDoom\testing\dec>grep -ri "friendly" "*"|wc
    588    2683   31488

C:\GZDoom\testing\dec>


That's at least 588 instances, and that's just from the files I extracted, that I managed to find containing DECORATE information.

The only real solution I can think of for this issue is implementing a compatflag, but until we have file-loaded specific checks rather than map-specific checks we simply cannot implement a check for when this particular file is loaded.

That being said, what little I saw of the use of the +FRIENDLY flag, its use is pretty redundant and hacky, and in many cases simply unnecessary, but in other cases can be done with an inventory check rather than using an actor flag. I think I am going to wait to see what Graf wants to do before I do anything. (Maybe this would be a good candidate for an "opt-out only" compatflag? Where the old behavior once again becomes default, and players/modders must specify a flag in order to activate the new behavior)

I can leave you with the wisdom of "DON'T DO THAT!" - but of course, 588 instances is too late for that now, and it is unreasonable to expect you to manually check through all of them and fix them, so either this mod is stuck on an old version of GZDoom, or it will depend very heavily on a compatibility flag, and there will need to be a way for this mod to set for itself that flag to be in use for all maps.

I can tell you this: When actual friendly monsters came into play, this mod definitely would've been broken, anyway, even in older versions of GZDoom. When they saw a lack of +FRIENDLY on the player, they would have outright attacked, even then.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: [GZDooM 3.4.1] Buged flags

Postby Graf Zahl » Thu Jul 12, 2018 1:27 am

He didn't send me the mod. But from what you describe, "Don't do that!" pretty much nails it. The FRIENDLY flag is one of the most behavior-critical flags in the entire game and messing with it is bound to cause problems.

And concerning a compatibility flag: Those are meant to address common mapping habits that no longer apply due to some change. This sounds more like broken code, but I'd need to have a look first.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [GZDooM 3.4.1] Buged flags

Postby Arch-vile90 » Thu Jul 12, 2018 3:00 am

For the question about istances, most of them are projectiles and missiles that damage the player if the flag is not specified but 588 is a bit strange, yes.

For now i send, if you allow to do it, to Graf the mod link in private.
If the problem is to check into all decorate i have no problem to do that; i have a lot of patience.
User avatar
Arch-vile90
Do you poba? if yes, you're welcome!
 
Joined: 01 Jul 2014
Location: Italy, the place of pizza

Re: [GZDooM 3.4.1] Buged flags

Postby Rachael » Thu Jul 12, 2018 4:07 am

Graf does allow it. Please send him a copy.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: [GZDooM 3.4.1] Buged flags

Postby Graf Zahl » Thu Jul 12, 2018 4:09 am

Most of the flag switching looks harmless - but these two are another matter:

Code: Select allExpand view
// FRIENDLY
actor _CF_FRIENDLY_0 : CustomInventory
{
   states
   {
   Pickup:
      TNT1 A 0 A_ChangeFlag("FRIENDLY", false)
      stop
   }
}

actor _CF_FRIENDLY_1 : CustomInventory
{
   states
   {
   Pickup:
      TNT1 A 0 A_ChangeFlag("FRIENDLY", true)
      stop
   }
}
 


If those are given to a player, bad things will happen.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [GZDooM 3.4.1] Buged flags

Postby Arch-vile90 » Thu Jul 12, 2018 4:28 am

Graf Zahl wrote:Most of the flag switching looks harmless - but these two are another matter:

Code: Select allExpand view
// FRIENDLY
actor _CF_FRIENDLY_0 : CustomInventory
{
   states
   {
   Pickup:
      TNT1 A 0 A_ChangeFlag("FRIENDLY", false)
      stop
   }
}

actor _CF_FRIENDLY_1 : CustomInventory
{
   states
   {
   Pickup:
      TNT1 A 0 A_ChangeFlag("FRIENDLY", true)
      stop
   }
}
 


If those are given to a player, bad things will happen.


HUGH!
I was convinced that I had removed that old decorate but it is still present.
This was an old decorate it belonged to an old weapon wheel system ( now replaced with PYWeaonWeel ).


So you think THIS is the real problem?
This bug showed up before I started creating this twisted decorate. :?:
For now i try to do a run to check if it still alive.
Last edited by Arch-vile90 on Thu Jul 12, 2018 5:01 am, edited 1 time in total.
User avatar
Arch-vile90
Do you poba? if yes, you're welcome!
 
Joined: 01 Jul 2014
Location: Italy, the place of pizza

Re: [GZDooM 3.4.1] Buged flags

Postby Graf Zahl » Thu Jul 12, 2018 4:30 am

It was the only one I found which alters its owner's flags. If it isn't this, something similar must be buried elsewhere.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [GZDooM 3.4.1] Buged flags

Postby Rachael » Thu Jul 12, 2018 5:13 am

Graf Zahl wrote:It was the only one I found which alters its owner's flags. If it isn't this, something similar must be buried elsewhere.

I'm almost positive that it's something else.

I have searched those same files for instances of those two items being given, and could not find any.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: [GZDooM 3.4.1] Buged flags

Postby Arch-vile90 » Thu Jul 12, 2018 2:36 pm

Those actor were given via script for the weapon weel system ( it was a convoluted system, yes ) but that script has been removed days ago, that decorate was just the last piece of cancer ( i think ).
I've done some run on those maps where the bug mostly showed up and for now is all working fine. Maybe it generated some kind of strange conflict.
User avatar
Arch-vile90
Do you poba? if yes, you're welcome!
 
Joined: 01 Jul 2014
Location: Italy, the place of pizza

Re: [GZDooM 3.4.1] Buged flags

Postby Graf Zahl » Thu Jul 12, 2018 3:12 pm

Good to hear. I think anyway that this can be filed away as a "scripting error".
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [GZDooM 3.4.1] Buged flags

Postby Arch-vile90 » Thu Jul 12, 2018 3:30 pm

ok i find the real thing that generate the bad situation.
THIS ONE ( you can find it into the NeutronMine+Teleporter.dec from the Part 3 of the mod) :
Code: Select allExpand view
ACTOR NeutronExplosion
{Scale 0.4 Damage 0
+GHOST +FRIENDLY
+MTHRUSPECIES +NOGRAVITY
+FORCERADIUSDMG
+NODAMAGETHRUST
+DONTTHRUST
+THRUSPECIES
+NOGRAVITY
DamageType "BlackHole"
States{
Spawn:
   TNT1 A 0
   TNT1 A 0 A_PlaySound("NBomb/Explosion",14)
NeutronLoop:
   TNT1 A 0 A_PlaySound("BHBall2/Explode",15)
   TNT1 A 0 A_JumpIfInventory("StrikerBallTimer",30,"Death")
   TNT1 AAAAAA 1 bright Light("NeutronExplosionLight") { //A_Explode(1,128,1);
A_SpawnItemEx("HellsingLightningFog",random(96,-96),random(96,-96),Random(96,-96),0,0,0,Random(-20,20),128);
A_SpawnItemEx("NeutronSmoke",random(64,-64),random(64,-64),random(66,-66),0.00001*random(100000,-100000),0.00001*random(100000,-100000),0.00001*random(100000,-100000),random(0,359),128,0);
A_RadiusGive("NeutronPower",128,RGF_MONSTERS|RGF_CORPSES|RGF_NOMASTER,1);
A_RadiusGive("NeutronConvulsionEffect",180,RGF_GIVESELF|RGF_PLAYERS,1); }
   TNT1 A 0 A_GiveInventory("StrikerBallTimer",1)
Loop
Death:
   TNT1 A 0 A_ChangeFlag("NoGravity",0)
   TNT1 A 0 A_PlaySound("Volcabus/Cannon",7)
   TNT1 AAAAA 0 A_SpawnItemEx("ObeliskTrailSpark",random(19,-19),random(19,-19),random(19,-19),0,0,0,0,128,0)
   TNT1 A 0 A_SpawnItemEx("ObeliskExplode",0,0,48,0,0,0,0,128,0)
Stop
}}

Actor NeutronTimer : Inventory { Inventory.MaxAmount 1 }
Actor NeutronPower : CustomInventory
{ Inventory.MaxAmount 0
+Inventory.AutoActivate
States{
Spawn:
   TNT1 A 1
Fail
Use: // ------------------- THE MAGIC NIGHTMARE
   TNT1 A 0 A_JumpIfHealthLower(1,"NeutronEnd")
   TNT1 A 0 A_JumpIfInventory("NeutronTimer",1,"BecomeEnemy")
   TNT1 A 0 A_ChangeFlag("FRIENDLY",Random(0,1)) 
   TNT1 A 0 ACS_NamedExecute("NeutronGiver")
   TNT1 A 0 A_GiveInventory("NeutronTimer",1)
Stop
NeutronEnd:
   TNT1 A 0 A_Die
Stop
BecomeEnemy:
   TNT1 A 0 A_ChangeFlag("FRIENDLY",0)
   TNT1 A 0 A_TakeInventory("NeutronTimer",1)
Stop
}}

ACTOR NeutronConvulsionEffect : CustomInventory
{radius 160
Inventory.PickupMessage ""
Inventory.PickupSound "BHBall2/Explode"
-INVENTORY.ALWAYSPICKUP
+INVENTORY.AUTOACTIVATE
States{
Spawn:
    TNT1 A 2
stop
Pickup:
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
   TNT1 A 35
   TNT1 A 1 A_SetBlend("Black",0.9,150)
Stop
}}
This is the script "ACS_NamedExecute("NeutronGiver")", and it is really simple:

#library "NeutronExplosionEffect"
#include "zcommon.acs"

// ------------ Neutron Grenade
script "NeutronGiver" (void)
{
   delay(random(random(32,16),random(64,96)));
   GiveInventory("NeutronPower",1);
}

Tested just now, same situation. Not throwing the bomb no problem. Throwing him the nightmare begins.

The idea is like a missile from Russian Overkill, the Berta bomb which causes the monsters to beat themselves and then generate flames.
My is a bomb that effect plus a dangerous dark smoke area that damages and confuses the monsters, so as to be able to transform them, in rare cases, into friends.

If i remove this line "A_RadiusGive("NeutronPower",128,RGF_MONSTERS|RGF_CORPSES|RGF_NOMASTER,1); all will work fine but the idea of the bomb become useless.
And now the real problem: how to fix it?
Last edited by Arch-vile90 on Thu Jul 12, 2018 4:15 pm, edited 1 time in total.
User avatar
Arch-vile90
Do you poba? if yes, you're welcome!
 
Joined: 01 Jul 2014
Location: Italy, the place of pizza

Next

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests