|
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 );
|