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

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

              Created:
              Updated:
              Resolved: