Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-32933

setBlock() lighting performance issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.6.4, Minecraft 1.7.4
    • Fix Version/s: Minecraft 1.8
    • Labels:
    • Environment:
      Hi-End corei7 gaming PC, 64-bit java, etc.
      MC 1.7.x
    • Confirmation Status:
      Unconfirmed

      Description

      Being a modder, I created a few things out of blocks. Tap something on the ground, and presto, something interesting, like a giant tree shows up. I had always wondered why it took more than 10 seconds on a screaming-fast gaming machine to display a generated tree that was surely less than 1000 blocks. I found out...

      As part of creating another dimension, I generated floating islands. But what good is a floating island if it doesn't move? Even after all the optimization I could possibly muster, changing the absolute minimum number of blocks foe the islands to relocate, the results were still dismal. My islands were small, and slow, or I got severe lag. I appeared to be limited to less than 100 setBlock() calls a second.

      Deciding to investigate setBlock() I tracked it down and commented out the Lighting routines. Presto. Instantly 1000 times faster. A ten-second tree generation was now instant. Islands were huge and moved at a nice clip.

      Mystery solved.

      The bug here, is that the lighting algorithms in setBlock() are what is causing excessive lag, everywhere, all the time. It doesn't take much. If I can only push 100 blocks a second on a high-end screamer, this would explain all the lag on my son's slower machine, and why it doesn't run on my laptop.

      So, while my islands and trees now have a few funny shadows, at least I don't lag the game any more!

      PLEASE consider re-writing/re-vamping the World.setBlock() lighting algorithms. They are painfully slow.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              TheyCallMeDanger Richard H. Clark
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: