The Mood bar

So, I have noticed that once you hit insanity, for mood, you have a certain amount of time before the moodlet text bugs out and you become perma stuck in insanity, giving you a massive movement debuff, is this intentional? or is it a bug?

Insanity is permanent, I think. Don’t take hypersensitive if you don’t wanna babysit your mood

1 Like

It’s a bug; it shouldn’t be blank, and unstable supposedly changes so that “you are unable to recover your sanity if you lose it”.

therefore normally you should be able to recover your sanity if you lose it.

yedrtufygkuhil

2 Likes

insanity is a permanent loss of mood, that’s the point

Then why have the unstable perk? What is it supposed to do, if not that?

1 Like

Unstable seems like 2 free trait points if everyone already can’t recover their sanity.

6 Likes

If it’s meant to be a permanent loss of mood, why is the interface so fucky. You’d at least think they’d have a line of text for it.

1 Like

Okay, I think I found the issue

Sanity Code
///Called on SSmood process
/datum/component/mood/process(delta_time)
	var/mob/living/owner = parent
	switch(sanity)
		if(SANITY_GREAT-1 to INFINITY)
			setSanity(sanity+sanity_modifier*delta_time*mood-0.4)
		if(SANITY_NEUTRAL-1 to SANITY_GREAT-1)
			setSanity(sanity+sanity_modifier*delta_time*mood-0.2)
		if(SANITY_DISTURBED-1 to SANITY_NEUTRAL-1)
			setSanity(sanity+sanity_modifier*delta_time*mood)
		if(SANITY_UNSTABLE-1 to SANITY_DISTURBED-1)
			setSanity(sanity+sanity_modifier*delta_time*mood+0.3)
		if(SANITY_CRAZY-1 to SANITY_UNSTABLE-1)
			setSanity(sanity+sanity_modifier*delta_time*mood+0.6)
		if(SANITY_INSANE-1 to SANITY_CRAZY)
			setSanity(sanity+sanity_modifier*delta_time*mood+0.9)
	HandleNutrition(owner)

In this code, the sanity values all have -1 attached to them for this formula specifically. If you bottom out your mood, this formula can spit out a negative value for your new sanity, which works within itself but doesn’t work for any of the other formulas. For instance

Code that controls how the UI prints
/datum/component/mood/proc/print_mood(mob/user)
	var/msg = "<span class='info'><EM>Your current mood</EM>\n"
	msg += "<span class='notice'>My mental status: </span>" //Long term
	switch(sanity)
		if(SANITY_GREAT to INFINITY)
			msg += "<span class='nicegreen'>My mind feels like a temple!<span>\n"
		if(SANITY_NEUTRAL to SANITY_GREAT)
			msg += "<span class='nicegreen'>I have been feeling great lately!<span>\n"
		if(SANITY_DISTURBED to SANITY_NEUTRAL)
			msg += "<span class='nicegreen'>I have felt quite decent lately.<span>\n"
		if(SANITY_UNSTABLE to SANITY_DISTURBED)
			msg += "<span class='warning'>I'm feeling a little bit unhinged...</span>\n"
		if(SANITY_CRAZY to SANITY_UNSTABLE)
			msg += "<span class='boldwarning'>I'm freaking out!!!</span>\n"
		if(SANITY_INSANE to SANITY_CRAZY)
			msg += "<span class='boldwarning'>AHAHAHAHAHAHAHAHAHAH!!!</span>\n"

This doesn’t account for negative sanity, which would result in the lack of printed text that we see when the bug occurs.

Assuming all of these moodlets in Maggot’s screenshot add up to about +20 or so, the formula for calculating his sanity every mood tick would look something like this.

sanity+sanity_modifier*delta_time*mood+0.9
(-3+0.05*20+0.9), 

which would result in a sanity value of -59, give or take.
I think I know the exact PR that broke it too.

This pull request refactored mood to be multiplied into your sanity change formula, and since you can get negative mood and low sanity, this means you can get negative numbers now, where you couldn’tve before.

OKAY ERRATA I’M STUPID
I think the bug ACTUALLY arises when you get a sanity value of below -1. Then it fails all the checks in the sanity adjustment formula, and can never change again, getting frozen at a negative value. The fix is actually really simple, I think.

4 Likes

https://github.com/BeeStation/BeeStation-Hornet/pull/10574
fixed it maybe???

okay this link works

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.