Damage inflicted by speed, not height

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

Damage inflicted by speed, not height

by voxelproof » Post

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?
To miss the joy is to miss all. Robert Louis Stevenson

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

Re: Damage inflicted by speed, not height

by warpnarget » Post

i agree

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

Re: Damage inflicted by speed, not height

by CalebJ » Post

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!

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

Re: Damage inflicted by speed, not height

by paramat » Post

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: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: Damage inflicted by speed, not height

by Festus1965 » Post

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 ?
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

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

Re: Damage inflicted by speed, not height

by rubenwardy » Post

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

Re: Damage inflicted by speed, not height

by Hume2 » Post

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: 577
Joined: Sun Apr 01, 2018 10:46

Re: Damage inflicted by speed, not height

by Astrobe » Post

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: 710
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: Damage inflicted by speed, not height

by Hume2 » Post

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: 1087
Joined: Sat Aug 05, 2017 08:13
Location: Europe

Re: Damage inflicted by speed, not height

by voxelproof » Post

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 :)
To miss the joy is to miss all. Robert Louis Stevenson

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

Re: Damage inflicted by speed, not height

by paramat » Post

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: 1087
Joined: Sat Aug 05, 2017 08:13
Location: Europe

Re: Damage inflicted by speed, not height

by voxelproof » Post

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.
To miss the joy is to miss all. Robert Louis Stevenson


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

Re: Damage inflicted by speed, not height

by Astrobe » Post

Thinking about it, also related: collision detection callback.

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

Re: Damage inflicted by speed, not height

by sorcerykid » Post

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.

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

Re: Damage inflicted by speed, not height

by voxelproof » Post

sorcerykid wrote:
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. :)

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.
It would be fantastic. Thanks for your interest.
To miss the joy is to miss all. Robert Louis Stevenson

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

Re: Damage inflicted by speed, not height

by sorcerykid » Post

Thanks voxelproof! I actually have a PR already opened for this feature :)

https://github.com/minetest/minetest/pull/9717

A fully working proof of concept is my my Mobs Lite mod which uses the move_result and old_vel to calculate fall damage, so it would be very easy to generalize that for speed damage.

https://github.com/sorcerykid/mobs/blob ... .lua#L1265

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests