View Issue Details

IDProjectCategoryLast Update
0025317AI War 2Bug - OtherOct 26, 2021 3:57 am
Reportercml Assigned Totom.prince  
Status resolvedResolutionfixed 
Product Version3.301 I Always Wanted To Be A Ghostbuster... 
Fixed in VersionBeta 3.740 Code Panopticon 
Summary0025317: X map generated with a planet far away from the others
DescriptionX map with 160 planets and seed 59111932 clusters all of the planets save for one in one corner and creates one planet in the opposite corner.
All mods were disabled.
See screenshot
TagsNo tags attached.

Relationships

has duplicate 0025330 resolvedtom.prince Map generator sometimes adds planets that are really far away 
has duplicate 0025314 resolvedtom.prince Linked rings map type odd lobby behaviour 

Activities

cml

Jun 21, 2021 1:38 pm

reporter  

X.png (2,059,201 bytes)

tom.prince

Oct 24, 2021 1:45 am

developer   ~0062994

I've attached a patch that limits the distance a satellite can be placed at for the X and Linked Rings map types. This fixes all the seeds in this issue and 0025330.
galaxy-scale-satellite.patch (2,319 bytes)   
# HG changeset patch
# User Tom Prince <[email protected]>
# Date 1635052424 21600
#      Sat Oct 23 23:13:44 2021 -0600
# Node ID 5c4aa4deab6acb1c22ce1ad593716ab1f83cfb75
# Parent  9374e64a02f49ff9baf1f2ff34061c5d2dcd49b9
Clamp maximum distance to point in BadgerUtilityMethods::GetExtremelySafePointNearPoint to 5 times the desired distance.

If the distance the point can be placed at is not limited, it is possible to
end up with maps where one or several satellite planets (in the X or Linked
Rings map types), are an order of magnitude or more farther away then the
rest of the planets in the galaxy.

diff --git CodeExternal/AIWarExternalDeepProcessingCode/src/Mapgen/MapGenerationBadger.cs CodeExternal/AIWarExternalDeepProcessingCode/src/Mapgen/MapGenerationBadger.cs
--- CodeExternal/AIWarExternalDeepProcessingCode/src/Mapgen/MapGenerationBadger.cs
+++ CodeExternal/AIWarExternalDeepProcessingCode/src/Mapgen/MapGenerationBadger.cs
@@ -78,6 +78,8 @@ namespace Arcen.AIW2.External
         {
             int retries = 200;
             ArcenPoint desiredLocation = origDesiredLocation;
+            int distanceFromPoint = preferredDistanceFromPoint;
+
             bool foundProblemWithCurrentLocation = false;
             do
             {
@@ -178,9 +180,13 @@ namespace Arcen.AIW2.External
                 if ( foundProblemWithCurrentLocation )
                 {
                     //expand the search radius
-                    preferredDistanceFromPoint += preferredDistanceFromPoint / 10;
+                    distanceFromPoint += distanceFromPoint / 10;
+                    distanceFromPoint += distanceFromPoint / 10;
+                    if (distanceFromPoint > 5 * preferredDistanceFromPoint) {
+                        distanceFromPoint = 5 * preferredDistanceFromPoint;
+                    }
                     preferredDistanceFromOtherPlanets -= preferredDistanceFromOtherPlanets / 20;
-                    desiredLocation = origDesiredLocation.GetRandomPointWithinDistance( Context.RandomToUse, 0, preferredDistanceFromPoint );
+                    desiredLocation = origDesiredLocation.GetRandomPointWithinDistance( Context.RandomToUse, 0, distanceFromPoint );
                 }
             } while ( retries-- > 0 && foundProblemWithCurrentLocation );
 
galaxy-scale-satellite.patch (2,319 bytes)   

Issue History

Date Modified Username Field Change
Jun 21, 2021 1:38 pm cml New Issue
Jun 21, 2021 1:38 pm cml File Added: X.png
Oct 24, 2021 1:45 am tom.prince Note Added: 0062994
Oct 24, 2021 1:45 am tom.prince File Added: galaxy-scale-satellite.patch
Oct 26, 2021 1:56 am tom.prince Relationship added has duplicate 0025330
Oct 26, 2021 2:27 am tom.prince Assigned To => tom.prince
Oct 26, 2021 2:27 am tom.prince Status new => resolved
Oct 26, 2021 2:27 am tom.prince Resolution open => fixed
Oct 26, 2021 2:27 am tom.prince Fixed in Version => Beta 3.740 Code Panopticon
Oct 26, 2021 3:57 am tom.prince Relationship added has duplicate 0025314