Back to NxLabs

NxLabs / Vintage Story

Temporal Fatigue

ABy ArgualLeothon

Adds a time-based temporal stability drain that increases the longer a player goes without sleep.

Description

Temporal Fatigue

A Vintage Story mod that introduces a time-based temporal stability drain. The longer a player stays awake, the faster their temporal stability degrades. Sleeping in a proper bed resets the fatigue counter and fully restores stability.

The mod introduces a give and take feature. Sleeping now restores stability, but staying awake a long time introduces strain. It is now not as punishing to settle in temporally unstable areas as in vanilla, as the players can sleep / lie in bed to recover stability to safe levels. More stable areas are still preferable, since the slower drain / faster recovery in them allows the player to stay awake longer without suffering the effects of fatigue.


How It Works

Tiredness Clock

Each player has a hidden tiredness counter tracking in-game hours awake since their last full rest. It counts up toward a configurable maximum (MaxAwakeHours, default 72 h — three in-game days). The counter uses in-game calendar time.

The record human awake time is around 11 days, and the default Vintage Story month length is 9 days, so 72 hours (3 days) is a reasonable default for reaching exhaustion without being too punishing.

Stability Drain

While awake, temporal stability is drained once per server tick using real elapsed time (capped at 0.5 s per tick, identical to how the base game applies stability changes — time speed settings have no effect). The formula is:

<pre><span class="hljs-symbol">drain</span> per tick = <span class="hljs-keyword">BaseDrainPerSecond </span>&times; <span class="hljs-keyword">multiplier </span>&times; min(dt, <span class="hljs-number">0</span>.<span class="hljs-number">5</span>) </pre>

The multiplier depends on how many awake hours remain before exhaustion, linearly interpolated between the two nearest threshold entries. No drain occurs while fully rested; the rate climbs smoothly as the player stays awake longer.

Default Drain Thresholds

<table> <thead> <tr> <th>Remaining awake hours</th> <th>Multiplier</th> </tr> </thead> <tbody> <tr> <td>92 (well-fed bonus zone)</td> <td>&minus;0.2&times; (regen)</td> </tr> <tr> <td>72 (fully rested / base max)</td> <td>0.0&times;</td> </tr> <tr> <td>64</td> <td>0.1&times;</td> </tr> <tr> <td>24</td> <td>1.0&times;</td> </tr> <tr> <td>12</td> <td>1.5&times;</td> </tr> <tr> <td>8 (nearly exhausted)</td> <td>2.0&times;</td> </tr> <tr> <td>1 (critical)</td> <td>3.0&times;</td> </tr> <tr> <td>0.5 (extreme)</td> <td>10.0&times;</td> </tr> </tbody> </table>

Values between thresholds are linearly interpolated &mdash; there are no sudden jumps in drain rate. The 92 h entry only comes into play when nutrition bonuses raise the effective max above 72 h; see Nutrition Bonus below.

Nutrition Bonus

Eating a balanced diet extends how long you can stay awake before exhaustion. Each of the five food groups adds bonus hours proportional to your current satisfaction in that category:

<pre><span class="hljs-keyword">bonus </span>hours = configuredHours &times; (currentLevel / maxSaturation) </pre>

With default settings (4 h per group), a fully-nourished player gains up to 20 bonus hours on top of the base 72 h, for an effective maximum of 92 h.

While your remaining awake time exceeds the base maximum (72 h) due to nutrition, the drain multiplier becomes negative &mdash; temporal stability slowly regenerates instead of draining. The regen rate scales linearly from 0 at 72 h remaining to &minus;0.2&times; at 92 h remaining, producing a maximum passive regen of 0.0005 stability/s (one fifth of the base drain rate).

Sleeping

Lying in a valid bed accumulates rest. By default, a bed is considered valid when it is indoors (in a space considered a room by the game). This requirement can be disabled with Sleep.DisableIndoorBedRequirement. Once the player has rested for the configured minimum duration &mdash; whichever threshold is hit first:

  • MinIngameHoursForReset in-game hours (default 3 h), or
  • MinRealSecondsForReset real seconds (default 30 s)

&mdash; a reset triggers:

  1. The tiredness counter resets to 0.
  2. Temporal stability is immediately restored to the bed's RestoreCap.

Drain is fully suppressed while in a valid bed and for a configurable grace period after getting up (default 15 s), absorbing the brief time-speed-up that occurs when waking.

Bed Quality

Different bed types restore stability to a different cap on reset:

<table> <thead> <tr> <th>Bed type</th> <th>Stability cap</th> </tr> </thead> <tbody> <tr> <td>Hay bed</td> <td>0.70</td> </tr> <tr> <td>Wooden bed</td> <td>0.85</td> </tr> <tr> <td>Aged-wood bed</td> <td>1.00</td> </tr> </tbody> </table>

Temporal Gear

Using a Temporal Gear resets the tiredness counter completely. Stability restoration is handled entirely by the vanilla game &mdash; this mod does not interfere with it.

Offline Time

By default, offline time has no effect (OfflineDrainPercent = 0). Setting this to a value above 0 advances the tiredness clock by that fraction of elapsed offline in-game hours when the player logs back in. No stability is drained on login &mdash; only the tiredness clock is affected.


HUD Bar

Read the full description on Vintage Story ModDB →

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.