DMG_TEST for DamageMobj

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 ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: DMG_TEST for DamageMobj

Re: DMG_TEST for DamageMobj

by Accensus » Sat Oct 15, 2022 1:38 am

I was afraid of that. Hopefully it's feasible down the line and not completely out of the question because refactoring DamageMobj seems like a good idea. A lot of calculations regarding damage are located in there so selectively modifying behaviour mod-side is a pain in the ass. Probably one of the most crammed parts of the engine from what I can see. That and AActor::Tick(). 500 LOC functions seem kinda smelly.

Re: DMG_TEST for DamageMobj

by Graf Zahl » Sat Oct 15, 2022 1:21 am

This would require quite a bit of refactoring because DamageMobj is doing lots of stuff aside from calculating the damage - and it's not really doing things in an intuitive order.

DMG_TEST for DamageMobj

by Accensus » Fri Oct 14, 2022 6:48 pm

Following the train of thought here, the idea behind DMG_TEST (or DMG_NODAMAGE, whatever works) is to call Super.DamageMobj to get the final damage without doing any real health reduction. This way I can operate on the value after it's been modified by factors and whatnot, and use it in calculations separately from the damage argument, which is the raw value and often times useless to work with in my case. I can't assign the return of Super.DamageMobj to a variable and work with that because by that point it's already too late and the damage has already been dealt.

Top