Somnia Awoken

Somnia Awoken

27.3k Downloads

[Request] Configuration for adding fatigue-reducing items/optional limits for fatigue-reducing items

Whiskey-Sunshine opened this issue ยท 13 comments

commented

As the title suggests: implement a configuration file to add or remove items that can reduce fatigue when consumed, and an option to penalize or prevent overuse of fatigue-reducing items. (Currently using the 1.12.2 versions)

The first part - additional control over items with fatigue reducing (or increasing) items: The implementation of coffee items reducing fatigue has been a godsend, but there have been a large amount of other caffeinated beverages from other mods (Such as teas, sodas, and energy drinks, seen in: PHC, Simply Tea, Tea: The Story, and XL Food Mod to name a couple) that I noticed and tend to use far more often that should be able to apply the same effect, or even relaxing beverages to increase fatigue, such as the dandelion and chamomile tea from Simply Tea. I can see this implemented as a .json so users can set the item parameters themselves and allow greater control over fatigue-reducing items.

The second part - config option to prevent overuse of fatigue-reducing items: I do want to emphasize the optional part of this, but the idea behind it is the fact that no matter how much coffee you drink, you can't push yourself forever on no sleep. Eventually, it will catch up and you'll crash, or just become too tired to continue without proper sleep.

The first, more complicated idea is a cumulative multiplier to the fatigue rate that ticks up each time an item is used to reduce fatigue, that is reset once the player sleeps properly. Starting low or with no multiplier on the first (So your first cup of coffee or tea that day won't affect it), and creeping up to a high rate over time with configurable scaling and maximums. This way you can prevent players from staying awake forever just by repeatedly drinking espresso, but not removing the ability to push beyond normal limits without sleep for a while.

The second, simpler idea, is simply putting a configurable limit on how many fatigue reducing items can be consumed or how much fatigue can be recovered through items before you can't benefit from it any more, requiring sleep to reset the uses.

Both of these ideas struck me at the same time after seeing the coffee item support added just recently after updating my private modpack, and thought I might offer them up for consideration. And thank you for what may be the best sleep mod for minecraft I have ever used!

commented

yes-yes-yes and double yes please. ways to increase and decrease fatigues and set what can do it (partly so you don't have to do it yourself and think of everything. ;) ) would be wonderful. I also wouldn't mind the limiter that causes drinks to increase fatigue rate after their use to dissuade over spam also maybe on a case by base basic?

like say settings for:
Maximum fatigue positive or negative multiplier. (rate of gaining fatigue)
Maximum Resting Positive or negative multiplier. (rate of removing fatigue once you actually sleep)
Fatigue level required during sleep to reset all multipliers to base. (cut off point to be well rested again)

then a registry thingy like:
"[modid:item*(meta/wildcard)], [fatigue +/- flat], [fatigue rate percentile increment +/-], [rest rate percentile increment +/-]"

^ so you can end up with items to increase or decrease rate of fatiguing. but theres a hard maximum either direction the multiplier can go so you can't over buff.

commented

The first part - additional control over items with fatigue reducing (or increasing) items: The implementation of coffee items reducing fatigue has been a godsend, but there have been a large amount of other caffeinated beverages from other mods (Such as teas, sodas, and energy drinks, seen in: PHC, Simply Tea, Tea: The Story, and XL Food Mod to name a couple) that I noticed and tend to use far more often that should be able to apply the same effect

This has been implemented now. Items will be configured inside the common config file, using an object array. The first element is the registry name of the item, in the form of <modid>:<name> (String), and the second one is the amount of fatigue it replenishes (double). In 1.12, you can also define metadata by appending @<metadata> to the item name.
Additional parameters will be added with the implementation of the next parts

or even relaxing beverages to increase fatigue, such as the dandelion and chamomile tea from Simply Tea.

Should be possible by defining a negative fatigue replenish number

commented

The first, more complicated idea is a cumulative multiplier to the fatigue rate that ticks up each time an item is used to reduce fatigue, that is reset once the player sleeps properly. Starting low or with no multiplier on the first (So your first cup of coffee or tea that day won't affect it), and creeping up to a high rate over time with configurable scaling and maximums. This way you can prevent players from staying awake forever just by repeatedly drinking espresso, but not removing the ability to push beyond normal limits without sleep for a while.

Great idea! I can think of 2 versions of this:

  • A constant multiplier modifier defined for each item
  • A base multiplier defined for each item, which would be then multiplied by n for the amount of fatigue the player replenished during this "sleep period".
    For example: You drink a coffee with a base multiplier of 0.01, but since you drank 3 coffees already (and replenished 15 fatigue), the actual multiplier will be 0.03

so you can end up with items to increase or decrease rate of fatiguing

For decreasing the fatigue multiplier, it would be nice to also have a duration defined. Maybe I could make it an actual potion effect, but that would descrease configurability of the multiplier. What do you think?

commented

A duration based potion that increases or slows fatigue rate could be pretty good. all seems fine to me but see what whiskey thinks I guess. :)

commented

A base multiplier defined for each item, which would be then multiplied by n for the amount of fatigue the player replenished during this "sleep period".
For example: You drink a coffee with a base multiplier of 0.01, but since you drank 3 coffees already (and replenished 15 fatigue), the actual multiplier will be 0.03

This is entirely what I had in mind, absolutely. I am so on board.

commented

For decreasing the fatigue multiplier, it would be nice to also have a duration defined. Maybe I could make it an actual potion effect, but that would descrease configurability of the multiplier. What do you think?

As for this, I feel like being able to slow the fatigue rate would be a much later game thing, likely around potion brewing stages. That way it's more of an investment and something to work for, as slowing fatigue rate can be very useful for long distance travel through dangerous locations/dimensions where you can't sleep otherwise. Possibly a potion of insomnia as a name?

commented

Possibly a potion of insomnia as a name?

I think the definition of insomnia - "inability to obtain sufficient sleep" doesn't really fit the purpose of the potion.
How about "untiring"?

commented

insomnia would be a debuff that can be put on you that stops you sleeping even if you want to giving rise to potentially being stuck in negative effects.

commented

How about "untiring"?

How about Wakefulness, Invigoration, or "of the Night Watch"? Just flinging ideas at this point. Seems like the core concept has been handled well enough.

commented

A base multiplier defined for each item, which would be then multiplied by n for the amount of fatigue the player replenished during this "sleep period".
For example: You drink a coffee with a base multiplier of 0.01, but since you drank 3 coffees already (and replenished 15 fatigue), the actual multiplier will be 0.03

Alright, this is done. The last thing left to do is the potion effect.
The name "Wakefulness" sounds good to me. Now we gotta figure out the potion icon and recipe.

commented

The name "Wakefulness" sounds good to me. Now we gotta figure out the potion icon and recipe.

For the icon: A steaming cup of coffee, or a generic "energy drink" can might work? Either that or an eye in a similar vein to the blindness/night vision icons with a lightning bolt in it (like the moon in the night vision icon). Partial to the second idea, myself.

As for recipe, a vanilla friendly option could be honey bottles or something similarly farmable with effort (cocoa beans? maybe too easy), to avoid having to add new items or rely on other modded items.

commented

an eye in a similar vein to the blindness/night vision icons

How about this:
wakefulness icon
And for the recipe, I'd go with a combination of night vision and another item:

  • Night Vision (3:00) + Glistering Melon -> Wakefulness Potion (2:00)
  • Night Vision (8:00) + Glistering Melon -> Wakefulness Potion (3:00) // Maybe buff to 4:00?
  • Wakefulness Potion (2:00) + Blaze Powder -> Wakefulness Potion II (2:00)
commented

now hit it with a fermented spider eye to make insomnia or restlessness which is an eye with red veins from a lack of sleep which stops you from sleeping while it's active and makes you tired (if wakefulness reduces fatigue). :3