Per-player fall damage in next version

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

Per-player fall damage in next version

by Wuzzy » Post

There's an addition coming to the next version (presumably 5.5.0) that is long overdue: Per-player fall damage.
As of 5.4.1, fall damage is hardcoded and forced on all players and there was no clean way to get rid of it.
But in the next version, games and mods can disable or modify fall damage on a per-player basis.

Technically, this is done by setting an armor group “fall_damage_add_percent” for the player. With this, the fall damage can be disabled or increased or decreased by a given percentage.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: Per-player fall damage in next version

by PolySaken » Post

how does this stack with a node's damage multiplier? does it affect the resulting value from that (or vice versa) or does it do something else, like taking a percentage of the default using each and combining them?
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

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

Re: Per-player fall damage in next version

by Wuzzy » Post

Basically, the effective fall damage percentages of both node and player are multiplied. The effective fall damage is 100% - fall_damage_add_percent%.
Now what happens when a player with modified fall damage falls on a node with modified fall damage? To answer this, let's look what is done internally: The raw group value is converted to a fall damage factor via the formula 1+1*(value/100). So the group value 0 gives the factor 1.0, the value 100 gives a factor of 2, and the value -50 gives a factor of 0.5, etc.

This is done both for the node and the player, and the final step is simply multiplying both fall damage factors.

For example, if you have a player with fall_damage_add_percent=123 falling on a node with fall_damage_add_percent=-45, this results in the factors 1.23 and 0.55. Multiply both together, and you get a fall damage factor of 0.67, or 67%.

This also implies that if either factor is 0, fall damage is guaranteed to be 0.

Post Reply

Who is online

Users browsing this forum: Astrobe and 5 guests