Sanity is the third meter every hero carries besides health and stamina. It starts full, drains while you fight enemies or linger in the Dark Mist, and decides which of three mental states the hero is in: Normal, Abnormal (the UI word for the first stage) and Lunatic. Each hero has a different set of penalties and bonuses in the lower two states, and many trophies and talents only work there.
The meter#
Every hero has a base maximum of exactly 100 sanity. The game computes it from the hidden attribute row of the hero (hidden attribute 1, which maps to 1,000 on the attribute curve, times a 100/1000 rate), so there is no hero that starts higher or lower.
| State | Rule (M = maximum sanity) | At M = 100 | Notes |
|---|---|---|---|
| Normal | sanity above 0.7 x M (rounded up) | 71 to 100 | No penalties. |
| Abnormal | sanity at or below ceil(0.7 x M) | 70 down to 51 | Hero-specific effects begin, and ordinary enemies get the aggressive flag. See Abnormal state and Abnormal state#Enemies turn aggressive. |
| Lunatic | sanity at or below ceil(0.5 x M) | 50 down to 1 | Sanity can no longer be refilled above 50. See Lunatic state. |
| Dead | sanity reaches 0 | 0 | Counts as a lethal hit, exactly like losing all health. |
The talent Sanity (every hero tree) adds 5% / 10% / 15% to the maximum. Because both thresholds are fractions of the maximum, they move up with it:
| Sanity talent level | Maximum | Abnormal at or below | Lunatic at or below |
|---|---|---|---|
| none | 100 | 70 | 50 |
| 1 | 105 | 74 | 53 |
| 2 | 110 | 77 | 55 |
| 3 | 115 | 81 | 58 |
A larger maximum therefore does not move you farther from the stages in percentage terms; it only gives a bigger pool above them.
Losing sanity#
| Source | Amount | Where it applies |
|---|---|---|
| Damaging enemies | enemy "SanDamage" x (health you removed / that enemy's maximum health), charged on every hit | Main campaign only. See below. |
| Enemy moves flagged to hit sanity | 2 to 15 per hit, or per second of contact for continuous attacks (list below) | Anywhere except Arcade outside boss fights |
| Time in the Lost Valley | 0.5 per second outside safe circles, in every state | Lost Valley scenes, see Sanity in special areas#Lost Valley |
| Time in the main world while Lunatic | 0.5 per second | Not in boss rooms, the maze, the Lost Valley or the Colossal Grave. See Lunatic state#Draining over time. |
| Time in the maze | 0.5 every 2 s; 5 every 2 s while Lunatic | Deep into the Dark Mist; slowed by the Purifying Saint, see Sanity in special areas#The maze (Deep into the Dark Mist) |
| Elixir of Hallucination | 5 per second for 5 s (about 25; the item text says "immediately" but the data is a 5-second drain) | Anywhere. No defence reduces it (see Hidden mechanics). |
| Sanity-draining ground effects | up to 2 per second for 5 s, refreshed while you stay in them (unverified whether they stack) | Rain and corrosive ground in the chapter 4 boss fight, and two ordinary enemy types (internal 20031 and 20035). Not reduced by defence. |
| Statue and frog offerings | half of the number printed on the offer | Maze statues#Sanity is halved, frog shrines |
| Scripted events | 27 (quest 15040, chapter 1) and 100 (quest 20019999, story 2001) | Story events |
Damage costs sanity (campaign)#
Whenever the hero lands damage on an enemy in the campaign, the game takes SanDamage x HP removed / enemy max HP sanity from the hero. A "SanDamage" of 5 therefore means: depleting that enemy's whole health bar costs 5 sanity, whether you do it in one blow or many.
Across the 2,747 enemy placements in the data:
| Group | SanDamage |
|---|---|
| Ordinary campaign enemies (about 700 of the 800 non-boss rows in chapters 1 to 9) | usually 5; a few 3, 4, 6, 8, 10, 15, 20, 25 |
| Elites and mini-bosses | 20 to 130 (for example the club-wielding elite, internal 20030, has 65 and 110) |
| Chapter bosses | 70 to 130 (see below) |
| All other rows (the rest of chapters 1 to 9, all of chapter 8, and every maze monster) | 0 |
Boss values: Maddened Ascetic 90 (75 in its later chapter 7 appearance), Holy Father 85, Jenny of Exilium 100, Edith 70, Frollo 55, Elmar 20, Elena 55, Fused Sprenger 120, Proxy Higgins 120 (130 in the second set of chapter rows, story 1006), Usurper 130, and the three DLC bosses 130 (The First Messenger and Terror Obsession cost nothing). Each chapter's rows exist twice in the table (story ids such as 1 and 1001) with the same values unless noted. A value above 100 sounds fatal, but boss rooms pin your sanity at a floor, see Lunatic state.
The talent Devout (every hero) cuts this particular loss by 15%. It does not reduce the "enemy move" losses below.
Enemy moves that hit sanity directly#
Only four enemy models carry sanity damage on specific attacks:
| Enemy | Move (internal id) | Sanity per hit |
|---|---|---|
| Maddened Ascetic (20007) | special 6 | 15 |
| Holy Father (20014) | eleven moves (4-1 to 12-2) | 2 to 5 each |
| Jenny of Exilium (20022) | move 4-2 | 10 |
| A deer enemy (20029) | move 5-1 | 5 |
These are scaled down at long range for moves with a damage-distance falloff (full value inside the move's minimum distance, sqrt(1 - x^2) of it in between where x is how far you are between the minimum and maximum distance, and nothing beyond the maximum), and halved by the trophy Loneliness Whisper (see Sanity talents and trophies#Other).
Gaining sanity#
| Source | Amount | Notes |
|---|---|---|
| Elixir of Sanity | +1 per second for 15 s (about 15) | Cannot be used in the maze. "Improved Effect" turns each tick into +2 (see Hidden mechanics). |
| Talent Sanity: Enhanced Elixir | +5 instantly when you drink a listed potion or elixir | Stacks with the item's own effect. |
| Vertebra Nail | +5 per second for 3 s | Maze only. |
| Immortal Jellyfish Jar (placed marker) | about +1 per second while within 2 m | Story scenes only (inferred: no effect in the mist). You keep one jar; up to 10 markers stay placed. |
| Moon Jellyfish Jar (placed marker) | stops sanity drain within 2 m for 60 s | Maze only; it prevents loss rather than restoring. See Sanity in special areas. |
| Kills in the maze | +1 to +10 per kill | Elites (internal 20043) give +10. Main-campaign kills give nothing except the boss and elite rows below. |
| Kills in Lost Valley - Heggem (story 101) | +3 per kill (16 enemies) | The only Lost Valley that pays for kills; the lock still caps a Lunatic hero. See Sanity in special areas#Lost Valley. |
| Chapter bosses (Maddened Ascetic, Holy Father, Jenny, Fused Sprenger) | +200 (full refill) | Also removes the Lunatic lock; see Lunatic state#Ways out. |
| The two club-wielding elites of chapter 5 (internal 20030) | +200 each | Not boss kills (IsBoss 0), so they do not remove the lock: a Lunatic hero is still capped at 50 (inferred from the kill code). |
| Maze fountain | +25 on top of lifting you to 50 | See Sanity in special areas. |
| Defeating a hostile call hero in the maze | 10% of the gap between the 50% line and the maximum (+5 at base), on top of lifting you to 50 | See Sanity in special areas. |
| Maze statue offers | half of the printed percent (30% printed gives +15 at base), plus the lift to 50 | See Maze statues#Sanity is halved. |
| Killing the Lunatic doppelganger | refills to maximum | See Sanity doppelganger. |
| Dying and being revived | refills to maximum and clears the Lunatic lock | Verified in the revive code (RebornValue). |
| Resting at an altar (Altars#Recovery (resting)) | refills to maximum and clears the Lunatic lock | Rest runs the same respawn routine as dying (the generic "rest everyone" function is never called). |
| Scripted event (quest 15075, chapter 1) | +100 | Story event. An ordinary gain, so the Lunatic lock still caps it at 50 (the quest code uses the normal add function). |
No hero skill in the data carries a sanity-gain value (the code would add a skill's SanAdd on executions and backstabs, but every SkillData row has 0), and the talent types for gaining sanity from kills, events or skills (SanKillAdd, SanEventAdd, SkillSanAdd) exist in the code but are used by no talent.
When sanity does not change#
Sanity is not lost at all:
- while the host hero is dead or the game has stopped attacks (cutscenes);
- in dream sequences;
- in Arcade mode outside boss fights (Arcade mode);
- from hero allies, which ignore sanity damage entirely outside the maze.
Sanity belongs to the hero#
Each hero stores its own sanity in the save. Switching heroes carries the old hero's percentage to the new one, but switching is blocked while the current hero is Lunatic. After each hero is created, saved sanity is clamped to that hero's current maximum, and a hero loaded while at or below the Lunatic threshold is re-locked at the cap.
Hidden mechanics#
- Campaign kills never refill sanity. The "SanKill" gain is zero for every ordinary enemy in chapters 1 to 9, and the only non-zero rows there are the four chapter bosses (+200) and the two club-elite entries (+200). Killing in the maze is the opposite: it costs nothing and refills 1 to 10, and Lost Valley - Heggem pays +3.
- The sanity cost is proportional to damage dealt. Weak enemies you barely scratch cost almost nothing; a huge-health enemy costs the same total as a small one.
- Large damage-to-sanity numbers on bosses are safe. In a boss fight the minimum is pinned at the Lunatic bound, so a "130" boss cannot kill you through sanity.
- Sanity potions ignore your defences. The sanity statuses (Elixir of Sanity, Elixir of Hallucination, Vertebra Nail, the ground effects) are tagged with the physical defence type, but their defence scale (
Param3) is 0, and the status code multiplies your resistance by that scale before using it. Every tick is therefore simplyceil(base x (1 + item talent bonus)): 1 for the Elixir of Sanity, 5 for Hallucination and the Nail, 2 for the ground effects. - "Improved Effect" doubles the Elixir of Sanity. It multiplies the per-second value by 1.1 / 1.2 / 1.3 (talent levels 1 to 3; Elena has two levels, 1.15 / 1.3) and the result is rounded up, so the 1 always becomes 2: the elixir gives about 30 instead of 15 over its duration. The same talent raises a Hallucination tick from 5 to 6 / 6 / 7. "Prolonged Duration" lengthens both elixirs by 10% / 20% / 30% for Terrence, Viola and Benita, 10% / 20% for Norwood and Jerold, and 15% for Elena (Buffs#hm-the-item-talents-are-bigger-than-they-look). The Vertebra Nail is on neither list.
- Benita's potion resistance also halves sanity elixirs. While she is Abnormal or Lunatic and her Drug Resistance status is switched on (see Abnormal state#Effects by hero), every potion-type status tick is halved before rounding up: Hallucination 5 becomes 3, the Elixir of Sanity stays at 1 (even with Improved Effect, 1.1 x 0.5 rounds up to 1).
- The Lunatic lock is not rounded. Refills stop at 57.5 with three Sanity talent levels while the Lunatic test rounds up to 58, so the lock never lifts you out of the state. Full numbers: Lunatic state#hm-the-lock-is-exactly-half-never-rounded-refills.
- Statue and frog numbers are on a doubled scale. The code halves every sanity cost and gain printed on these offers (inferred reason: they were written for a 0 to 200 scale), so a "Dedicate 10 Sanity" statue really takes 5 (Maze statues#Sanity is halved).
- Several talent descriptions point the wrong way. "Adapt to Abnormality" talents read as additional penalties but are reductions of the penalty (Abnormal state#hm-the-penalty-talents-are-reductions-the-english-text). "Lucky Madness" claims to work only in the Abnormal state, but the drop code applies it always (Sanity talents and trophies#Lucky Madness by hero).
- Lost Valley and the maze never charge for damage. The code skips sanity-by-damage in Lost Valley scenes, and every maze monster and every Lost Valley placement carries a SanDamage of 0 in the data.
- Unused data. The constants for a "sanity first-kill" reduction table (10 / 5 / 1 kills, 100% / 60% / 20%),
SanDeadRate0.6, and the Terrence dodge-close rate 700 are defined but never read.
Related#
Lunatic state, Abnormal state, Sanity doppelganger, Sanity talents and trophies, Sanity in special areas, Maze statues, Terrence, Viola, Benita, Norwood, Jerold, Characters, Consumables.
Sources#
- Thresholds:
gamedata/playerdefine/animalbase_value_define.lua:13-17(SanBound 1 / 0.7 / 0.5),logic/playervalue/animalbase_value.lua:1663-1684(GetSanType),:1708-1712(GetSanBound),:717-740(death at 0). - Maximum: tables HeroData (
Attribute_7= 1), HeroPropertyData rows 8, 58, 108, 158, 208, 258, 308 (PropertyId 8,Attribute_7= 100), HeroAttributeData (AttributeId 7,Property_8= 1000). Talent: HeroTalent 11401, 12401, 13401, 14401, 15401 (Type 93, value 50 +50 per level). - Losing:
logic/player/animalbase.lua:16716-16735(SanDamage x HP removed / max HP; Devout via SanAttackSub),logic/playervalue/animalbase_value.lua:2150-2197, 2777-2797, 2925-2946(skill SanSub, distance falloff, Loneliness Whisper),controller/controllerstorymode.lua:19-24, 2180-2290(drain constants and branches), StatusData 10074, 10040,ui/controller/statueuictrl.lua:208-241,ui/controller/frogctrl.lua:328-337, 396. - Enemy data: tables StoryMonster (
SanDamage,SanKill), SkillData (SanSubon hero ids 20007, 20014, 20022, 20029), TrapData 10005 and 10006. - Sanity statuses ignoring defence:
logic/status/statusbase.lua:238-248(GetStatusParam),:294-344(defence multiplied byParam3/1000 at:324, Benita halving at:340-342, round-up at:344);gamedata/structdata/exportdata/es_statusdata.luarows 10009, 10040, 10074, 10100 (Param3= 0). - Execution/backstab SanAdd:
logic/player/animalbase.lua:6662-6690; hostile call hero:controller/controllerstorymode.lua:1904-1910,:27(CallHeroAddSanRate 0.1),logic/playervalue/animalbase_value.lua:1236-1251; revive:logic/playervalue/animalbase_value.lua:142-147,controller/controllerstorymode.lua:1944-1981; unused rest function:controller/controllermain.lua:3148-3156. - Gaining: StatusData 10009, 10100, 10083,
logic/status/status103.lua,logic/status/statusbase.lua:270-345(tick value formula, physical-resistance reduction at:312-342,GetCommonPropertyDefence:356-364),logic/playervalue/animalbase_value.lua:1822-1840,structdata/ms_skilldata.lua:9-17, StatusDataDefenceTypeof 10009, 10040, 10074, 10083, 10100,logic/player/animalbase.lua:6636-6640(ItemSanAdd), HeroTalent 11302 and 11305 condition lists,controller/controllerstorymode.lua:3459-3470(SanKill),:1896-1902,:2428-2444,:4506-4517(jar markers, radiuslogic/item/itemscene.lua:8), tables ItemData 20020, 20021, 20030, 26003, 26004. - No change:
logic/playervalue/animalbase_value.lua:981-1008, 1155-1172. - Damage cost skipped in dark-forest scenes:
logic/player/animalbase.lua:16716-16720(IsDarkForestScene() == false); SanDamage and SanKill of stories 101 to 105: table StoryMonster (101: SanKill 3 on 16 rows; 102 to 105: 0); story 101 = Lost Valley - Heggem (table StoryData StoryId 101, StageId 20003). - Elite and boss kills: table StoryMonster rows with SanKill 200 (hero ids 20007, 20014, 20022, 20034 and 20030); lock removal only for boss kills:
controller/controllerstorymode.lua:3459-3470. - Scripted events: table StoryQuest 15075 (
SanAdd100), 15040 (SanSub27), 20019999 (SanSub100); applied atcontroller/controllerstorymode.lua:9336-9348with the normal add and subtract functions. - Per-hero storage and switching:
structdata/fs_savestory.lua:3128-3160,controller/controllermain.lua:3382-3445,logic/player/animalbase.lua:9514-9545. - Altar rest:
ui/controller/playerinfoctrl.lua:9174-9185(Rest button) ->logic/player/animalbase.lua:13075-13078(WorshipingRest) ->controller/controllerstorymode.lua:1969-1975(HostPlayerReborn) ->logic/playervalue/animalbase_value.lua:142-147(RebornValue clears both locks and sets sanity to maximum). - Unused data:
gamedata/playerdefine/animalbase_value_define.lua:18,controller/controllerstorymode.lua:174-186, 2403-2425,gamedata/playerdefine/hero10001_define.lua:29.