1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ||
Editor: DonovanBaarda
Time: 2012/10/18 17:26:54 GMT-4 |
||
Note: |
changed: - The RealisticFatigue document was a bit too messy and Oblivion specific. This is an attempt to tidy and simplify it into something that can be used for other games. Basic Attributes ================ The following attributes are in the range 0.0 (empty) to 1.0 (full). Note that there can be underlying health,strength,endurance attributes that translate these into different numbers, but from the fatigue models point of view, the only thing that matters is the fraction of full health/stamina/encumbrance:: H - health, fraction of full health. S - stamina, fraction of full stamina. E - encumbrance, fraction of max lift. The following constants adjust how quickly you get tired and recover. They a nominally constants but could be tweaked per-character based on some endurance attribute:: F - stamina burn rate, stamina/second R - stamina recovery rate, stamina/second Note that R/(F+R) is the "steady state" or minimum S value reached for constant activity, so the the R/F ratio is important. Studies show F is 0.008~0.033, R is 0.0026~0.013, and F/R is 0.3~0.5, so F=0.03, R=0.01, for F/R = 1/3 is realistic, and gives an average fatigue recovery rate of 0.5%/sec. However for gameplay reasons F=0.1, R=0. Recovery ======== This is how stamina recovers constantly in the background:: dS = R * (1.0 - S) * dt Wounds ====== Wounds are modelled as damaged muscles, thus reducing your available un-fatigued muscles, or S. It applies a constant "drain" or cap on your stamina:: Smax = H^(1/Kh) Where Kh=2 but can be tuned up to delay the onset of wound effects. Note RF uses Smax=1-(1-H)^Kh, which compared to the above makes drains less for small injuries, but more for big ones, making it harder to "turn the tables" in combat. When you are attacked or healed and your health changes, it damages/restores some of both fatigued and unfatigued muscles, so you should get a drop/raise in S proportional to S:: dS = dSmax * S Note this ensures that at low stamina a hit doesn't always knock you down to negative S. Encumbrance =========== Encumbrance also preoccupies muscles, leaving less available for running/attacking/etc. This could be modelled using an additional "drain" on S (as done by RF). However, a drain would be slightly miss-leading as it is not really damaged/fatigued muscles and thus should not affect fatigue indicators like panting or your fatigue bar. Instead it could be shown using an encumbrance marker on the bottom part of your fatigue bar, and if ever your fatigue drops below this marker you collapse under the weight. These preoccupied muscles also should be subtracted from S when considering how fast you can run, hard you can hit etc:: Se = E^Ke Where:: Ke=2 but can be tuned up to delay the onset of encumbrance effects. This is how stamina is constantly burned by encumbrance:: dS = -F * E^Ke * dt Note if S < E^Ke you are too tired to lift that much weight and collapse. Walking ======= This is how stamina is burned when walking, and walking speed varies with stamina and encumbrance:: dS = -F * 16*Kw^3 * (S - Senc) * dt walkSpeed = Kw * ((S - Senc)/(1 + Km*E))^(1/3) Where:: Kw = 0.25 but can be tuned down to reduce walking speed and stamina burn. Km = 2 but can be tuned down to reduce encumbrance effects on running/walking speed. walkSpeed = fraction of max run speed. Running ======= This is is how stamina is burned when running, and running speed varies with stamina and encumbrance:: dS = -F * (S - Senc) * dt runSpeed = (S - Senc)/(1 + Km*E) where:: Km = 2 but can be tuned down to reduce encumbrance effects on running speed. Jumping ======= This is how stamina is burned by jumping, and how jump height varies with stamina and encumbrance:: dS = Climbing ======== This is how stamina is burned by going uphill:: dS = dz Where:: dz is vertical displacement, probably low-pass filtered so jitter/bob doesn't burn fatigue like crazy.
The RealisticFatigue? document was a bit too messy and Oblivion specific. This is an attempt to tidy and simplify it into something that can be used for other games.
The following attributes are in the range 0.0 (empty) to 1.0 (full). Note that there can be underlying health,strength,endurance attributes that translate these into different numbers, but from the fatigue models point of view, the only thing that matters is the fraction of full health/stamina/encumbrance:
H - health, fraction of full health. S - stamina, fraction of full stamina. E - encumbrance, fraction of max lift.
The following constants adjust how quickly you get tired and recover. They a nominally constants but could be tweaked per-character based on some endurance attribute:
F - stamina burn rate, stamina/second R - stamina recovery rate, stamina/second
Note that R/(F+R) is the "steady state" or minimum S value reached for constant activity, so the the R/F ratio is important. Studies show F is 0.008~0.033, R is 0.0026~0.013, and F/R is 0.3~0.5, so F=0.03, R=0.01, for F/R = 1/3 is realistic, and gives an average fatigue recovery rate of 0.5%/sec. However for gameplay reasons F=0.1, R=0.
This is how stamina recovers constantly in the background:
dS = R * (1.0 - S) * dt
Wounds are modelled as damaged muscles, thus reducing your available un-fatigued muscles, or S. It applies a constant "drain" or cap on your stamina:
Smax = H^(1/Kh)
Where Kh=2 but can be tuned up to delay the onset of wound effects.
Note RF uses Smax=1-(1-H)^Kh, which compared to the above makes drains less for small injuries, but more for big ones, making it harder to "turn the tables" in combat.
When you are attacked or healed and your health changes, it damages/restores some of both fatigued and unfatigued muscles, so you should get a drop/raise in S proportional to S:
dS = dSmax * S
Note this ensures that at low stamina a hit doesn't always knock you down to negative S.
Encumbrance also preoccupies muscles, leaving less available for running/attacking/etc. This could be modelled using an additional "drain" on S (as done by RF). However, a drain would be slightly miss-leading as it is not really damaged/fatigued muscles and thus should not affect fatigue indicators like panting or your fatigue bar. Instead it could be shown using an encumbrance marker on the bottom part of your fatigue bar, and if ever your fatigue drops below this marker you collapse under the weight. These preoccupied muscles also should be subtracted from S when considering how fast you can run, hard you can hit etc:
Se = E^Ke
Where:
Ke=2 but can be tuned up to delay the onset of encumbrance effects.
This is how stamina is constantly burned by encumbrance:
dS = -F * E^Ke * dt
Note if S < E^Ke you are too tired to lift that much weight and collapse.
This is how stamina is burned when walking, and walking speed varies with stamina and encumbrance:
dS = -F * 16*Kw^3 * (S - Senc) * dt walkSpeed = Kw * ((S - Senc)/(1 + Km*E))^(1/3)
Where:
Kw = 0.25 but can be tuned down to reduce walking speed and stamina burn. Km = 2 but can be tuned down to reduce encumbrance effects on running/walking speed. walkSpeed = fraction of max run speed.
This is is how stamina is burned when running, and running speed varies with stamina and encumbrance:
dS = -F * (S - Senc) * dt runSpeed = (S - Senc)/(1 + Km*E)
where:
Km = 2 but can be tuned down to reduce encumbrance effects on running speed.
This is how stamina is burned by jumping, and how jump height varies with stamina and encumbrance:
dS =
This is how stamina is burned by going uphill:
dS = dz
Where:
dz is vertical displacement, probably low-pass filtered so jitter/bob doesn't burn fatigue like crazy.