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

Old strongholds "change position" and distance to origin is too high

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2
    • None
    • Unconfirmed

      Strongholds that generated in 1.8 won't generate in the same position in 1.9pre2.
      Also they generate at least 1408 blocks away from origin (in 1.8 it was 640 blocks).
      This was a side effect of the fix for MC-92289 which changed the distance calculation of strongholds.

      How it was

      Strongholds plotted for 1.8 (just the inner circle/triangle) and 16w05b (just adds extra circles)¹

      Distance calculation for 1.8 and 16w05b:

      MapGenStronghold.java
      double distance = (1.25D * (double) circle + rand.nextDouble()) * this.const32 * (double) circle;
      

      How it currently is

      Strongholds plotted for 1.8 and 1.9pre2 (notice how it loses the old inner circle)¹

      1.9pre2:

      MapGenStronghold.java
      double distance = 4.0D * this.const32 + this.const32 * (double)circle * 6.0D + (rand.nextDouble() - 0.5D) * this.const32 * 2.5D;
      

      Adjusted

      Stronghold plotted for 1.8 and an adjusted version to keep the inner circle the same¹

      MapGenStronghold.java
      double distance = 1.75D * this.const32 + this.const32 * (double)circle * 6.0D + (rand.nextDouble() - 0.5D) * this.const32 * (circle == 0 ? 1.0D : 2.5D);
      

      It would be preferable if the old stronghold positions would remain the same.
      Also the increased distance to origin and therefore also to spawn has the disadvantage of longer walkways when cycling between the end and the over world.
      In 1.8 the inner circle was between 640 and 1152 blocks from origin.
      In 1.9pre2 the inner circle lies between 1408 and 2048 blocks from origin.
      With the random placement of the spawn point it wouldn't be uncommon to have distances of several thousand blocks to the first accessible end portal.
      As the end is a major component of the game (especially in 1.9) it shouldn't be that far away from the world center.

      @edit It turns out eye of enders also behave weird when it comes to the strongholds that were generated in 1.8 (when you upgrade a world to 1.9pre2).
      It still is affected by the old stronghold but misses the portal room by some chunks.

      Other alternatives:

      Increasing spread and increasing interval (Pretty much 16w05b with the fix of MC-92289)

      MapGenStronghold.java
      double distance = (1.25D * ((double) circle + 1.0) + rand.nextDouble()) * this.const32 * (double) (circle / 1.9 + 1.0);
      

      Constant spread and constant interval

      MapGenStronghold.java
      double distance = 1.75D * this.const32 + this.const32 * (double)circle * 6.0D + (rand.nextDouble() - 0.5D) * this.const32;
      

      Increasing spread and constant interval

      MapGenStronghold.java
      double distance = 1.75D * this.const32 + this.const32 * (double)circle * 6.0D + (rand.nextDouble() - 0.5D) * this.const32 * (1.0 + circle / 1.75D);
      

      Evenly distributed (has a rare chance of double strongholds though)

      MapGenStronghold.java
      double distance = 1.75D * this.const32 + this.const32 * (double)circle * 6.0D + (rand.nextDouble() - 0.5D) * this.const32 * (circle == 0 ? 1.0D : 6.0D);
      

      1. The plots are the strongholds for 1000 seeds each.

        1. 1.8_SH-position-01.png
          566 kB
          Meri Diana
        2. 1.8_SH-position-02.png
          1.19 MB
          Meri Diana
        3. 1.8_SH-position-03.png
          680 kB
          Meri Diana
        4. 1.9_SH-position-01.png
          541 kB
          Meri Diana
        5. 1.9_SH-position-02.png
          1.02 MB
          Meri Diana
        6. 1.9_SH-position-03.png
          351 kB
          Meri Diana
        7. 1.9_Snapshot16w05b.png
          639 kB
          Meri Diana
        8. PortalPositions_16w05b.png
          40 kB
          [Mojang] Panda
        9. PortalPositions_18.png
          3 kB
          [Mojang] Panda
        10. PortalPositions_19pre2.png
          59 kB
          [Mojang] Panda
        11. PortalPositions_improved.png
          60 kB
          [Mojang] Panda
        12. PortalPositions_improved2.png
          31 kB
          [Mojang] Panda
        13. PortalPositions_improved3.png
          54 kB
          [Mojang] Panda
        14. PortalPositions_improved4.png
          65 kB
          [Mojang] Panda
        15. PortalPositions_improved5.png
          78 kB
          [Mojang] Panda
        16. Seed-12345_1.8.png
          93 kB
          Meri Diana

            searge [Mojang] Searge (Michael Stoyke)
            panda4994 [Mojang] Panda
            Votes:
            17 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: