[r666]Aimmode 4 not fixing projectile ownership

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
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

[r666]Aimmode 4 not fixing projectile ownership

Post by Ghastly »

While working on that anti-matter bomb powerup, I noticed those seconary waves were giving the 'player died' obituary, rather than the 'player killed himself'. I'm using aim mode 4 with A_CustomMissile, so this shouldn't be happening. One of my monsters also had this problem (fired a rocket that created another rocket, but the second one went for the monster, rather than the player) and both the primary and secondary missiles were spawned with aim mode 4.

If I recall, The Hellforge Cannon from Demon Eclipse has this same problem. Here's the wad I found this with (it's a work in progress, I'm using a few things from a Q2 expansion pack for it :wink:): http://www.zshare.net/download/66508198fc9472/.

I tested this in GZDoom 1.0.30 and Skulltag 97d beta 4.3, I can't find the page with the latest ZDoom revision to test this in.

Edit: Oh, I forgot to mention. Hit 'give antimatterbombpickup' in the console, then use it like any other stored inventory item. I fixed up the A_Explode so it's not supposed to hurt the shooter, too, so that's one more indication that it isn't working.
User avatar
MartinHowe
Posts: 2062
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by MartinHowe »

Shot ownership is a bit clunky in Doom anyway - the "target" field of a projectile is used to hold the shooter, for example; so what do you do if an actor needs to target other things and who fired it? Note that master/minion is not applicable here, or at least may not be in all cases.

What is needed is a true "who fired me" field that is guaranteed to be passed right down the chain; for example: a hitscan weapon for which each puff pawns a projectile that fires another hitscan attack and the final puff uses a radius attack with "don't hurt shooter" doesn't work, though logically it should; instead the player gets hurt. This would involve modifications to several of the engine's internal codepointers (P_*) and possibly to the various iterator callbacks as well.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49226
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by Graf Zahl »

True, but I fear this will eventually become necessary to separate the 2 meanings of the target field. The tricky part is to catch the side effects that have been abused by DECORATE.
User avatar
MartinHowe
Posts: 2062
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by MartinHowe »

Graf Zahl wrote:The tricky part is to catch the side effects that have been abused by DECORATE.
Including by me because there's no "neutral monster" flag :) I have given some thought to this while fiddling with my experimental builds of ZDoom; for DECORATE, I'd make a REALSHOOTER flag which would be off by default and if not set the engine would use the old behaviour; for DoomScript - well only you and "the great one" know about that :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49226
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by Graf Zahl »

If you implement this as a flag It'll be dumped and forgotten. I think this needs a real and complete and stable fix.

When the SVN is online again I'll think about this issue and its DECORATE related problems. But IMO this should be resolved completely before Doomscript becomes a reality. It's one of the biggest messes that plague the engine.

I think when all is done I'll deprecate all current missile firing functions and define a new, stable one.
Thomas
Posts: 53
Joined: Wed May 30, 2007 2:13 pm
Location: The Netherlands

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by Thomas »

I gave this a try the past day, and I actually managed to get somewhere. I am not sure if this is the way Graf wanted it, but at least the proper owner of the missiles/bulletpuffs are given. I am not sure how complete this is, but at least I get the right obituaries now. Even when I do: Hitscanattack -> bulletpuff -> rocket -> rocket -> rocket -> kills player. I get 'Player killed himself', instead of player died. To get the actual owner of the bulletpuff I had to add an extra parameter to 'P_SpawnPuff', so that the source of the puff is also passed to it.

I attached the patch to my post.

Hope you like it :) .
Attachments
ownership_fix.rar
(3.07 KiB) Downloaded 71 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49226
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by Graf Zahl »

Sorry, for compatibility reasons that's not the way to do it. Ownership tracking must only be active if explicitly requested by the spawning code. Otherwise it will pretty much break everything that depends on the current behavior.

Furthermore, if you add new variables to AActor, they must be serialized or savegames won't work properly anymore.
User avatar
StrikerMan780
Posts: 486
Joined: Tue Nov 29, 2005 2:15 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by StrikerMan780 »

Bump...

Any progress on this? It would be nice to have Hitscan puffs to take proper ownership. I have a weapon that fires hitscans, namely, the Noisy Cricket from Men In Black, in which the "Puff" is a massive explosion that causes ridiculous amounts of damage to the surrounding area, but, the problem is, I can damage and kill teammates in an Online game, in modes like COOP and other team-based modes, not to mention, in DM, I don't gain frags for my kills, instead, others get suicides.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by Ghastly »

Sounds like Thomas (or Graf or Randy :P) just needs to modify his fix for it. The fix works, but it just needs to be bound to aimmode 4+, and the new variables in AActor need to be serialized[/GrafParaphrase].
Thomas
Posts: 53
Joined: Wed May 30, 2007 2:13 pm
Location: The Netherlands

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by Thomas »

I already serialized the new AActor variable. But I am still unshure of how to implement this right. As Graf said, this can't just be the new behaviour for aimmode 4, because it would break wads that rely on the current behaviour. The best way of implementing this now (at least temporary till a better way may pop up) would be a flag IMO. Allthough it could be forgotten, I can still see a bunch of people that would use the flag to get the right behaviour they want.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by Ghastly »

ZDoom Wiki wrote:Please note that A_CustomMissile had a bug in ZDoom versions 2.0.x which resulted in improper ownership for the spawned missiles if they were spawned by other missiles. This bug can not be fixed without breaking existing definitions. To allow proper ownership a flag has been added to the aimmode parameter. If 4 is added the missiles owner will be assigned properly.
The problem is that 4 isn't assigning the owner like the wiki says it's supposed to. If people want the original behaviour, then they wouldn't add 4 to the aimmode.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by Amuscaria »

Ghastly_dragon wrote:
ZDoom Wiki wrote:Please note that A_CustomMissile had a bug in ZDoom versions 2.0.x which resulted in improper ownership for the spawned missiles if they were spawned by other missiles. This bug can not be fixed without breaking existing definitions. To allow proper ownership a flag has been added to the aimmode parameter. If 4 is added the missiles owner will be assigned properly.
The problem is that 4 isn't assigning the owner like the wiki says it's supposed to. If people want the original behaviour, then they wouldn't add 4 to the aimmode.
Second
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49226
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [r666]Aimmode 4 not fixing projectile ownership

Post by Graf Zahl »

Sometimes I'd really appreciate better bug descriptions. The flag as it is works fine.

The only problem with A_CustomMissile I could discover was that a missile that was exploded immediately when spawned didn't get its owner set because A_CustomMissile never got its address.

And I only found this problem because I made an error when defining the test missile so that's why you had to wait for half a year to get this fixed.
Post Reply

Return to “Closed Bugs [GZDoom]”