Cumulative damage for pain and gibbed death

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Cumulative damage for pain and gibbed death

Postby Kzer-Za » Tue Feb 12, 2019 5:29 am

As far as I can tell, PainThreshold and gibbing do not take into account the cumulative damage from several pellets that hit a moster within one tic. Is it possible to introduce (probably, as an option in gameplay section for those who don't want it) the feature where all damage received within one tic, after taking into account damagefactors and such, would be taken into account when calculating whether it would "pierce" the painthreshold and whether the object will be gibbed?
Kzer-Za
 
Joined: 20 Aug 2017

Re: Cumulative damage for pain and gibbed death

Postby Graf Zahl » Tue Feb 12, 2019 5:53 am

This is far, far from trivial because it requires quite a bit of maintenance overhead.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Cumulative damage for pain and gibbed death

Postby Rachael » Tue Feb 12, 2019 9:13 am

If this is done anywhere, I think it should be done strictly ZScript side.

Is it possible to track the amount of damage done to an object if you set the +NODAMAGE flag on it?

If so - this would be a lot easier. Basically, you would set the flag in order to prevent GZDoom from processing the actor, and then run a tally of all the damage done in the current tic, along with keeping track of the inflictor. It would then retroactively apply that damage in the next tic, reusing the inflictors who did it.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Cumulative damage for pain and gibbed death

Postby Graf Zahl » Tue Feb 12, 2019 9:50 am

+NODAMAGE calls the pain code. The entire point here is to do that without inflicting real damage.
The only real way to do this is to decouple the pain code from the damage code, and frankly, that's not going to happen, because too much depends on it. There is simply insufficient abstraction here.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Cumulative damage for pain and gibbed death

Postby Major Cooke » Tue Feb 12, 2019 11:16 am

I was about to suggest WorldThingDamaged but since that isn't called for < 1 damage, that does put a small hindrance in my idea. Perhaps an actor flag for monsters that would call it regardless when damaged would suffice. Then Kzer could utilize that to determine what happens to the monster - if that flags even needed. Then this for sure could be kept on the ZScript side.

However, if you don't need to take into account when damage is 0, then you could simply give an inventory item each time WorldThingDamaged is called to e.Thing.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Cumulative damage for pain and gibbed death

Postby Matt » Wed Feb 13, 2019 6:50 pm

The way I track this in HD is to have each bullet check for a specialized thinker that is targeting the victim, creating a new one if none already exists, and add its damage to that thinker's counter. Once that thinker expires (about 3-4 tics, I vaguely recall needing 2 to reliably get everything that I thought should have hit in the same tic), it does all the accumulated damage to the victim at once.

For a custom monster/player/target instead of a custom projectile, I can imagine something similar happening using the victim's DamageMobj where it never calls "super.damagemobj" unless the inflictor is that damage-aggregating actor (can't use a thinker in this case).
User avatar
Matt
Putting the XD into *xdeath since 2007
 
 
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest