[r666]Aimmode 4 not fixing projectile ownership

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [r666]Aimmode 4 not fixing projectile ownership

Re: [r666]Aimmode 4 not fixing projectile ownership

by Graf Zahl » Sat Jul 05, 2008 2:01 am

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.

Re: [r666]Aimmode 4 not fixing projectile ownership

by Amuscaria » Wed Jul 02, 2008 1:08 pm

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

Re: [r666]Aimmode 4 not fixing projectile ownership

by Ghastly » Wed May 14, 2008 9:23 am

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.

Re: [r666]Aimmode 4 not fixing projectile ownership

by Thomas » Tue May 13, 2008 3:47 am

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.

Re: [r666]Aimmode 4 not fixing projectile ownership

by Ghastly » Mon Apr 28, 2008 12:13 pm

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].

Re: [r666]Aimmode 4 not fixing projectile ownership

by StrikerMan780 » Mon Apr 28, 2008 11:03 am

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.

Re: [r666]Aimmode 4 not fixing projectile ownership

by Graf Zahl » Sat Mar 29, 2008 3:42 am

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.

Re: [r666]Aimmode 4 not fixing projectile ownership

by Thomas » Fri Mar 28, 2008 4:51 pm

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

Re: [r666]Aimmode 4 not fixing projectile ownership

by Graf Zahl » Sat Jan 19, 2008 3:57 am

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.

Re: [r666]Aimmode 4 not fixing projectile ownership

by MartinHowe » Sat Jan 19, 2008 3:24 am

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 :)

Re: [r666]Aimmode 4 not fixing projectile ownership

by Graf Zahl » Sat Jan 19, 2008 3:04 am

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.

Re: [r666]Aimmode 4 not fixing projectile ownership

by MartinHowe » Sat Jan 19, 2008 2:34 am

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.

[r666]Aimmode 4 not fixing projectile ownership

by Ghastly » Fri Jan 18, 2008 4:09 pm

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.

Top