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

The generation of terrain surface layer produces local straight glitches (fix included)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w07a, Snapshot 13w09b, Snapshot 13w09c, Minecraft 1.5, Minecraft 1.6.1, Minecraft 1.6.2
    • Fix Version/s: Minecraft 13w36a
    • Environment:

      Platform/environment shouldn't matter, as the bug is in the java code.
      (Windows 7 64-bit, java 7 64-bit, naturally unmodified Minecraft).

    • Confirmation Status:
      Confirmed
    • Game Mode:
      Creative

      Description

      (Closely related to MC-7192.)

      The seed for the world of two first screenshots (with swamp and desert) is -807116175.

      Bug as seen in 1.4.7
      Attached screenshot (..00.18) shows the visual effect of the problem with unmodified 1.4.7: one block too little sand in a straight line form, often repeating in 16-block period. The problem may affect other than sand surface, too. Note, the area around had not yet been fully loaded/generated at the time of the screenshot, so ignore the missing stuff in the distance.

      What I expect to be seen
      The other screenshot (..01.53) shows the same world and the same location after applying the proposed code fix shown below.

      Background/other info
      Examples of the bug are quite easy to find in almost any world, given enough flying around. While mostly investigating this in creative mode, it should be just as valid for survival mode.

      (Note, this same problem has been around since a loooong time ago, and I submitted a bug report and (almost) the same fix back then. Apparently it was never fixed back then and the soon after implemented changes to terrain generation just made it less noticeable, or the bug has crawled back in.)

      Bugged code
      The bugged part of code (as seen with MCP 7.26) is:
      ChunkProviderGenerate.replaceBlocksForBiome(int, int, byte[], BiomeGenBase[]), 3rd line of the method:
      this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D);

      Fixed code
      The fixed version swaps the latter two coordinate axes (Y and Z, I suppose):
      this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, par1 * 16, 0, par2 * 16, 16, 1, 16, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D);

      Added
      One more screenshot and map snippet, from very old worlds, at the time when I first checked this and made the fixes. The map snippet should clearly visualize it is not about "basins", and the screenshot also shows it is (back then) not about basins, as it was between sand and dirt at the same level. (This difference is because back then the same bug could affect not only thickness, but also the material, if I remember it right. I did have to make changes to 3 more lines in that same method to get all the related things fixed, but with the new biome code, only 1 line is enough.)

      Added more
      The stone-gray screenshot is taken with a modified client, in order to reveal the full extent of the bug. I modified the world generator to create the ground at fixed height of 7, and for the replace method (which has the bug) to switch the surface stone layer into air instead of dirt or sand. This way the height variation on the ground is actually showing only the surface layer thickness function (and some further random features, like those small ponds, caves and ravines).

      As can be seen, there are a lot of straight long east-west steps, exactly at chunk borders. Most of the effect is normally hidden by the random variation in the height of ground. That is, the visual effect of this bug is hidden below random noise of the normal ground level function. One would not detect that bad signs if all the dirt/sand would be digged away in a normally generated map, but the effect is still there.

      Uh oh, there is even more
      I'm going to make another entry about an equal bug for Nether, but FYI, the corresponding class and method for Nether has the same bug, and another similar, as it is basically an adapted copy of the older overworld generator (with its multiple bugs it had back then).

        Attachments

        1. 2013-01-10_18.00.18.png
          2013-01-10_18.00.18.png
          1.92 MB
        2. 2013-01-10_18.01.53.png
          2013-01-10_18.01.53.png
          1.97 MB
        3. 2013-01-11_02.05.28.png
          2013-01-11_02.05.28.png
          758 kB
        4. area_3_bugged.png
          area_3_bugged.png
          2.22 MB
        5. example_in_137.png
          example_in_137.png
          931 kB
        6. sand_bugged_map_2.png
          sand_bugged_map_2.png
          31 kB
        7. stripes_on_mycelium.png
          stripes_on_mycelium.png
          2.21 MB

          Issue Links

            Activity

              People

              • Assignee:
                jeb [Mojang] Jeb (Jens Bergensten)
                Reporter:
                bugi74 Markku
              • Votes:
                7 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: