Added eating animation #4169
No reviewers
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-Minecraft feature
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#4169
Loading…
Reference in New Issue
No description provided.
Delete Branch "eating_animation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's in the title. A hack of sorts, but it works well. Feedback on the animation itself very welcome, parameters are kind of random for now.
Testing
Eat some items in survival mode.
This is nice. Although the eating animation could be better if it was centered because in first person having the food go up and down at the bottom center would simulate more the feeling of it going into your mouth as oppose to making a pumping fist action with your food.
Here's what the screen UI positions feels like to me:
-Bottom right is where my right arm is. (Because of the "arm" when no item is selected)
-Bottom left is where my left arm is. (Because of the right arm symmetrically it makes sense where the left arm is even if we don't see it)
-Bottom center is supposedly somewhere in the chest area but it doesn't feel that way because you don't "see" in front of your chest IRL so it becomes somewhere at the bottom of your face i.e. your mouth.
Therefore it makes more sense to put the animation at the bottom center of the screen and if it is bigger it would simulate more the feeling that you are shoving it close to your face like when you are actually eating.
Also sometimes the original hud arm/item shows up while the "eating" animation item is visible making a duplicate item on screen. Maybe you could use the mcl_hunger.is_eating api and forbid the original hud to show up while it is true or something.
Can't place in the middle, because hotbar would be below that. If we made our own replacement, it wouldn't work on mobile.
Oh so the hotbar would move up and down with the item? Okay then I guess I'll settle with the pumping fist action in the meantime. But at least forbid the original arm/item from showing up while eating because sometimes it shows double items.
Hotbar would be covered by the item.
Is there a way for it to be the other way around and make the item be covered by the hotbar instead? Or another way would be to put the item just on top of the hotbar and below the crosshair since the size is small enough without enlargement in my initial comment.
The whole thing is MTE doesn't let you have the default hud elements cover custom elements (i.e. custom hud always covers default hud). And if we made a custom hotbar to replace the default one, it wouldn't work on mobile.
And placing the item in the middle of the screen would be annoying tbh.
Then I guess either placing it just on top of the hotbar or at the bottom right are the remaining options. And I think even though top hotbar seems annoying on paper we never know until we try it out in the wild as we already have preconceived tolerance IRL about the inconvenience of eating and especially drinking with it covering the lower part of our vision.
Let's try give the top hotbar a test run first while not thinking of it as annoying like how new players get in a new game not already getting ready to be bothered by certain things. We can always resort to the other stuff later if we still find it annoying after all that.
mods/PLAYER/mcl_hunger/init.lua Line 323 & 324: (Before:
if eat_effects_cooldown[player] > 0.2 then
)@the-real-herowl Tried eating with the addition of the code above in this PR and it seems fine in my eyes with the added bonus of diverting the attention towards the middle screen so that any double hud item glitches from the lower right side of the screen is less noticeable. See if you're fine with it too.
EDIT:
Summary of reasons for adding the code above in this PR:
The animation sometimes covers the hotbar a bit, but it's for a split second and only partially. Haven't tested this on mobile yet. Not even sure if eating is possible on mobile with the delay. Also, haven't managed to reproduce the "wielded item appearing while eating" bug.
Haven't tried your new changes yet but to answer your comment, I've tested eating while being attacked by a mob so that I can try eating almost constantly as my health is always down and sometimes I right-click erratically because of that. Maybe you can reproduce the wield item glitch by right-clicking erratically too. Maybe add double to triple right clicks and sometimes mess up the timing and see if the lower right item hud appears while eating.
And on the question of mobile, if you meant the new eating mechanic as a whole and not the animation then I've tested eating on at least one mobile device and it works fine. On mobile you have to double tap and hold the second tap while a food is selected in the hotbar.
@the-real-herowl I've tested the new changes now and while it seems fine on PC, on mobile it covers a huge portion of the screen so the image should probably be scaled down a bit.
Here's what I've adjusted in the code to make it look fine on both mobile and PC:
mods/PLAYER/mcl_hunger/init.lua Line 135 & 136:
Will merge this in a few days if nobody voices any concerns.
This has been looking good to me on PC.