Skip to content

Fall damage handling moved to FormulaHelper - #2803

Open
RedRoryOTheGlen wants to merge 2 commits into
Interkarma:masterfrom
RedRoryOTheGlen:FallDamageFormula
Open

RedRoryOTheGlen wants to merge 2 commits into
Interkarma:masterfrom
RedRoryOTheGlen:FallDamageFormula

Conversation

@RedRoryOTheGlen

@RedRoryOTheGlen RedRoryOTheGlen commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Unified the disparate ways that fall damage is calculated between PlayerHealth and EnemyMotor into an overridable formula.

For players, the formula by default can now directly reflect the value of fallingDamageThreshold set in AcrobatMotor instead of using its own const variable.

For enemies, EnemyMotor now has a public fallingDamageThreshold property that can be set by mods if necessary.

The intention is to maintain the current behavior but open up fall damage mechanics to modding, making it possible to have skills or spell effects be able to reduce fall damage or increase the distance to fall before taking damage, or even have enemies that can be resistant to fall damage (eg, Acrobats, spiders, etc).

Example used to test overriding the formula:

image image

This example also showcases the formula allowing for different handling of fall damage between players and NPCs (or even specific NPCs) if required.

@petchema

petchema commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Current formula for player that uses threshold and damage per falling height unit is the result of my experimentation, falling from different heights, carrying more or less loot, etc. But it assumes you start with no vertical velocity, so that the energy of the impact is only potential energy basically, so proportional to height difference between where you left ground and where you landed; Which may be inaccurate at times (say if you jumped, or were somehow thrown), and cannot replicate correctly some classic behavior, like player taking damage if (s)he stops moving abruptly, like teleporting or, I think, casting levitation.
So a formula based on mass and speed change could be interesting, if speed can be measured/interpolated accurately enough, which was one of my concerns. We may want to better match some classic behaviors too, like taking damage when falling from high enough into water.
And since the threshold is actually linked to "victim" resilience and flexibility, maybe an energy threshold would be less implementation-specific that a height threshold?
My point is, TL;DR taking as parameters an height threshold and a height may not be generic enough if you want to get crazy about fall damage implementation, or we want to fix discrepancies with classic in the future without breaking mods compatibility.
PS maybe some of those difficulties could be lifted if both player and enemies entities exposed common properties (their mass, their current absolute movement speed, their landing energy threshold,...)

@RedRoryOTheGlen

Copy link
Copy Markdown
Contributor Author

I think having access to the Entity should be sufficient. For enemies, there's already a formula to get their "weight" and we can pass the DaggerfallEntity as EnemyEntity if needed. A similar formula for PlayerEntity could help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants