SelfDamageFactor

Moderator: GZDoom Developers

Post Reply
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

SelfDamageFactor

Post by Arctangent »

I'd like it if the was the option for an actor to take modified damage from its own sources, whether linked to a damage type akin to DamageFactor or hooked into A_Explode, since that seems like the only way for an actor to actually damage itself while still being able to be the source of it.

The first use that comes to mind and my primary purpose is allowing explosive weapons to explode their users less than their targets, making point-blank blasts less lethal and explosive jumping less dumb. The opposite being done I could see also getting some use, punishing careless players with increased blowback damage.

The reason why just a standard DamageFactor is not enough is because other players' weapons would also be affected, which is what I'm trying to avoid.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: SelfDamageFactor

Post by Graf Zahl »

For explosive damage such a property already exists (RadiusDamageFactor).
For other things it's probably not so useful, considering that you can't easily damage yourself with projectiles and hitscans.
User avatar
NeuralStunner
 
 
Posts: 12326
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: SelfDamageFactor

Post by NeuralStunner »

Graf Zahl wrote:For explosive damage such a property already exists (RadiusDamageFactor).
Doesn't this apply to all radius damage, not just one's own?
User avatar
Rowsol
Posts: 947
Joined: Wed Mar 06, 2013 5:31 am
Contact:

Re: SelfDamageFactor

Post by Rowsol »

This would be useful.
User avatar
GhostKillahZero
Posts: 742
Joined: Wed Nov 13, 2013 4:41 pm
Location: 343 Industries Headquarters
Contact:

Re: SelfDamageFactor

Post by GhostKillahZero »

Rowsol wrote:This would be useful.
Really? In what way would this be useful? [wiki]A_Explode[/wiki] and falling damage might be the only two factors that you can damage yourself, I'd say no to this one.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: SelfDamageFactor

Post by Arctangent »

GhostKillahZero wrote:
Rowsol wrote:This would be useful.
Really? In what way would this be useful? [wiki]A_Explode[/wiki] and falling damage might be the only two factors that you can damage yourself, I'd say no to this one.
Well, I did specifically mention its use in A_Explode, and one of the ways I thought it could be implemented would be as a parameter to that. Currently the only mitigation to it is all or nothing, plus the nothing option doesn't allow explosion jumping and such. I imagine it's because setting hurtshooter to false excludes the firer from the explosion calculations entirely, rather than just nullifying the damage.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: SelfDamageFactor

Post by Xaser »

There's no workaround that covers exactly what this property is suggesting, since the primary draw of this would be (as stated in the OP) damagetype-independent resistance to one's own explosive attacks that doesn't affect any other targets.

Even though MUHMUHFLUH isn't a multiplayer-focused port (though it's making strides), the clearest illustration would be a rocket launcher that's meant to deal reduced damage to self but full damage to other players in deathmatch. Right now, either you can completely negate the damage with XF_HURTSOURCE turned off, or offer all players explosive resistance; you can't do something like make the shooter take quarter-damage and the rest of the players take full.

IMO, though, the most fitting way to implement this is on projectiles (probably renamed to ShooterDamageFactor or somesuch since the definition "self" breaks down) or (probably better) as an additional A_Explode parameter. As mentioned, the only other "self damage" concept (that I can think of) is falling damage, which can already be adjusted with DamageFactor. Putting the new feature on the projectile or function call offers maximum flexibility.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: SelfDamageFactor

Post by Arctangent »

As an aside, I'm not even sure if falling damage is sourced by the inflictee. It wouldn't surprise me if it's dealt by the world, like sector damage.
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: SelfDamageFactor

Post by edward850 »

It's handled by the player themselves. It's treated as a suicide condition.
User avatar
Rowsol
Posts: 947
Joined: Wed Mar 06, 2013 5:31 am
Contact:

Re: SelfDamageFactor

Post by Rowsol »

Yea, the XF_HURTSOURCE part of A_Explode could just allow for other numbers between 0 and 1 to accomplish this effect.
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: SelfDamageFactor

Post by edward850 »

That's not how bit flags work.
Last edited by edward850 on Sat Feb 07, 2015 10:38 pm, edited 1 time in total.
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: SelfDamageFactor

Post by edward850 »

That's not how flags work.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: SelfDamageFactor

Post by Graf Zahl »

added
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”