SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
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

<h1 id="temporal-fatigue">Temporal Fatigue</h1> <p>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.</p> <p>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.</p> <hr /> <h2 id="how-it-works">How It Works</h2> <h3 id="tiredness-clock">Tiredness Clock</h3> <p>Each player has a hidden tiredness counter tracking in-game hours awake since their last full rest. It counts up toward a configurable maximum (<code>MaxAwakeHours</code>, default <strong>72 h</strong> &mdash; three in-game days). The counter uses in-game calendar time.</p> <blockquote> <p>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.</p> </blockquote> <h3 id="stability-drain">Stability Drain</h3> <p>While awake, temporal stability is drained once per server tick using <strong>real elapsed time</strong> (capped at 0.5 s per tick, identical to how the base game applies stability changes &mdash; time speed settings have no effect). The formula is:</p> <pre><code><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>) </code></pre> <p>The multiplier depends on how many awake hours remain before exhaustion, <strong>linearly interpolated</strong> between the two nearest threshold entries. No drain occurs while fully rested; the rate climbs smoothly as the player stays awake longer.</p> <h4 id="default-drain-thresholds">Default Drain Thresholds</h4> <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> <p>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 <a href="#nutrition-bonus">Nutrition Bonus</a> below.</p> <h3 id="nutrition-bonus">Nutrition Bonus</h3> <p>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:</p> <pre><code><span class="hljs-keyword">bonus </span>hours = configuredHours &times; (currentLevel / maxSaturation) </code></pre> <p>With default settings (4 h per group), a fully-nourished player gains <strong>up to 20 bonus hours</strong> on top of the base 72 h, for an effective maximum of <strong>92 h</strong>.</p> <p>While your remaining awake time exceeds the base maximum (72 h) due to nutrition, the drain multiplier becomes negative &mdash; temporal stability slowly <strong>regenerates</strong> 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).</p> <h3 id="sleeping">Sleeping</h3> <p>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 <code>Sleep.DisableIndoorBedRequirement</code>. Once the player has rested for the configured minimum duration &mdash; whichever threshold is hit first:</p> <ul> <li><strong><code>MinIngameHoursForReset</code></strong> in-game hours (default <strong>3 h</strong>), or</li> <li><strong><code>MinRealSecondsForReset</code></strong> real seconds (default <strong>30 s</strong>)</li> </ul> <p>&mdash; a <strong>reset</strong> triggers:</p> <ol> <li>The tiredness counter resets to 0.</li> <li>Temporal stability is immediately restored to the bed's <code>RestoreCap</code>.</li> </ol> <p>Drain is fully suppressed while in a valid bed and for a configurable <strong>grace period</strong> after getting up (default <strong>15 s</strong>), absorbing the brief time-speed-up that occurs when waking.</p> <h3 id="bed-quality">Bed Quality</h3> <p>Different bed types restore stability to a different cap on reset:</p> <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> <h3 id="temporal-gear">Temporal Gear</h3> <p>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.</p> <h3 id="offline-time">Offline Time</h3> <p>By default, offline time has no effect (<code>OfflineDrainPercent = 0</code>). 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.</p> <hr /> <h2 id="hud-bar">HUD Bar</h2> <p>A small statu

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.