yeelp / Scaling-Feast

A simple, balanced way to increase your maximum hunger in Minecraft over the course of a world.
MIT License
0 stars 1 forks source link

[Suggestion] Hearty Shank & Max Hunger attribute cap? #101

Closed SonicX8000 closed 3 years ago

SonicX8000 commented 3 years ago

Basically a cap of how many Hearty Shanks you can eat before it wouldn't increase your max hunger anymore, meaning you can still gain extra hunger from other means.

Max Hunger attribute cap would be the same way, you can gain x max hunger via attribute boosts like quality tools before it stops increasing your max hunger.

These would still respect the global cap so the player doesn't gain too much hunger.

P.S. Would it be do-able to prevent a requirement of restarting the game if changing certain values around? Like when editing the hunger efficiently & max hunger from Spice of Life as well as changing the global cap around & such.

yeelp commented 3 years ago

I had genuinely thought I had replied to this a long while ago.

Let me start with the easy part: Configs. It is possible to set some values to not require a game restart, I just need to update values under the hood when it happens.

My initial concern was I certainly didn't want to iterate through a player list and update certain things like max hunger when the value changed. A game restart worked well because when a player joined the world, I could just check their hunger and saturation values then and update them accordingly if the violated new hunger and saturation "rules". Well it turns out I still need to update and cap player saturation every tick because of potion effects and saturation scaling and the like, so it's not too much worse to just check max hunger at the same time and cap it appropriately.

tl;dr I was being overly cautious, hence the game restart required. could've set it to a world restart, but I was unaware of the flag at the time.

Moving on, a Max Hunger attribute cap is possible and in fact very easy to implement (but will absolutely require an unavoidable game restart). The problem is information in tooltips would now be misleading, and I can't do anything to control it.

Example: Say the max hunger attribute is capped at 10, and I have an armor piece that increases my max hunger by 15. The tooltip says "+15 Max Hunger" but I (the unknowing player) put it on and only gain +10 max hunger. As the unknowing player, that leaves me confused. "The tooltip says '+15 Max Hunger'! What's the deal?". If I'm playing a modpack, I go to the modpack issue tracker and post an issue about it there. Maybe I also come to Scaling Feast's GitHub and post and issue there too if I'm savvy enough. Then both me (as the mod author) and the pack developer explain that this is intentional behaviour and everything is working as normal, then close the issue, only for someone else to open another one some other time about the same thing.

^This aforementioned scenario is something I'd like to avoid.

A cap to the max hunger attainable by a Hearty Shank would be more feasible, since I can potentially alter the tooltip when it no longer provides bonus hunger, although I would need to do so in a roundabout way. I can potentially see some niche uses so it's worth considering.

SonicX8000 commented 3 years ago

Yea, max hunger attribute cap would lead to some confusion but the hearty shank not offering anymore boosts would be more preferred, much like how scaling health does it with their hearts not increasing health anymore for it's own health attribute if you reached the cap the config is set at.

That reminds me... I wonder if Max Hunger / Food Efficiency can be increased depending on your Levels, much like how Scaling Health can increase Max Health if you have a bunch of levels but the boost is removed if you spent those levels for enchantments & such.

yeelp commented 3 years ago

I'm not sure exactly how Scaling Health does it, but I've just about finished my own implementation, choosing to instead count the number of times the Hearty Shank has been consumed and allow end users to put a configurable cap on that (So for example, it could be configured so a player could only gain max hunger from the Hearty Shank 5 times total).

I've thought about "gaining max hunger based off XP" for a long while since development started close to a year ago. I'm unsure if such a feature (which is unique to ScalingHealth) makes this mod feel a little too "samey", so I haven't made up my mind on adding it or not. I don't think it ultimately wouldn't be too hard to add if I chose to.