Added eating animation #4169

Merged
the-real-herowl merged 3 commits from eating_animation into master 2024-04-22 03:18:13 +02:00

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.

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.
the-real-herowl added this to the 0.87.0 - Prismatic milestone 2024-01-29 04:26:23 +01:00
the-real-herowl added the
graphics
gameplay
#P4 priority: medium
labels 2024-01-29 04:26:23 +01:00
the-real-herowl added 1 commit 2024-01-29 04:26:26 +01:00
Contributor

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.

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.
Author
Owner

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.

> 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.
Contributor

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.

> 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.
Author
Owner

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.

> 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.
Contributor

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.

> 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.
Author
Owner

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.

> > 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.
Contributor

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.

> 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.
Contributor

mods/PLAYER/mcl_hunger/init.lua Line 323 & 324: (Before: if eat_effects_cooldown[player] > 0.2 then)

				player:hud_change(mcl_hunger.eat_anim_hud[player_name], "position", {x = 0.611, y = 0.85})
				player:hud_change(mcl_hunger.eat_anim_hud[player_name], "scale", {x = -17.25, y = -30})

@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:

  • Original arm/item HUD appearing while eating glitch is less noticeable due to attention being diverted to the center screen.
  • Original PR food item on the lower right side screen is a picture and not affected by darkness at night so the transition from non-eating to eating is glaring. Middle screen hotbar is always bright so there is no contrast when the food item appears above it.
  • The code above makes the item smaller in the lower center screen and potentially less annoying if at all.
  • For some reason the code above makes the eating animation be actually behind some hud elements like armor, breath, health and hunger icons.
  • Lower center eating animation simulates eating more than the pumping fist action of the original PR.
mods/PLAYER/mcl_hunger/init.lua Line 323 & 324: (Before: ` if eat_effects_cooldown[player] > 0.2 then`) player:hud_change(mcl_hunger.eat_anim_hud[player_name], "position", {x = 0.611, y = 0.85}) player:hud_change(mcl_hunger.eat_anim_hud[player_name], "scale", {x = -17.25, y = -30}) @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: - Original arm/item HUD appearing while eating glitch is less noticeable due to attention being diverted to the center screen. - Original PR food item on the lower right side screen is a picture and not affected by darkness at night so the transition from non-eating to eating is glaring. Middle screen hotbar is always bright so there is no contrast when the food item appears above it. - The code above makes the item smaller in the lower center screen and potentially less annoying if at all. - For some reason the code above makes the eating animation be actually behind some hud elements like armor, breath, health and hunger icons. - Lower center eating animation simulates eating more than the pumping fist action of the original PR.
the-real-herowl added 1 commit 2024-02-02 04:28:56 +01:00
Author
Owner

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.

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.
Contributor

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 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.
Contributor

@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:

		position = {x = 0.5, y = 0.925},
		scale = {x = -17.25, y = -30},
@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: position = {x = 0.5, y = 0.925}, scale = {x = -17.25, y = -30},
the-real-herowl added 1 commit 2024-04-14 08:35:02 +02:00
e582c3bb97 Improved look on the mobile device
Now the food doesn't cover the full screen on mobile devices...
...at the cost of stretching at ultrawide or portrait aspect ratios.
Author
Owner

Will merge this in a few days if nobody voices any concerns.

Will merge this in a few days if nobody voices any concerns.
Member

This has been looking good to me on PC.

This has been looking good to me on PC.
the-real-herowl merged commit 9e8661ae95 into master 2024-04-22 03:18:13 +02:00
the-real-herowl deleted branch eating_animation 2024-04-22 03:18:14 +02:00
Sign in to join this conversation.
No reviewers
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#4169
No description provided.