public class SpillWorldMap
extends java.lang.Object
WorldMapGenerator
's inner classes and PoliticalMapper
or
FantasyPoliticalMapper
to place claims by factions. Most of the WorldMapGenerator maps allow wrapping around
one axis (or both for WorldMapGenerator.TilingMap
), and allow calculating data
for the ecosystems on the world map with WorldMapGenerator.DetailedBiomeMapper
.
This class doesn't compute the height or moisture levels that DetailedBiomeMapper needs to figure out ecosystems.
Modifier and Type | Field and Description |
---|---|
OrderedMap<java.lang.Character,java.lang.String> |
atlas |
int |
height |
int[][] |
heightMap |
static char[] |
letters |
Coord[] |
mountains |
java.lang.String |
name |
char[][] |
politicalMap |
StatefulRNG |
rng |
int |
width |
Constructor and Description |
---|
SpillWorldMap() |
SpillWorldMap(int width,
int height,
java.lang.String worldName)
Constructs a SpillWorldMap using the given width, height, and world name, and uses the world name as the
basis for all future random generation in this object.
|
Modifier and Type | Method and Description |
---|---|
char[][] |
generate(int factionCount)
Generates a basic physical map for this world, then overlays a more involved political map with the given number
of factions trying to take land in the world (essentially, nations).
|
char[][] |
generate(int factionCount,
boolean makeAtlas)
Generates a basic physical map for this world, then overlays a more involved political map with the given number
of factions trying to take land in the world (essentially, nations).
|
char[][] |
generate(int factionCount,
boolean makeAtlas,
boolean makeHeight,
double controlledFraction,
double waterStrength)
Generates a basic physical map for this world, then overlays a more involved political map with the given number
of factions trying to take land in the world (essentially, nations).
|
char[][] |
generate(int factionCount,
boolean makeAtlas,
double controlledFraction)
Generates a basic physical map for this world, then overlays a more involved political map with the given number
of factions trying to take land in the world (essentially, nations).
|
char[][] |
generate(int factionCount,
boolean makeAtlas,
double controlledFraction,
double waterStrength)
Generates a basic physical map for this world, then overlays a more involved political map with the given number
of factions trying to take land in the world (essentially, nations).
|
public int width
public int height
public StatefulRNG rng
public java.lang.String name
public char[][] politicalMap
public int[][] heightMap
public Coord[] mountains
public static final char[] letters
public final OrderedMap<java.lang.Character,java.lang.String> atlas
public SpillWorldMap()
public SpillWorldMap(int width, int height, java.lang.String worldName)
width
- the width of the map in cellsheight
- the height of the map in cellsworldName
- a String name for the world that will be used as a seed for all random generation herepublic char[][] generate(int factionCount, boolean makeAtlas)
atlas
member of this object but will
be empty if makeAtlas has never been true in a call to this.
Coord.expandPoolTo(width, height);
. This will have no effect if width and height are both less than or
equal to 256, but if you expect to be using maps that are especially large (which makes sense for world maps),
expanding the pool will use more memory initially and then (possibly) much less over time, easing pressure on
the garbage collector as well, as re-allocations of large Coords that would otherwise be un-cached are avoided.factionCount
- the number of factions to have claiming land, cannot be negative or more than 255makeAtlas
- if true, this will assign random names to factions, accessible via atlas
public char[][] generate(int factionCount, boolean makeAtlas, double controlledFraction)
atlas
member of this object but will
be empty if makeAtlas has never been true in a call to this.
Coord.expandPoolTo(width, height);
. This will have no effect if width and height are both less than or
equal to 256, but if you expect to be using maps that are especially large (which makes sense for world maps),
expanding the pool will use more memory initially and then (possibly) much less over time, easing pressure on
the garbage collector as well, as re-allocations of large Coords that would otherwise be un-cached are avoided.factionCount
- the number of factions to have claiming land, cannot be negative or more than 255makeAtlas
- if true, this will assign random names to factions, accessible via atlas
controlledFraction
- between 0.0 and 1.0 inclusive; higher means more land has a letter, lower has more '%'public char[][] generate(int factionCount, boolean makeAtlas, double controlledFraction, double waterStrength)
atlas
member of this object but will
be empty if makeAtlas has never been true in a call to this.
Coord.expandPoolTo(width, height);
. This will have no effect if width and height are both less than or
equal to 256, but if you expect to be using maps that are especially large (which makes sense for world maps),
expanding the pool will use more memory initially and then (possibly) much less over time, easing pressure on
the garbage collector as well, as re-allocations of large Coords that would otherwise be un-cached are avoided.factionCount
- the number of factions to have claiming land, cannot be negative or more than 255makeAtlas
- if true, this will assign random names to factions, accessible via atlas
controlledFraction
- between 0.0 and 1.0 inclusive; higher means more land has a letter, lower has more '%'waterStrength
- a non-negative multiplier that affects ocean size; 1 is more land than waterpublic char[][] generate(int factionCount, boolean makeAtlas, boolean makeHeight, double controlledFraction, double waterStrength)
atlas
member of this object but will
be empty if makeAtlas has never been true in a call to this. If makeHeight is true, this will generate a height
map in an organic way (though it isn't especially fast on very large maps), assigning the height map as an
int[][] to heightMap
and the potential mountains, hills, or peaks to the Coord[] mountains
. The
first Coord in mountains is usually the tallest point on the map, though two or more small peaks that are very
close to one another might fuse into one larger mountain range, with higher int values than those for the first
mountain on its own.
Coord.expandPoolTo(width, height);
. This will have no effect if width and height are both less than or
equal to 256, but if you expect to be using maps that are especially large (which makes sense for world maps),
expanding the pool will use more memory initially and then (possibly) much less over time, easing pressure on
the garbage collector as well, as re-allocations of large Coords that would otherwise be un-cached are avoided.factionCount
- the number of factions to have claiming land, cannot be negative or more than 255makeAtlas
- if true, this will assign random names to factions, accessible via atlas
makeHeight
- if true, this will generate a height map, accessible via heightMap
, with -1 for watercontrolledFraction
- between 0.0 and 1.0 inclusive; higher means more land has a letter, lower has more '%'waterStrength
- a non-negative multiplier that affects ocean size; 1 is more land than waterpublic char[][] generate(int factionCount)
factionCount
- the number of factions to have claiming landCopyright © Eben Howard 2012–2022. All rights reserved.