Class SymmetryDungeonGenerator
java.lang.Object
com.github.yellowstonegames.place.MixedGenerator
com.github.yellowstonegames.place.SymmetryDungeonGenerator
- All Implemented Interfaces:
PlaceGenerator
A variant on
MixedGenerator that creates bi-radially symmetric maps (basically a yin-yang shape). Useful for
strategy games and possibly competitive multi-player games. The Coords passed to constructors as room positions do
not necessarily need to be symmetrical already; they will be duplicated in their mirror position in the dungeon.-
Field Summary
Fields inherited from class MixedGenerator
BOX, BOX_WALLED, carvers, carverTable, CAVE, dungeon, environment, fixedRooms, generated, height, marked, points, rng, roomHeight, roomWidth, ROUND, ROUND_WALLED, totalPoints, walled, width -
Constructor Summary
ConstructorsConstructorDescriptionThis prepares a map generator that will generate a map with width 80 and height 80, using a random seed.SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng) This prepares a map generator that will generate a map with the given width and height, using the given RNG.SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord> sequence) This prepares a map generator that will generate a map with the given width and height, using the given RNG.SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng, com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> connections) This prepares a map generator that will generate a map with the given width and height, using the given RNG.SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng, com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> connections, float roomSizeMultiplier) This prepares a map generator that will generate a map with the given width and height, using the given RNG.SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng, com.github.tommyettinger.ds.Ordered<com.github.yellowstonegames.grid.Coord> sequence) This prepares a map generator that will generate a map with the given width and height, using the given RNG. -
Method Summary
Modifier and TypeMethodDescriptionprotected static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> crossConnect(int width, int height, Map<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> connections) protected static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> listToMap(com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord> sequence) protected booleanmark(int x, int y) Internal use.protected voidmarkEnvironment(int x, int y, int kind) Internal use.protected voidmarkPiercing(int x, int y) Internal use.static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> removeSomeOverlap(int width, int height, com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> connections) static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> removeSomeOverlap(int width, int height, Collection<com.github.yellowstonegames.grid.Coord> sequence) protected static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> setToMap(com.github.tommyettinger.ds.Ordered<com.github.yellowstonegames.grid.Coord> sequence) toString()protected voidwallOff(int x, int y) Internal use.Methods inherited from class MixedGenerator
basicPoints, generate, getEnvironment, getFixedRooms, getPlaceGrid, hasGenerated, mark, markEnvironmentCave, markEnvironmentCorridor, markEnvironmentRoom, markEnvironmentWalls, markPiercing, markPiercingCave, markPiercingRoom, putBoxRoomCarvers, putCaveCarvers, putRoundRoomCarvers, putWalledBoxRoomCarvers, putWalledRoundRoomCarvers, setFixedRooms, store
-
Constructor Details
-
SymmetryDungeonGenerator
public SymmetryDungeonGenerator()This prepares a map generator that will generate a map with width 80 and height 80, using a random seed. This version of the constructor uses Poisson Disk sampling to generate the points it will draw caves and corridors between, ensuring a minimum distance between points, but it does not ensure that paths between points will avoid overlapping with rooms or other paths. You call the different carver-adding methods to affect what the dungeon will look like, putCaveCarvers(), putBoxRoomCarvers(), and putRoundRoomCarvers(), defaulting to only caves if none are called. You call generate() after adding carvers, which returns a char[][] for a map.- See Also:
-
SymmetryDungeonGenerator
public SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng) This prepares a map generator that will generate a map with the given width and height, using the given RNG. This version of the constructor uses Poisson Disk sampling to generate the points it will draw caves and corridors between, ensuring a minimum distance between points, but it does not ensure that paths between points will avoid overlapping with rooms or other paths. You call the different carver-adding methods to affect what the dungeon will look like, putCaveCarvers(), putBoxRoomCarvers(), and putRoundRoomCarvers(), defaulting to only caves if none are called. You call generate() after adding carvers, which returns a char[][] for a map.- Parameters:
width- the width of the final map in cellsheight- the height of the final map in cellsrng- an RNG object to use for random choices; this make a lot of random choices.- See Also:
-
SymmetryDungeonGenerator
public SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord> sequence) This prepares a map generator that will generate a map with the given width and height, using the given RNG. This version of the constructor uses a ObjectList of Coord points from some other source to determine the path to add rooms or caves to and then connect. You call the different carver-adding methods to affect what the dungeon will look like, putCaveCarvers(), putBoxRoomCarvers(), and putRoundRoomCarvers(), defaulting to only caves if none are called. You call generate() after adding carvers, which returns a char[][] for a map.- Parameters:
width- the width of the final map in cellsheight- the height of the final map in cellsrng- an EnhancedRandom, such as a WhiskerRandom, to use for random choices; this make a lot of random choices.sequence- a ObjectList of Coord to connect in order; index 0 is the start, index size() - 1 is the end.- See Also:
-
SymmetryDungeonGenerator
public SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng, com.github.tommyettinger.ds.Ordered<com.github.yellowstonegames.grid.Coord> sequence) This prepares a map generator that will generate a map with the given width and height, using the given RNG. This version of the constructor uses a ObjectList of Coord points from some other source to determine the path to add rooms or caves to and then connect. You call the different carver-adding methods to affect what the dungeon will look like, putCaveCarvers(), putBoxRoomCarvers(), and putRoundRoomCarvers(), defaulting to only caves if none are called. You call generate() after adding carvers, which returns a char[][] for a map.- Parameters:
width- the width of the final map in cellsheight- the height of the final map in cellsrng- an EnhancedRandom, such as a WhiskerRandom, to use for random choices; this make a lot of random choices.sequence- a ObjectList of Coord to connect in order; index 0 is the start, index size() - 1 is the end.- See Also:
-
SymmetryDungeonGenerator
public SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng, com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> connections) This prepares a map generator that will generate a map with the given width and height, using the given RNG. This version of the constructor uses a LinkedHashMap with Coord keys and Coord array values to determine a branching path for the dungeon to take; each key will connect once to each of the Coords in its value, and you usually don't want to connect in both directions. You call the different carver-adding methods to affect what the dungeon will look like, putCaveCarvers(), putBoxRoomCarvers(), and putRoundRoomCarvers(), defaulting to only caves if none are called. You call generate() after adding carvers, which returns a char[][] for a map.- Parameters:
width- the width of the final map in cellsheight- the height of the final map in cellsrng- an EnhancedRandom object to use for random choices; this makes a lot of random choices.connections- a Map of Coord keys to arrays of Coord to connect to next; shouldn't connect both ways- See Also:
-
SymmetryDungeonGenerator
public SymmetryDungeonGenerator(int width, int height, com.github.tommyettinger.random.EnhancedRandom rng, com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> connections, float roomSizeMultiplier) This prepares a map generator that will generate a map with the given width and height, using the given RNG. This version of the constructor uses a ObjectObjectOrderedMap with Coord keys and Coord array values to determine a branching path for the dungeon to take; each key will connect once to each of the Coords in its value, and you usually don't want to connect in both directions. You call the different carver-adding methods to affect what the dungeon will look like, putCaveCarvers(), putBoxRoomCarvers(), and putRoundRoomCarvers(), defaulting to only caves if none are called. You call generate() after adding carvers, which returns a char[][] for a map.- Parameters:
width- the width of the final map in cellsheight- the height of the final map in cellsrng- an EnhancedRandom object to use for random choices; this makes a lot of random choices.connections- a Map of Coord keys to arrays of Coord to connect to next; shouldn't connect both waysroomSizeMultiplier- a float multiplier that will be applied to each room's width and height- See Also:
-
-
Method Details
-
removeSomeOverlap
public static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> removeSomeOverlap(int width, int height, Collection<com.github.yellowstonegames.grid.Coord> sequence) -
removeSomeOverlap
public static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> removeSomeOverlap(int width, int height, com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> connections) -
listToMap
protected static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> listToMap(com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord> sequence) -
setToMap
protected static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> setToMap(com.github.tommyettinger.ds.Ordered<com.github.yellowstonegames.grid.Coord> sequence) -
crossConnect
protected static com.github.tommyettinger.ds.ObjectObjectOrderedMap<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> crossConnect(int width, int height, Map<com.github.yellowstonegames.grid.Coord, com.github.tommyettinger.ds.ObjectList<com.github.yellowstonegames.grid.Coord>> connections) -
mark
protected boolean mark(int x, int y) Internal use. Marks a point to be made into floor.- Overrides:
markin classMixedGenerator- Parameters:
x- x position to marky- y position to mark- Returns:
- false if everything is normal, true if and only if this failed to mark because the position is walled
-
markPiercing
protected void markPiercing(int x, int y) Internal use. Marks a point to be made into floor.- Overrides:
markPiercingin classMixedGenerator- Parameters:
x- x position to marky- y position to mark
-
wallOff
protected void wallOff(int x, int y) Internal use. Marks a point to be made into floor.- Overrides:
wallOffin classMixedGenerator- Parameters:
x- x position to marky- y position to mark
-
markEnvironment
protected void markEnvironment(int x, int y, int kind) Internal use. Marks a point's environment type as the appropriate kind of environment.- Overrides:
markEnvironmentin classMixedGenerator- Parameters:
x- x position to marky- y position to markkind- an int that should be one of the constants in MixedGenerator for environment types.
-
toString
- Overrides:
toStringin classMixedGenerator
-