tModLoader The Sanity Mod

Trivaxy

Skeletron Prime
It's been a while since I made a mod, and I thought of uh.. this.

The Sanity Mod
(yes, inspired by Don't Starve)

9a786821-1c87-11e7-bdd8-7ba22c527286.gif


Summary:
The Sanity Mod adds a sanity meter to the game, similar to your health and mana. You can find the sanity meter right next to your health meter. Sanity has adverse effects on you, there are no positive effects, only negative ones. But don't worry, take care of your sanity and you'll be absolutely fine! Or don't, but things get bad if you don't.

You have a maximum of 300 sanity.
To keep your sanity up is relatively simple and easy if you are prepared.
1- Eat food, any food you can find. (Well, just vanilla ones. Mod support with Thorium should come soon hopefully). However, you cannot continuously eat food to easily regain sanity.
3f170de8-21a9-11e7-b137-8710283e8048.gif

Eating food when you don't have the "Satiated" debuff will give it to you. This debuff prevents you from regaining sanity when you eat, and it lasts for 10 minutes. This buff however does not prevent you from eating, it just stops you from regaining sanity when you eat.
2- Stay in the hallow, it increases your sanity slowly.
3- Consume life fruit. These also restore your sanity.
4- During the daytime, your sanity will also increase slowly.
5- Killing a boss will increase your sanity by a fair amount. (When not in hardmode)

Oh, you better take good note of these.

1- Getting killed. This decreases your sanity by a substantial amount, in expert mode, the amount is higher.
(Take note that if you die and your sanity is 0, it'll get restored to 90 if it's not hardmode and it's not expert mode)
2- Staying in the corruption or crimson will decrease your sanity slowly as well, so be careful! The amount is higher in hardmode.
3- Blood moons will decrease your sanity slowly.
4- Solar Eclipses will decrease your sanity slowly.

When your sanity is less than 195:

1- Damage taken by hostile NPCs is increased by 30%.
2- Damage taken by projectiles from hostile NPCs is increased by 30%.

When your sanity is less than 100:
1- All damage you inflict on NPCs is reduced by 50%.

When your sanity is less than 50:
1- You get the 'Confused', 'Darkness', (if in expert mode, you also get the 'Silenced') debuffs.
2- You may sometimes fail to use items.

3- You get the 'Cracking Mind' debuff.

928f0b2e-1c89-11e7-a636-7ba22c527286.gif

Cracking Mind does the following:

1- Reduce movement speed by 50%.
2- Damage taken is increased by 70%.

1- Make sure you always have food at your disposal. Eating them increases your sanity a bit and will save you in a pinch (e.g Blood moon)
2- If you are not yet in hardmode, then keep some boss summons with you in order to regain some sanity easily when fighting bosses.
3- If you have the hallow in your world, you may consider building your base there (at your own risk!) to increase your sanity.
4- During a blood moon or solar eclipse, staying in the hallow will help counteract the bad sanity-decreasing effects.
5- Avoid going into the corruption or crimson whenever you can, unless you have to. Do not go there during a blood moon or solar eclipse!
6- Don't get rid of your life fruits. Like I said before, they increase sanity when consumed.
7- Build your base / be close to a reliable food source.

The Sanity Mod can also be configured to your liking! Feel like losing sanity when in the Crimson/Corruption is too much? Disable it!

You can find the config file named "SanityConfig.json" in Terraria's save path/ModLoader (The one where your Mods and Mod Sources folders are).

E.g: For windows, you can find it in
C:\Users\YOURNAME\Documents\My Games\Terraria\ModLoader\SanityConfig.json

If you do not have this file, just enter a world with the mod enabled.

Using the config file is super easy. The contents by default are like this:
49f6eca6-21dd-11e7-aabe-8710283e8048.gif


To disable/enable some mechanics, you just need to change the true to false or the other way around.
Let's say, for example, that I did not want blood moons to decrease my sanity. Simple, let's go to the line where we have "BloodmoonLoss": true. We need to change the "true" to "false" in order to configure the sanity mod to not make you lose sanity during blood moons. So the line should turn to this: "BloodmoonLoss": false. (Make sure to keep everything correct with no spelling mistakes! Also make sure you don't delete/add unneeded commas).
Let's say that I also do not want deaths to make me lose sanity. In this case, we set "DeathLoss": true to "DeathLoss": false.

Now you get the basic idea of how to configure these boolean values (true/false values).
If we want them to make us lose sanity we simply set them to true again.

Below is the list that documents the configuration:

BloodmoonLoss - If true, you lose sanity during blood moons.
EclipseLoss - If true, you lose sanity during solar eclipses.
DeathLoss - If true, you lose sanity when you die.
DayTimeIncrease - If true, you slowly regain sanity during the day.
OnKillBossIncrease - If true, you can gain sanity by killing bosses in Pre-Hardmode.
HallowIncrease - If true, you gain sanity slowly when in the Hallow.
CrimsonLoss - If true, you lose sanity slowly when in the crimson.
CorruptionLoss - If true, you lose sanity slowly when in the corruption.

More configuration options coming soon!

If your configuration isn't working, then you most likely did something wrong in the json file. Post your configuration here and I'll help you.

If you have any bugs, suggestions for rebalancing or ideas then feel free to comment!
Feedback is appreciated.

Note: This mod has not been tested for multiplayer. It'd be great if you try it out with others online and tell me of any bugs you find, I'm trying to make this multiplayer compatible.


And that's pretty much it, I hope you enjoy this mod! :)

If you want to chat about this mod or any other mods that I make, join my central discord server:
https://discord.gg/dqvbNvE

Download Links:
Click here!
Mod also available in the mod browser.

 
Last edited:
Nice concept, but I feel like a simple pumpkin farm or any of the seasonal occurrences would supply you with food enough to never worry about sanity at all. Maybe require different food items to recover sanity after so many of a type get consumed? I guess that would eventually mandate fishing, though...

Also, I dislike use of Life Fruits for this purpose, since it doesn't overlap well with their main function. You only get a surplus of them if you're not doing a fast playthrough, and this doesn't account for other mods' uses as well.

The effects of sanity loss seem a bit harsh, since you're talking about suddenly being unable to beat some kinds of fight bosses or events. Shouldn't it be expected that you might, as part of the game, have to deal with low sanity amidst progression-related circumstances? Things that necessitate purely-grinding solutions seem a bit lame, in general (whether it be food stockpiling or whatever).

Also, are there config options? Lots of sins are forgivable with these, since players can simply tweak to their liking.

Otherwise, I like where this is going.
 
Last edited:
Yikes.

Kinda jarring of how Sanity can screw you over.

May I suggest a few items to aid with the whole Sanity thing?

High-Sanity Items:
"The Wickerbottom" - Spell Tome
Fire 5 blasts of energy
Gains power with higher Sanity

"Flower Crown" - Helmet
Sanity ROI (rate of increase) is boosted in day
Sanity ROD (rate of decrease) is reduced in Solar Eclipse/Blood Moon

"Rune of Power - Chattur'gha" - accessory
Melee damage and Total defense boosts Sanity ROI

"Rune of Unity - Mantorok" - accessory
All damage and Total defense boost Sanity ROI

---

Low-Sanity Items
"Umbra Codex" - Summon Weapon
Summons a clone using the last type of damage used
(Example: If using a yo-yo or sword, Clone will be Melee)
Gains power with lower sanity

"Tome of Eternal Darkness" - Crafting Station
Can create any of the 4 Runes, but will drain sanity when near at a slow rate

"Rune of Sanity - Xel'lotath" - Accessory
Gain more sanity upon killing monsters

"Rune of Knowledge - Ulyaoth" - Accessory
Magic/Summon damage and Total defense reduce Sanity ROD.

Think this could be a good idea?
 
Why not 200 huindered like max health and mana?
The first effects of low sanity kick in at < 195, which would be like, 5 units less than 200 which would be way too much. So 300 is pretty balanced I'd say.

Nice concept, but I feel like a simple pumpkin farm or any of the seasonal occurrences would supply you with food enough to never worry about sanity at all. Maybe require different food items to recover sanity after so many of a type get consumed? I guess that would eventually mandate fishing, though...

Also, I dislike use of Life Fruits for this purpose, since it doesn't overlap well with their main function. You only get a surplus of them if you're not doing a fast playthrough, and this doesn't account for other mods' uses as well.

The effects of sanity loss seem a bit harsh, since you're talking about suddenly being unable to beat some kinds of fight bosses or events. Shouldn't it be expected that you might, as part of the game, have to deal with low sanity amidst progression-related circumstances? Things that necessitate purely-grinding solutions seem a bit lame, in general (whether it be food stockpiling or whatever).

Also, are there config options? Lots of sins are forgivable with these, since players can simply tweak to their liking.

Otherwise, I like where this is going.
-The food subject does have me concerned, I'll add a buff preventing you from using vanilla food and/or other modded food for a period of time if any mod developer decides to contact me about it.
-Life fruits was a suggestion from a person which I didn't like as well, so I guess I'll remove it.
-I'm aware of just how harsh sanity effects can be, you make difficult mods as well low sanity is meant to make your life a living hell, thus why you need to keep it up. I'll try to make the effects less harsh.
-Config file coming soon, too, if that's what people want.

[doublepost=1491719462,1491719388][/doublepost]
Yikes.

Kinda jarring of how Sanity can screw you over.

May I suggest a few items to aid with the whole Sanity thing?

High-Sanity Items:
"The Wickerbottom" - Spell Tome
Fire 5 blasts of energy
Gains power with higher Sanity

"Flower Crown" - Helmet
Sanity ROI (rate of increase) is boosted in day
Sanity ROD (rate of decrease) is reduced in Solar Eclipse/Blood Moon

"Rune of Power - Chattur'gha" - accessory
Melee damage and Total defense boosts Sanity ROI

"Rune of Unity - Mantorok" - accessory
All damage and Total defense boost Sanity ROI

---

Low-Sanity Items
"Umbra Codex" - Summon Weapon
Summons a clone using the last type of damage used
(Example: If using a yo-yo or sword, Clone will be Melee)
Gains power with lower sanity

"Tome of Eternal Darkness" - Crafting Station
Can create any of the 4 Runes, but will drain sanity when near at a slow rate

"Rune of Sanity - Xel'lotath" - Accessory
Gain more sanity upon killing monsters

"Rune of Knowledge - Ulyaoth" - Accessory
Magic/Summon damage and Total defense reduce Sanity ROD.

Think this could be a good idea?
These are nice, though I don't like items being added to this mod. I'll consider it + I'll need a person to sprite if I do want them. :)
 
Would be nice to have normal sanity and above normal sanity and when you are above normal sanity which could only be reached by staying in hallow or eating life fruit and if you reach that amount you get rewarded some rewards could be: take reduced damage, get a buff that makes you loose sanity at a reduced rate, increase drop of items, increase drop of coins or get the midas buff, more move speed.

Also I think that the disadvantages are too stiff IMO I think at first you should get reduced move speed then maybe get confused debuff every x amount of time then like then that some wraiths to start spawn near you (or increase spawns of monsters in general) then reduce damage you do and at really critical level increase the damage they do to you. Also the % should be small at first and then scale. 50% more damage in one go is pretty harsh IMO.

BTW you said "2- If you are not yet in hardmode, then keep some boss summons with you in order to regain some sanity easily when fighting bosses." but you didnt mention that you get sanity fighting bosses on "How to keep your sanity up!". How does that work?

I liked the idea of a config file and the weapons that do damage depending on how much sanity you have.
 
The first effects of low sanity kick in at < 195, which would be like, 5 units less than 200 which would be way too much. So 300 is pretty balanced I'd say.

-The food subject does have me concerned, I'll add a buff preventing you from using vanilla food and/or other modded food for a period of time if any mod developer decides to contact me about it.
-Life fruits was a suggestion from a person which I didn't like as well, so I guess I'll remove it.
-I'm aware of just how harsh sanity effects can be, you make difficult mods as well low sanity is meant to make your life a living hell, thus why you need to keep it up.
I'll try to make the effects less harsh.
-Config file coming soon, too, if that's what people want.


These are nice, though I don't like items being added to this mod. I'll consider it + I'll need a person to sprite if I do want them. :)

Would be nice to have above normal sanity (301+) and when you are above normal sanity which could only be reached by slaying bosses (pre-HM), staying in hallow or eating life fruit and if you reach a certain amount you get rewarded.
Some rewards could be: increased defense, gain damage reduction (+?%), get a buff that makes you lose sanity at a reduced rate, increased drop of items(?), increase drop of coins(?) or get the midas buff(?), or more movement speed.

Also I think that the disadvantages are too stiff IMO. I think at first you should get reduced move speed into gaining the confused debuff for X genericTimeUnitsHere into having wraiths and ghosts start spawning near you (&/or increase the spawnRate & amount of monsters in general), then reduce damage you do, and finally increase the damage they do to you. Also the % should be small at first and then scale. 50% more damage in one go is pretty harsh IMO.

BTW you said "2- If you are not yet in hardmode, then keep some boss summons with you in order to regain some sanity easily when fighting bosses." but you didn't mention that you get sanity fighting bosses on "How to keep your sanity up!". How does that work? (I think he forgot to place that in?)

I liked the idea of a config file and the stuff that scale based on how much sanity you have.
Paraphrased quotes above.

Relating to first quoted post:
I propose doing something about the total amount of sanity like raising it, or allowing a way to increase your total throughout the game.
If the above is done, I further propose to have the base regen(s) & depletion(s) scale based on the game progression.
In addition, I would advise maybe looking at the Call of Cthulu tabletop RPG rules concerning sanity and various ways to manage it.
Finally, I would suggest calling the debfuff "Brain Fed" with a brain patterned smiling fish with heart eyes which would just remove the sanity recovery effect of various food items.

Relating to the second posted quote:
All my suggested edits have been placed into your edited quote, and thus contain some of my opinions.
Otherwise, I would suggest moving any and all mod adding items based off this mod into a supplemental mod known as "Sanity Mod: Hard-boiled Edition", or Overclocked Edition, etc.
 
Would be nice to have normal sanity and above normal sanity and when you are above normal sanity which could only be reached by staying in hallow or eating life fruit and if you reach that amount you get rewarded some rewards could be: take reduced damage, get a buff that makes you loose sanity at a reduced rate, increase drop of items, increase drop of coins or get the midas buff, more move speed.

Also I think that the disadvantages are too stiff IMO I think at first you should get reduced move speed then maybe get confused debuff every x amount of time then like then that some wraiths to start spawn near you (or increase spawns of monsters in general) then reduce damage you do and at really critical level increase the damage they do to you. Also the % should be small at first and then scale. 50% more damage in one go is pretty harsh IMO.

BTW you said "2- If you are not yet in hardmode, then keep some boss summons with you in order to regain some sanity easily when fighting bosses." but you didnt mention that you get sanity fighting bosses on "How to keep your sanity up!". How does that work?

I liked the idea of a config file and the weapons that do damage depending on how much sanity you have.
Maybe, I'll reduce the effects by a little bit and add a couple more ways to prevent your sanity from getting low.
Also, I did mention that you get sanity when fighting bosses when not in hardmode in "How to keep your sanity up!". Read number 5.

Paraphrased quotes above.

Relating to first quoted post:
I propose doing something about the total amount of sanity like raising it, or allowing a way to increase your total throughout the game.
If the above is done, I further propose to have the base regen(s) & depletion(s) scale based on the game progression.
In addition, I would advise maybe looking at the Call of Cthulu tabletop RPG rules concerning sanity and various ways to manage it.
Finally, I would suggest calling the debfuff "Brain Fed" with a brain patterned smiling fish with heart eyes which would just remove the sanity recovery effect of various food items.

Relating to the second posted quote:
All my suggested edits have been placed into your edited quote, and thus contain some of my opinions.
Otherwise, I would suggest moving any and all mod adding items based off this mod into a supplemental mod known as "Sanity Mod: Hard-boiled Edition", or Overclocked Edition, etc.
Scaling has been looked over, but I avoided adding it as I guarantee you that this way sanity will become too much of a problem. I don't really want to give the players a way to increase max sanity, because I feel like 300 is enough.
 
Could you also factor in the "Eternal Darkness" factors?

At the start of the game, you get 1 of 4 Ancients to worship (via a Blank Rune), and depending on that choice, you get a damage/defense/special boost when Sanity is either high or low.

Chattur'gha - At high sanity, you gain an small melee boost (10% boost), your defense is doubled, and upon killing a boss, you will spawn an second boss - Chattur'gha himself. If you kill him, you'll get the Expert item "Pact of Chattur'gha", which triples Melee damage. At low sanity, you get an huge boost to melee (50%), have halved defense, and get a 1/2 chance that when using a Boss Spawn item you will spawn Chattur'gha instead.

Ulyaoth - At high sanity, your Magic/Alchemy crit rate is tripled, you gain an fair boost to defense, and can craft ANYTHING on a workbench, regardless of the original station requirement needed. Do this 3 times however, gives you the "Time's a tickin'" debuff, which doesn't do anything (at first), and will allow you 5 minutes to prepare yourself when Ulyaoth spawns at the end of those 5 minutes. Killing the Ancient offers the "Throne of Ulyaoth", expert item - allowing non-Ulyaoth players to share the crafting boost for high-sanity players. At low sanity, Magic/Alchemy damage is doubled, you have half of your defense, and should it be a blood moon, Gehrman the First Hunter will spawn in as a boss. Defeating him will offer the "Threaded Cane" Expert Weapon, which is a bane against most mods for it's RMC mode.

Xel'lotath - At High sanity, your summon damage is doubled, your defense is halved, and you may spawn Xel'lotath as a boss upon using any summon weapon (1/50 chance). Killing this weak boss 5 times will spawn the True Xel'lotath boss, whom will drop the "Xel'lotath's Viewfinder" (Which allows triple the summon amount) upon her death. Low sanity doubles Minion count, doubles defense, and txet senil lliw eb desever nehw gniklat ot sretho.

Mantorok - Regardless of sanity, your Sanity ROD is cut in half. At High sanity, your ranged crit rate is tripled, you are protected with 5 purple orbs via the "Mantorok Barrier" buff, and you can craft the "Ancient's Gamble" boss spawn item, allowing you to fight Mantorok. Victory will offer the "Alex's Gladius" expert weapon, having it's damage change depending on what Ancient you worship (example: an Ulyaoth Worshipper will have this deal both Magic and Alchemy damage). At low sanity, you only lose the range crit, and "Mantorok Barrier" will now instead turn you invisible as long as you stay still.
 
Scaling has been looked over, but I avoided adding it as I guarantee you that this way sanity will become too much of a problem. I don't really want to give the players a way to increase max sanity, because I feel like 300 is enough.

You could make 200 or 250 "normal" sanity and the rest is extra sanity that will give you benefits if you manage to reach. (Always max sanity will be 300 but you need to do something special to be able to keep it at max wile regaining it up to 200 or 250 will be easier.
 
Mod updated.
CHANGELOG:
- Reduced some harsh effects of sanity a bit.
- Re-balanced daytime sanity regeneration a bit.
- Slightly re-balanced nighttime, blood moon and eclipse sanity loss
- You can no longer eat food continuously to regain sanity, I added a debuff named "Satiated" that
prevents you from regaining sanity when you have it.

The new update is out on the mod browser and is on the OP's link.
OP also updated with new info.

If you have anything to say, feel free to tell me!
 
Okay, another update for the day because I am super bored. This one should please some of you :).
This update adds configuration to the sanity mod. Of course, right now it allows you to decide some major factors, I'll add more to it soon!

CHANGELOG:
- Added configuration. Check the OP.
 
Quick heads up, this mod has been updated to tML version 0.10!
I also added a little feature where the brain meter gets grayer as your sanity goes down.

I have seen some bugs where the sanity meter (brain) is not supposed to be where it is. This update should fix it, if it doesn't then please inform me.
 
Last edited:
Buddy, unless you give either an Bloodborne (Can use sanity to summon far stronger warriors, and can use HP to restore sanity) or Eternal Darkness (having sanity tied with an chosen "Ancient") styled build around this, even I can't use this.
 
Buddy, unless you give either an Bloodborne (Can use sanity to summon far stronger warriors, and can use HP to restore sanity) or Eternal Darkness (having sanity tied with an chosen "Ancient") styled build around this, even I can't use this.
Perhaps. Items such as these may be included as an addon for the Sanity Mod, although I feel like trading HP for Sanity may be too cheaty.
 
I love the sound of this mod, and I would love to be able to include it in the super modded calamity revengeance playthrough I'm doing, but the silenced thing is just too much of a deal breaker. I'm playing as a mage and the idea that I can be entirely screwed over like that in a mod like Calamity just doesn't appeal to me.
 
I love the sound of this mod, and I would love to be able to include it in the super modded calamity revengeance playthrough I'm doing, but the silenced thing is just too much of a deal breaker. I'm playing as a mage and the idea that I can be entirely screwed over like that in a mod like Calamity just doesn't appeal to me.
Agreed.

@Trivaxy - For the above reasons and others, I propose a number of additional config options. Much of what I'm looking for from this mod is being able to change when some of these effects happen to the player -- 'Confused', 'Darkness', 'Cracking Mind', 'Silenced', etc. should all be separately configurable imo, as to the exact amount of sanity in which they trigger. Same goes for each change to the player's incoming and outgoing damage, and movement speed. I'd also love to see a few additional options for additional vanilla debuffs, such as 'Blackout' and 'Obstructed', for more extreme hindrance to vision at low sanity levels. And lastly, have an option to change the amount of maximum sanity that you start with. These are options I believe are essential to the mod, if it is to be customized to the player's liking.

Beyond that, it would be icing on the cake to see options to change the rate of sanity is lost/gained being in certain biomes, getting hit, being healed etc. It would also be interesting to see a positive side to the mod with a few custom buffs when at maximum or very high sanity, like increasing armor penetration or allow magic projectiles to pierce when they otherwise wouldn't -- something small like that.

You may intend to add many of these already; this was just some brainstorming after a playthrough with this -- I ended up wanting to tweak a vast number of parts in it. Kudos on a fantastic job with making Terraria a lot more interesting and horrifying -- hope to see you continue work on this wonderful mod. :)
 
Back
Top Bottom