Skip to content

Make melatonin make sense#85154

Merged
Maleclypse merged 3 commits intoCleverRaven:masterfrom
Manushenkov:melatonin
Feb 8, 2026
Merged

Make melatonin make sense#85154
Maleclypse merged 3 commits intoCleverRaven:masterfrom
Manushenkov:melatonin

Conversation

@Manushenkov
Copy link
Contributor

Summary

Balance "Melatonin makes sense now"

Purpose of change

Melatonin buffing sleep deprivation recovery rate wasn't justified, It was just a hasty renaming of magnesium at the time #37317 (comment)

Describe the solution

It is a sleep hormone that makes you sleepy, so now it gives you an immediate gamey +20 sleepiness, a more realistic passive ticking sleepiness effect (only when awake), slows down your perceived tiredness recovery by 10% (while sleeping), and increases the maximum time asleep from 10 to 12 hours. The changes basically make it a better sleeping pill, a bit slower and with more inertia, it still helps you recover from sleep deprivation by allowing you to sleep longer, and you can heal more wounds due to how wound heal faster while you're asleep

Describe alternatives you've considered

Make it affect sleep deprivation levels directly, but it's really not what melatonin is about

Testing

Spawned, popped 10 melatonins, slept for 12 hours right away. Not really how it's supposed to work but it's fine imo

@github-actions github-actions bot added Game: Balance Balancing of (existing) in-game features. [JSON] Changes (can be) made in JSON Items: Food / Vitamins Comestibles and drinks [C++] Changes (can be) made in C++. Previously named `Code` astyled astyled PR, label is assigned by github actions labels Feb 6, 2026
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Feb 6, 2026
@I-am-Erk
Copy link
Member

I-am-Erk commented Feb 6, 2026

This is OK as a start but I'd really like it to not be dose-dependent. Taking more than one melatonin doesn't do much of anything.

@Manushenkov
Copy link
Contributor Author

Manushenkov commented Feb 6, 2026

This is OK as a start but I'd really like it to not be dose-dependent. Taking more than one melatonin doesn't do much of anything.

Is that your personal experience? Because mine's different. I'm not very comfortable with instant -20 sleepiness either but i somehow need to represent that taking more than you should will have side effects (in our case it's represented by more sleepiness the next day). The current dose isn't specified so it might as well be sub 0.5 mg

@I-am-Erk I-am-Erk marked this pull request as ready for review February 6, 2026 22:03
@I-am-Erk
Copy link
Member

I-am-Erk commented Feb 6, 2026

This is OK as a start but I'd really like it to not be dose-dependent. Taking more than one melatonin doesn't do much of anything.

Is that your personal experience? Because mine's different. I'm not very comfortable with instant -20 sleepiness either but i somehow need to represent that taking more than you should will have side effects (in our case it's represented by more sleepiness the next day). The current dose isn't specified so it might as well be sub 0.5 mg

It's my experience administering it in a wide population, I don't use it myself but regularly advise people on its use. This paper outlines what I mean:

The dose-dependence of melatonin's effect on sleep is within physiologic or low pharmacologic range, i.e. 50–200 pg/ml in blood plasma. Increasing melatonin above these levels does not increase melatonin efficacy but may cause side effects, e.g. circadian rhythm alterations.

Unless melatonin tabs are different in the eastern US, I would assume they come in 3-10mg tabs most of the time, and for the most part there's little evidence of any difference in efficacy even within that range, let alone higher.

@Manushenkov
Copy link
Contributor Author

If we're talking 3mg minimum, yeah it's already well into side-effect zone i think, i'll convert this back to draft and do some more work on it later. I was coming from my personal experience splitting 3mg tablets in half and quarters but that might not be representative of average use

This is OK as a start but I'd really like it to not be dose-dependent. Taking more than one melatonin doesn't do much of anything.

Is that your personal experience? Because mine's different. I'm not very comfortable with instant -20 sleepiness either but i somehow need to represent that taking more than you should will have side effects (in our case it's represented by more sleepiness the next day). The current dose isn't specified so it might as well be sub 0.5 mg

It's my experience administering it in a wide population, I don't use it myself but regularly advise people on its use. This paper outlines what I mean:

The dose-dependence of melatonin's effect on sleep is within physiologic or low pharmacologic range, i.e. 50–200 pg/ml in blood plasma. Increasing melatonin above these levels does not increase melatonin efficacy but may cause side effects, e.g. circadian rhythm alterations.

Unless melatonin tabs are different in the eastern US, I would assume they come in 3-10mg tabs most of the time, and for the most part there's little evidence of any difference in efficacy even within that range, let alone higher.

@Manushenkov Manushenkov marked this pull request as draft February 6, 2026 22:07
@I-am-Erk
Copy link
Member

I-am-Erk commented Feb 6, 2026

I don't think you need to change too much, I'd just leave the dosage out entirely and don't have the effect stack to multiple levels. taking a single melatonin tab gives you a sleepiness boost and makes you sleep longer, that's a bit gamey but not that terrible. Taking multiple melatonin tabs does nothing more except use up your melatonin.

I would have to check the numbers but I think melatonin, vs a sleeping pill, should let you sleep longer and get slightly better rest, while a sleeping pill knocks you out more but actually reduces the restfulness of your sleep somewhat.

@Manushenkov
Copy link
Contributor Author

I don't think you need to change too much, I'd just leave the dosage out entirely and don't have the effect stack to multiple levels. taking a single melatonin tab gives you a sleepiness boost and makes you sleep longer, that's a bit gamey but not that terrible. Taking multiple melatonin tabs does nothing more except use up your melatonin.

Whoops i overwrote my only commit

I removed immediate effects, instead sleepiness recovery rate went from 0.9 to 0.8, and i hardcoded a buff to falling asleep. Taking more than 1 does literally nothing

@Manushenkov Manushenkov marked this pull request as ready for review February 6, 2026 22:29
@anoobindisguise
Copy link
Contributor

I don't think you need to hardcode this. Have the item give you an effect at maximum intensity and duration, which has an enchantment effect of SLEEPY. There's also an enchant for sleep efficiency though I forget the name atm.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 7, 2026
@Maleclypse Maleclypse merged commit 5be4d2d into CleverRaven:master Feb 8, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. Items: Food / Vitamins Comestibles and drinks [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants