Refine map generator spawn placement rules
Spawn generation generally tries to place spawns: - In spacious areas - Away from the center (true center or mirror lines) - Away from a symmetry-projected spawn - Away from previously placed spawns This commit introduces the following adjustments: - The spacing between sequentially placed spawns is relaxed. - Fix spawn mines contributing too much to the space reservation. - Factor rotations into anti-center biasing calculation. - Preserve spacing information in center space fallback decisions. - Use a linear (instead of binary) falloff for anti-center biasing. - Enforce that spawns have a minimum buildable area around them. - Enforce that symmetry-projected spawns have as much separation as sequentially placed spawns would. - Allow spawns on or near roads.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
440987c0a4
commit
1fda679b9f
@@ -278,26 +278,5 @@ namespace OpenRA.Mods.Common.MapGenerator
|
||||
action(projections, original);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true iff xy is within reservationRadius of the center of a given CellLayer. If
|
||||
/// a mirroring is specified, the radius is measured from the mirror line instead of the
|
||||
/// center point.
|
||||
/// </summary>
|
||||
public static bool IsCPosNearCenter<T>(
|
||||
CPos cpos,
|
||||
CellLayer<T> cellLayer,
|
||||
int reservationRadius,
|
||||
Mirror mirror)
|
||||
{
|
||||
CPos[] testPoints;
|
||||
if (mirror == Mirror.None)
|
||||
testPoints = RotateAndMirrorCPos(cpos, cellLayer, 2, Mirror.None);
|
||||
else
|
||||
testPoints = RotateAndMirrorCPos(cpos, cellLayer, 1, mirror);
|
||||
|
||||
var separation = (testPoints[1] - testPoints[0]).LengthSquared;
|
||||
return separation <= reservationRadius * reservationRadius * 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user