Research:Movement

From OpenMW Wiki
Revision as of 17:08, 3 September 2012 by Hrnchamd (talk | contribs) (Added acrobatics. Migrated from Formulae page, with cleanup.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Acrobatics

Actions affected On jumping and landing
Description Uses common term fatigueTerm.
Implementation status
Analysis status Initial velocity verified; requires testing in combination with physics system

On jumping

encumbranceTerm = fJumpEncumbranceBase + fJumpEncumbranceMultiplier * (1 - normalizedEncumbrance)
where normalizedEncumbrance is a function of encumbrance. empty bar -> 0.0, full bar -> 1.0

if acrobaticsSkill <= 50:
    a = acrobaticsSkill, b = 0
else:
    a = 50, b = acrobaticsSkill - 50

x = fJumpAcrobaticsBase + pow(a / 15.0, fJumpAcroMultiplier)
x += 3 * b * fJumpAcroMultiplier
x += jumpSpellBonus * 64
x *= encumbranceTerm
if actor is running: x *= fJumpRunMultiplier
x *= fatigueTerm
x -= gravityAcceleration [constant; -627.2 exactly]
x /= 3

if actor is standing still:
    set kinematic velocity to {0, 0, x}

if actor is moving:
    groundVelocity = normalize({actorVelocity.x, actorVelocity.y})
    set kinematic velocity to 0.707 * x * {groundVelocity.x, groundVelocity.y, 1.0}

decrease fatigue by fFatigueJumpBase + (1 - normalizedEncumbrance) * fFatigueJumpMult


On landing

fallingDist = distance from peak height

if fallingDist <= fFallDamageDistanceMin: soft landing; skip the rest of the function

x = fallingDist - fFallDamageDistanceMin
x -= 1.5 * acrobaticsSkill + jumpSpellBonus
x = max(0, x)

a = fFallAcroBase + fFallAcroMult * (100 - acrobaticsSkill)
x = fFallDistanceBase + fFallDistanceMult * x
x *= a

if x > 0: damage health by x * (1 - 0.25 * fatigueTerm)

if acrobaticsSkill * fatigueTerm < x: actor falls over

if actor is not incapacitated: acrobatics skill exercised (skill gain from fall damage)


Comments

Note that initial actor velocity is taken into account. Animation-driven kinematics mean the jump direction can be offset from the player facing if there is root bone movement. Agility does not appear to be involved in this calculation.