Madis0 / OneBar

A Minecraft HUD mod for Fabric Loader
Other
8 stars 2 forks source link

Add a saturation indicator #16

Closed alexmozaidze closed 3 years ago

alexmozaidze commented 3 years ago

Add an option to make the thin bar below health to display current saturation. I find myself not knowing when I'll get hungry when I use the mod, which leads to me guessing on wether should I sprint or not with my limited food supply, saturation indicator would fix that issue.

Madis0 commented 3 years ago

I really want to understand the use case instead of adding another bar/number, in order to make its display more contextual. Right now I have an option in settings

Zero saturation (optional) - no bar, ↓ - shows when saturation is 0 and hunger will decrease with activity

Does that fix your use case?

alexmozaidze commented 3 years ago

The option you recommended is not the thing I want as it only shows that you're on the way to starving or that you started to starve already. Saturation is 2 things: your potential regen and the second hunger bar. It's better to know how much saturation you have at all times because otherwise you won't know how far you can run without the need to eat, or how much you'll regenerate before you take damage. Current thing with regen estimation is cool, but it only estimates after you take damage, which is not enough in some cases.

Madis0 commented 3 years ago

Alright. Here's an idea I came up with: how about the saturation is a decimal point to hunger?

So let's say your hunger is 17, therefore your max saturation is 17 as well. Your actual saturation is 13, which is ~76.5% or ~0.8. Therefore your "hunger" would be 17.8.

Now because OneBar displays the hunger loss instead of the one you have, it would display 3.2 in the bar and number. And no, I'm not yet sure how would I indicate 0% saturation 😄

Would that make sense and be helpful to you?

Reference: https://minecraft.fandom.com/wiki/Hunger#Mechanics

alexmozaidze commented 3 years ago

That would work pretty well for non-combat use, but if we want to estimate how much we can tank with current saturation, we'd have to manually calculate the percentages into saturation and then roughly to how much it would regenerate, that's pretty inconvinient. Also, say the hunger bar is full, where the the saturation indicator would go? Would it disappear with the hunger or will it display as 0.2,?

Here's a new idea: You know that when you are hungry the health bar kinda gets darker from right to left? So, what about taking this idea and fllipping it? Like, health bar has red color, but gets overlayed by hunger and saturation bars, which have colors brown and light brown respectivly. Saturation bar overlay would appear from the left, indicating the current value (like health bar does), additionaly having saturation points appear on left as well would be quite fitting, I think.

The coolest thing here is that saturation cannot be greater than hunger, which means that in normal circumstances hunger and saturation bars won't overlay. (of course through use of commands and some mods it's possible to make saturation greater than hunger so I think in that case saturation bar should overlay hunger bar)

Madis0 commented 3 years ago

That would work pretty well for non-combat use, but if we want to estimate how much we can tank with current saturation, we'd have to manually calculate the percentages into saturation and then roughly to how much it would regenerate, that's pretty inconvinient.

So you're saying the actual number of saturation still matters more than the percentage. Then please, elaborate like this: "If I had at least X saturation, I'd know that I can do Y, however if I had..."

Also, say the hunger bar is full, where the the saturation indicator would go? Would it disappear with the hunger or will it display as 0.2,?

Hunger bar would max out at 21 and because you rarely get full saturation, you'd see the brown overlay most of the time.

You know that when you are hungry the health bar kinda gets darker from right to left? So, what about taking this idea and fllipping it?

Yeah, that would work if the hunger bar worked the same as the health bar or if they were separate (pretty much what AppleSkin does with vanilla hunger bar). However, the whole reason I made hunger and other bad things go from right to left is that you only care about the division, not the sum like you would for health.

So if your health is 17, you care about that 17 and make sure not to lose it. But if your hunger is 17, you care about the 3, because that is how much have to eat to restore it.

Madis0 commented 3 years ago

Anyway, I have a test build in Actions tab (use the jar without "dev" and "sources"), which illustrates how my idea would look like. The decimals are not yet rounded to one place and 1.0 saturation loss is 0.99.

alexmozaidze commented 3 years ago

So you're saying the actual number of saturation still matters more than the percentage. Then please, elaborate like this: "If I had at least X saturation, I'd know that I can do Y, however if I had..."

If I had at least 7 saturation, I'd know that I can take more risks than usual (going off mountain without worrying about fall damage too much, facing off horde of mobs in an aggresive manner, e.t.c.), however if I had 0-2 saturation then I'd be more careful knowing my regeneration will be slow if I take any damage.

Hunger bar would max out at 21 and because you rarely get full saturation, you'd see the brown overlay most of the time.

I've tried the build and it looks really wierd. Seeing the brown bar and the number that's usualy "0.something" almost all the time is very uncomfortable.

Yeah, that would work if the hunger bar worked the same as the health bar or if they were separate (pretty much what AppleSkin does with vanilla hunger bar). However, the whole reason I made hunger and other bad things go from right to left is that you only care about the division, not the sum like you would for health.

The thing is that knowing the sum of saturation is much better than the division or percentage, as it's basically acting as health and hunger simoltaniously, that's why I suggested to make the saturation bar (not hunger bar) go from left to right.

So if your health is 17, you care about that 17 and make sure not to lose it. But if your hunger is 17, you care about the 3, because that is how much have to eat to restore it.

I suppose that you're saying that hunger is the main indicator of when to eat, and that's minimum of what's needed, and yes it is bare minimum of necessary info. But when making decisions that would take away health or a lot of hunger, saturation comes into play most of the time, and knowing how much saturation you have often is better than knowing same thing for hunger, as hunger is kind of a second layer that acts as a "backup" for when you don't have enough saturation. Hunger just doesn't come into play as often as saturation does, especially in health regeneration.

Madis0 commented 3 years ago

https://github.com/Madis0/OneBar/suites/3323884058/artifacts/77874165

So, I've added a orange bar from left to right. The value is displayed like +⚡1 when it exists (flash symbol because saturation works like stamina). There is also a temporary option "saturationThin" to toggle whether it overlays the health or is a thin bar below. The thin bar currently conflicts with held food indicator, so you may want to disable it.

Questions:

alexmozaidze commented 3 years ago

Thin vs overlay? Why?

Thin > overlay. Overlay distracts from the main bar.

What do you think about the text indicator? If there is a bar, is seeing the number necessary at all?

The text is certainly very handy, but not necessary. I'd say it's better if in the default config the bar was on, while text was off, because if you're not taking noticable amount of damage regularly - text is not needed.

Which color and why? I use this pallette and you can test in settings

The color used for the bar is good for overlay, but it blends with the environment when using thin bar. While experimenting with the colors, I changed the color of the bar to #f6f9a825 (aka the same color but more opaque) and the resulting color was standing out enough for me to easily estimate how much stamina I have, even without text.

Madis0 commented 3 years ago

Thin > overlay. because if you're not taking noticable amount of damage regularly - text is not needed.

Great, that's what I was thinking as well! Looking at it now, it complements the armor bar, so I might just use it in my game as well 😁 (but it will be opt-in regardless to reduce confusion).