Damage inflicted by speed, not height

User avatar
voxelproof
Member
 
Posts: 956
Joined: Sat Aug 05, 2017 08:13
Location: Europe

Damage inflicted by speed, not height

by voxelproof » Sat Dec 14, 2019 19:24

There is a stark incosistency in MT Game concerning the way a player's character takes damage. As far as I know, no matter how fast a player moves horizontally, hitting an obstacle in such movement causes no damage, while there's meticulously crafted mechanism for calculating damage due to falling from certain height. Wouldn't it make more sense if the damage was dependent solely on player's speed and not direction of movement?
Game is the essence of life; therefore every good game makes life better.
 

warpnarget
Member
 
Posts: 15
Joined: Sat Oct 12, 2019 21:34
In-game: warpnarget
 

CalebJ
Member
 
Posts: 203
Joined: Sat Dec 29, 2018 19:21
Location: Tunnelers' Abyss
GitHub: KaylebJay
IRC: KaylebJay
In-game: CalebJ

Re: Damage inflicted by speed, not height

by CalebJ » Sat Dec 14, 2019 23:00

No, this isn't completely true ... Momentum can inflict damage. Try dropping 20m, then try flying (with fast mode) 15m down and then quickly turn fly mode off (your momentum will propel you faster into the ground, inflicting much more damage).
However, for players without such priveledges (fast in particular), you are absolutely right. I'd like to see it implemented!
If you want realism, you're in the wrong place. Get off your mobile.
 

User avatar
paramat
Developer
 
Posts: 3528
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: Damage inflicted by speed, not height

by paramat » Sun Dec 15, 2019 00:23

One issue though is that anyone flying fast or using fast mode on the ground would very often die, when those special 'superpower' modes should not really cause damage.
However, if we disable horizontal damage in these 'fast' modes, then horizonatal damage would almost never occur because the player walks at 4 n/s, and i doubt that sprinting mods would cause a speed high enough to cause damage either.
So it seems this has not been done because there has not been much need for it yet.
Related https://github.com/minetest/minetest/issues/8051

Momentum is speed times mass. Because players all have the same mass we can refer to either speed or momentum, it does not matter.

Strictly, MT damage is caused by a rapid change to zero of the vertical component of velocity.
Last edited by paramat on Tue Dec 17, 2019 21:20, edited 2 times in total.
 

User avatar
Festus1965
Member
 
Posts: 1064
Joined: Sun Jan 03, 2016 11:58
Location: Thailand - Chiang Mai (+5-6h to MEZ)
In-game: Thomas Explorer

Re: Damage inflicted by speed, not height

by Festus1965 » Sun Dec 15, 2019 01:53

Thanks, you wrote it: for normal walk
Can a player run or fly WITH FAST or special like LavaBoots horizontal as fast he can fall ?
Server: still up, see some gamer - but there is a new 1st important thread "climate change" for me. Something I know since 1992 - had seen the melting glacier in Switzerland.
 

User avatar
rubenwardy
Moderator
 
Posts: 5948
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Damage inflicted by speed, not height

by rubenwardy » Sun Dec 15, 2019 14:15

Minetest already does this, but only on the vertical component. Fall damage comes from a change in velocity in the veritcal component in a particular direction
 

User avatar
Hume2
Member
 
Posts: 403
Joined: Tue Jun 19, 2018 08:24
Location: Czech Republic
GitHub: Hume2
In-game: Hume2

Re: Damage inflicted by speed, not height

by Hume2 » Sun Dec 15, 2019 15:17

The minimum height for falldamage is 6m, which corresponds to speed approx. 11m/s. The walk speed is 4 m/s. In default settings, only minetest_wadsprint and xtraores combined with sprint can make the player exceed 11km/h. However, running and falling at once could cause a bit more damage than just falling.
If you lack the reality, go on a trip or find a job.
 

Astrobe
Member
 
Posts: 274
Joined: Sun Apr 01, 2018 10:46

Re: Damage inflicted by speed, not height

by Astrobe » Sun Dec 15, 2019 15:43

Nitpick: damage should be a function of the kinetic energy, so momentum times speed, or mass times (speed squared).
That said, since fall acceleration does not depend on the mass of the object, MT doesn't currently have (AFAIK) a built-in notion of mass to begin with.
 

User avatar
Hume2
Member
 
Posts: 403
Joined: Tue Jun 19, 2018 08:24
Location: Czech Republic
GitHub: Hume2
In-game: Hume2

Re: Damage inflicted by speed, not height

by Hume2 » Mon Dec 16, 2019 07:12

Actually, assigning a mass to players and entities wouldn't be that bad. As I suggested here, the liquids can be assigned a density. That would make many mods with aquatic mobs far lighter. Currently, they have loads of if-clauses which check whether the mob is in water or isn't. If they had a mass, the engine would care itself.
If you lack the reality, go on a trip or find a job.
 

User avatar
voxelproof
Member
 
Posts: 956
Joined: Sat Aug 05, 2017 08:13
Location: Europe

Re: Damage inflicted by speed, not height

by voxelproof » Mon Dec 16, 2019 12:49

paramat wrote:One issue though is that anyone flying fast or using fast mode on the ground would very often die, when those special 'superpower' modes should not really cause damage.
However, if we disable horizontal damage in these 'fast' modes, then horizonatal damage would almost never occur because the player walks at 4 n/s, and i doubt that sprinting mods would cause a speed high enough to cause damage either.
So it seems this has not been done because there has not been much need for it yet.


Of course I'm aware that with no mods the basic game mechanics doesn't need it badly. However there are already quite a few good mods (including your 'drifting car') featuring different vehicles, like bike for the simplest example. Adding such mechanics in my opinion is much needed to provide more realistic and interesting interactions with the environment, otherwise using fast moving vehicles doesn't differ significantly from the different default modes of movement as far as needed caution is concerned and it makes it less interesting and, sometimes, even boring. To say nothing of the possibilities of applying such feature in mods like Advanced Trains, and last but not least, the educational aspect for the kids :)
Game is the essence of life; therefore every good game makes life better.
 

User avatar
paramat
Developer
 
Posts: 3528
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: Damage inflicted by speed, not height

by paramat » Tue Dec 17, 2019 21:29

To be clear, i am not rejecting the idea as not needed, just writing that it has not been much needed in the past.
Increasingly, this feature would be somewhat useful.

Player mass actually exists in the code as a player property, but is a constant and is unused.
 

User avatar
voxelproof
Member
 
Posts: 956
Joined: Sat Aug 05, 2017 08:13
Location: Europe

Re: Damage inflicted by speed, not height

by voxelproof » Wed Dec 18, 2019 12:09

paramat wrote:To be clear, i am not rejecting the idea as not needed, just writing that it has not been much needed in the past.
Increasingly, this feature would be somewhat useful.

Player mass actually exists in the code as a player property, but is a constant and is unused.


I really hope it will someday be implemented. It would open way for racing mods, and riding bike in the woods would be more engaging too. And players who don't want it should be able to disable it in the general settings.
Game is the essence of life; therefore every good game makes life better.
 

User avatar
Wuzzy
Member
 
Posts: 3732
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
 

Astrobe
Member
 
Posts: 274
Joined: Sun Apr 01, 2018 10:46

Re: Damage inflicted by speed, not height

by Astrobe » Sun Jan 12, 2020 11:43

Thinking about it, also related: collision detection callback.
 

User avatar
sorcerykid
Member
 
Posts: 1135
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: Damage inflicted by speed, not height

by sorcerykid » Wed Jan 15, 2020 21:46

Astrobe wrote:Thinking about it, also related: collision detection callback.


Entity collision detection entirely via callback in Minetest S3. :)

Image
Demonstration of Extended Motion Mechanics in Minetest S3
https://vimeo.com/316098852

The callback receives both old_vel and new_vel as well as the axis of collision, so it would be easy to inflict damage based on speed.

I will see about opening a PR and porting these API changes over to the official branch. It definitely makes coding mobs so much easier.
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 2 guests