Adventure at Umalu  22nd March, 2013
Rogue-like Dungeon Crawler, written in Java
 All Classes Functions Variables Pages
Classes | Public Member Functions | Protected Member Functions | List of all members
jade.gen.map.Cellular Class Reference
Inheritance diagram for jade.gen.map.Cellular:

Public Member Functions

 Cellular ()
 
 Cellular (ColoredChar floor, ColoredChar wall)
 
 Cellular (ColoredChar floor, ColoredChar wall, int wallChance, int minCount, int maxCount)
 

Protected Member Functions

void generateStep (World world, Dice dice)
 

Detailed Description

Uses cellular automaton to generate interesting cave-like maps. This implementation always tries to make a connected map. For large maps, this is usually done by removing small unconnected portions of the map. For small maps, the whole map is usually scrapped and a new map generated. Since the map is small, this turns out to be fairly inexpensive. However, after 100 tries, the algorithm quits, most likely leaving a completely impassible

World

. This all but guaranteed on exceptionally small maps.

Constructor & Destructor Documentation

jade.gen.map.Cellular.Cellular ( )

Creates a new instance of

with the default open tile of '.' and a default closed tile of '#'.

jade.gen.map.Cellular.Cellular ( ColoredChar  floor,
ColoredChar  wall 
)

Creates a new instance of

with the specified open and closed tiles.

Parameters
floorthe face of the open tiles
wallthe face of the closed tiles
jade.gen.map.Cellular.Cellular ( ColoredChar  floor,
ColoredChar  wall,
int  wallChance,
int  minCount,
int  maxCount 
)

Creates a new instance of Cellular with the specified generation parameters. Great care should be taken when customizing these parameters, as certain configurations may make it impossible to generate good levels.

Parameters
floorthe face of the open tiles
wallthe face of the closed tiles
wallChancethe chance out of 100 of seeding the map with a wall, as well as the required percent of wall tiles for the map to be accepted
minCountthe minimum number of walls at distance 1 to generate a wall
maxCountthe maximum number of walls at distance 2 to generate a wall

The documentation for this class was generated from the following file: