Damage per distance

Moderator: GZDoom Developers

User avatar
Spottswoode
Posts: 18
Joined: Tue Jan 17, 2012 8:41 pm

Damage per distance

Post by Spottswoode »

I suggest a weapon or projectile actor property that increases damage by n factor for every x distance. The general idea is to simulate more realistic ballistics damage from very long distances. It would look something like this,

DamageForce (2, 100) (factor, distance)

Meaning that for every 100 distance it traveled the damage would increase by 2x. Basically at a very long range the weapon or projectile would instakill many monsters and players but would substantially weaker at point blank range.
Conversely,
DamageForce (.5, 100)
This would cut the damage in half for every 100 distance the projectile travelled. Thus the weapon would be devastating at close range but do very little at mid to long range.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Damage per distance

Post by XutaWoo »

I think time would be a better modifier than distance.

Also, it should just be DamageForce 2, 100 or DamageForce .5, 100. Parenthesis imply imply it's one value, although without much meaning considering there's nothing using the two numbers.
User avatar
Spottswoode
Posts: 18
Joined: Tue Jan 17, 2012 8:41 pm

Re: Damage per distance

Post by Spottswoode »

No, time is not a better modifier than distance because it cannot take projectile speed into account. Many weapons (like a custom railgun for instance) with high speeds would die before it could take effect. Velocity, in the formula for stopping power (MV)^2, implies speed with direction.
Time is probably more feasible than distance in programming, it is not a better descriptor under any realistic circumstance.

And on a much less important side note, technically it would be one value in physics.
Gez
 
 
Posts: 17942
Joined: Fri Jul 06, 2007 3:22 pm

Re: Damage per distance

Post by Gez »

Okay, why is it realistic that ballistic projectiles (i.e., not self-propelling objects) acquire more energy over distance? This seems highly counter-intuitive and I'd like to have an explanation for the physics involved.
User avatar
ChronoSeth
Posts: 1631
Joined: Mon Jul 05, 2010 2:04 pm
Location: British Columbia

Re: Damage per distance

Post by ChronoSeth »

Gravity?
I don't know. But this is Doom. When has physics ever made sense within it?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Damage per distance

Post by Graf Zahl »

Gez wrote:Okay, why is it realistic that ballistic projectiles (i.e., not self-propelling objects) acquire more energy over distance? This seems highly counter-intuitive and I'd like to have an explanation for the physics involved.


Physically it's nonsense, plain and simple.

It's also not quite as easy to implement as it is written here and considering the limited appeal of something this weird, I take the easy solution...
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Damage per distance

Post by Edward-san »

ChronoSeth wrote:Gravity?
:nitpick:
Only in a planet without air and if you're shooting from higher z to lower z position (gravity is a conservative force btw).

Otherwise (still in the planet) ... air resistance, air resistance ... it will slow every projectile to a certain speed, which depends on the mass of the projectile and the air composition, because it compensates the gravity force.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Damage per distance

Post by NeuralStunner »

Heh, "more realistic".
Spottswoode wrote:No, time is not a better modifier than distance because it cannot take projectile speed into account.
Game logic runs per tic. Projectiles move Speed units per game tic. Unless your projectile speed is non-constant (due to in-state velocity modification), Distance = Speed * Lifetime-Tics. Even with varying velocity you can still add up travel distance each tic.

You can factor up current absolute velocity, and add/subtract to a user variable. ([wiki]Decorate Expressions[/wiki] and [wiki]A_SetUserVar[/wiki] will help you here.) Then, [wiki]A_Explode[/wiki] can be used to deal the actual damage, with the modified damage value passed to it. (The projectile itself can be set to (0) damage.)
User avatar
ChronoSeth
Posts: 1631
Joined: Mon Jul 05, 2010 2:04 pm
Location: British Columbia

Re: Damage per distance

Post by ChronoSeth »

Edward-san wrote:
ChronoSeth wrote:Gravity?
:nitpick:
Only in a planet without air and if you're shooting from higher z to lower z position (gravity is a conservative force btw).

Otherwise (still in the planet) ... air resistance, air resistance ... it will slow every projectile to a certain speed, which depends on the mass of the projectile and the air composition, because it compensates the gravity force.
Refer to the second line of my post. :P
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Damage per distance

Post by Edward-san »

ChronoSeth wrote: Refer to the second line of my post. :P
ChronoSeth wrote:When has physics ever made sense within it?
Obviously Doom physics never made sense, but it doesn't mean zdoom should implement more nonsense physics properties (though I'd like to ask devs if in these years of development there are some of these).
User avatar
Spottswoode
Posts: 18
Joined: Tue Jan 17, 2012 8:41 pm

Re: Damage per distance

Post by Spottswoode »

Graf Zahl wrote:
Gez wrote:Okay, why is it realistic that ballistic projectiles (i.e., not self-propelling objects) acquire more energy over distance? This seems highly counter-intuitive and I'd like to have an explanation for the physics involved.


Physically it's nonsense, plain and simple.

It's also not quite as easy to implement as it is written here and considering the limited appeal of something this weird, I take the easy solution...
Hmm..no. It's real simple. Long range bullets (.408 Chey Tac for example) are fired in a parabolic trajectory to hit a target around the curvature of the earth with maximum impact. Wind speed, air temperature, and variable humidity also affect bullet trajectory. At 1 mile (or 1760 yards) a bullet travelling at close to Mach 3 generates enough energy to blow a human apart via hydrostatic shock. My example is a SIMPLIFICATION of said physics, as 1 mile in range is completely infeasible in map design with the current standards. Is my example a gross oversimplification? Absolutely. But as stated above, it's Doom and this was just a fleeting suggestion. I was well aware of the goofiness and odds of such a suggestion.
Oh yes, I also said time was more feasible than distance in programming. It's just not better for more accurate simulation.
Just something to think about. Christ. :|
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Damage per distance

Post by XutaWoo »

...I'd still like easy damage falloff or rampup over time, considering how much hell it is to modifiy a projectile's damage. :P
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Damage per distance

Post by wildweasel »

Gez wrote:Okay, why is it realistic that ballistic projectiles (i.e., not self-propelling objects) acquire more energy over distance? This seems highly counter-intuitive and I'd like to have an explanation for the physics involved.
I've been told that the Gyrojet is a real-world gun whose projectile accelerates the longer it is in flight, thus theoretically doing more damage if it flies farther.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Damage per distance

Post by Xaser »

XutaWoo wrote:...I'd still like easy damage falloff or rampup over time, considering how much hell it is to modifiy a projectile's damage. :P
Why not suggest a feature to modify a projectile's damage value? That'd give all the flexibility one would really need.
User avatar
Spottswoode
Posts: 18
Joined: Tue Jan 17, 2012 8:41 pm

Re: Damage per distance

Post by Spottswoode »

Hmm..that would be considerably more flexible if it were an actor state or state change. It still doesn't fit quite the purpose I had in mind, but it could be worked around to some degree. I would really want to apply it to a railgun though.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”