[3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPITCH

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: [3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPITCH

Re: [3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPI

by Hexereticdoom » Wed Mar 06, 2019 7:30 pm

Rightly, I already noticed a few days ago something weird using 3.7.2 version with my Doom and Heretic gameplay mods... Some special effects were working wrongly, and also some monster attack patterns were unexpectedly being performed in an inverse way, specially when the player is at a different height than the attacker.

So then, while 3.7.3 is on the way, I think the best thing will be to make myself a hotfix update for both mods, replacing the old deprecated function with the newer A_SpawnProjectile to avoid more related issues... :|

Edit: Sorry, forget it. Too much work and too much testing needed, and if next release of GZDoom is going to have restored the A_CustomMissile's old pitch behaviour, I prefer better to wait until then. :nope:

Re: [3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPI

by Graf Zahl » Sun Jan 27, 2019 12:10 pm

Not really. This was the first one that applies to 3.7.2 as well.
But I consider this a big one.

Re: [3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPI

by Kinsie » Sun Jan 27, 2019 11:12 am

Graf Zahl wrote:Question: Does this warrant a new release? It's a pretty serious bug in my opinion.
There's two other ones I'd like to check out first, but after that I think 3.7.3 needs to be done.
There have been enough big bug fixes recently that another bug-fix release is probably warranted.

Re: [3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPI

by Graf Zahl » Sun Jan 27, 2019 7:07 am

Ugh, this was a bit tricky to investigate.
This was a bit tricky to investigate, but I think I got it figured out now.

The original fix was about the inverted base pitch in A_CustomMissile. When that got fixed, A_SpawnProjectile got accidentally its offset pitch inverted because the factor was applied in the wrong place.
Now that the offset pitch got corrected, A_CustomMissile suddenly had the combined pitch wrong because the workaround now negated something it shouldn't have.

I solved it by completely separating both code paths. A_CustomMissile now uses the exact same code as it did in 2016 and A_SpawnProjectile uses the correct formula - at least I hope it does. This pitch-sign madness is giving me headaches because ZDoom's coordinate system makes no sense.

Question: Does this warrant a new release? It's a pretty serious bug in my opinion.
There's two other ones I'd like to check out first, but after that I think 3.7.3 needs to be done.

Re: [3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPI

by Graf Zahl » Sun Jan 27, 2019 6:09 am

Yeah, that can be done. Ironically that's how it was supposed to be done initially, but the fix somehow got messed up and implemented incorrectly.

EDIT: Looking at that piece of code, something must have gone horribly wrong at some point in time. The math makes no sense whatsoever, my guess is that some bug got introduced during floatification of the engine and all the attempts to fix it made things worse. :(

Re: [3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPI

by Kinsie » Sun Jan 27, 2019 5:46 am

A_CustomMissile is depreciated, isn't it? I'd say revert it to the older behaviour to avoid breaking older/Zandronum-based mods, and continue shepherding new mods towards using A_SpawnProjectile instead.

Re: [3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPI

by Graf Zahl » Sun Jan 27, 2019 1:56 am

Yes, this was reversed, because it used the wrong sign. Instead of offsetting from the actual pitch it offsetted from the inverse pitch.
Amazing that some mod managed to get something working out of that broken option.

The big problem with this one is that there is no good solution. It can either break a handful of mods using it or be forever broken with new code.

[3.7.2] A_CustomMissile reverses pitch with CMF_OFFSETPITCH

by Melodica » Sat Jan 26, 2019 10:37 pm

I've encountered this problem while playing Space Hunter. if A_CustomMissile uses the CMF_OFFSETPITCH flag, it will reverse the pitch of the projectile, causing, for example, actors to aim downwards instead of upwards when firing at their target and vice versa. Made a quick test wad, and it confirms this. It only seems to affect the function when CMF_OFFSETPITCH is used. I've attached the wad file I made to test it out. Each time the actor fires a projectile, it will log "CMF_OFFSETPITCH" if it uses the flag, and "no flags" if it doesn't. I tested this file on 3.7.1, and the problem doesn't exist there.
Attachments
a_custommissile-CMF_OFFSETPITCH-test.wad
(10.08 KiB) Downloaded 36 times

Top