mojira.dev
MC-233603

HUD / Hotbar rendering can heavily impact frame rate performance

The game experiences a large frame rate decrease when there's a large amount of HUD/hotbar elements displayed on the screen, in this case hearts. I assume this is also the case with other elements like the hunger, armor, and oxygen icons, but only noticeable with hearts due to the use of certain effects (health boost & absorption) at high amplifiers, as well as with the use of the max_health attribute. Fairly small example:

[media]

[media]

As can be seen in the images the performance hit is somewhat high just for a few more hearts added to the screen. Apparently each element (heart/hunger/defense icon) is counted as a draw call, and this number can increment in certain survival scenarios, making rendering of a simple status bar resource intensive. Even more intensive if items are rendered on the slots (MC-233604).

I considered this a different issue from MC-10755 for two reasons:

  1. There aren't any uninteded effects at high amplifiers gameplay-wise, and can be reproduced with the max_health attribute, not only effects.

  2. This is a performance concern with something as simple as the HUD, which as i said before can be reproduced in a survival setting.

While this issue might not be very noticeable in vanilla at first hand, some servers and datapacks make use of high health effects, making this issue very apparent. Here you can see the worst case scenario to demonstrate how it can impact frame rate times:

[media]

[media]

You can only imagine how many draw calls are being made here to end up with these frame times in a void world. You can also check the attachments for more examples. Word from some modders say that this can be mitigated by applying batching when rendering the status bar.

How to reproduce

  1. Create a void world, and run either one or both of the next commands.

  2. /effect give @s minecraft:absorption 100 255 true
  3. /attribute @s minecraft:generic.max_health base set 1000
  4. Press ALT+F3 and notice the lag on the FPS graph.

Linked issues

Attachments

Comments 9

anthony cicinelli

Thank you for your report!
We're tracking this issue as MC-10755, so this ticket is being resolved and linked as a duplicate.

That ticket has already been resolved as Won't Fix, which means this is considered a bug but won't be fixed. The description of that ticket or the comments might explain the rationale. Please do not leave a comment on the linked ticket.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

syarumi

You could say it is a duplicate, but i'd argue that in this case it is different because these two effects, unlike the other ones, can effectively cause client-side performance degradation and even in some cases it could crash the game, i can see this being the case on servers where this can't be controlled by the player directly.

From what i understand, i think MC-10755 is more tied to the gameplay perspective (due to how high levels of effects don't work as intended). While here we're talking of the performance perspective, because the more rows of hearts are shown, the worse. It can even apply on low levels like 10 or 5, but the degradation isn't as drastic. So i don't think it would be correct to close it as a dupe.

ampolive

This was previously reported as MC-231504, and it was marked as a duplicate of MC-10755.

syarumi

@unknown i've checked, yeah, it seems i couldn't find it when searching, but my point on my previous comment still stands.

syarumi

After some time of thinking, i still think this should be reopened, same reasons as my previous comment above.

Also, another reason as to why this is not a duplicate is that this issue can be reproduced without status effects, as you only need to use the /attribute command to change the max_health value to the max value.

I haven't seen a statement on which attributes with the max value aren't supported, and it's also even used for datapacks.

Mohammad Sarabi

Can confirm on 1.18.1

hmc

How is this duplicate of MC-10755

ampolive

@unknown See this comment. It was resolved as a duplicate because there is no way to verify this without giving yourself effects/attributes way above the default values. However, this is now considered to be a separate issue.

syarumi

This seems to be fixed in 24w33a.

[media]

syarumi

(Unassigned)

Confirmed

Performance

hotbar

1.17.1, 1.18.1, 22w06a, 1.18.2, 22w11a, ..., 1.20.1, 23w31a, 1.20.2, 23w44a, 1.21.1

24w33a

Retrieved