Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-109299

Experience orb accumulation causes excessive lag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.20.0
    • 1.16.100, 1.16.200, 1.19.50
    • None
    • Community Consensus
    • Multiple
    • 448558

      xp_orb entities cause significant lag when they accumulate in mobs farms. This seems to be because they have mob collision boxes. The game has to repeatedly calculate their collisions with each other and with mobs. Most mobs drop 3 xp_orb each upon death, so the number of collisions being calculated increases exponentially as a mob farm runs. By contrast, item drops do not produce nearly as much lag because they do not have mob collision. I would expect xp_orb entities to interact with block collision boxes, pistons, and liquids like item entities do, and not to overload the game server and client with mob collision calculations.

      The attached test world, XP lag.mcworld, can be used to compare lag produced by item entities and xp_orb entities. It consists of repeat command bocks that generate either one item entity or one xp_orb entity with each tick, and an impulse command block that kills all entities to reset the test.

      Steps to reproduce

      1. Use a performance monitor to track CPU usage and FPS. The monitor included with the XBox Game Bar in Windows 10 works for this.
      2. In the attached test world, turn on the lever on the diamond block to drop item entities.
      3. Allow the game to run for 5 minutes or so and observe the performance monitor.
      4. Turn off the lever and press the kill button to reset the test environment.
      5. Turn on the lever on the gold block to drop xp_orb entities.
      6. Allow the game to run for a few minutes and observe the performance monitor.
      7. Turn off the lever and press the kill button to reset the test environment.

      Expected result

      The performance monitor shows similar changes in steps 3 and 6.

      Actual result

      In step 6, but not in step 3, CPU usage climbs steadily. If the xp_orbs are within the player's view, then from a certain point FPS declines steadily (FPS decline begins at about 45 seconds on my computer).

            GoldenHelmet [Mod] GoldenHelmet
            Votes:
            18 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: