-
Notifications
You must be signed in to change notification settings - Fork 0
Procedural Map Generation
rjg1 edited this page Aug 20, 2022
·
20 revisions
To keep gameplay unique and enhance replay value, the game map will be dynamically generated each playthrough. This means that players will have to adapt their strategy for building their militia and working force, as resources and enemies will not appear statically from game to game. In order to assist with this, the MapGenerator class has been developed, which features functionality to create and output a randomly generated map
Generating a map should be done in a GameArea class - for example - an implementation in the default ForestGameArea class:
//Generate a map with the following specifications
MapGenerator mg = new MapGenerator(mapWidth, mapHeight, citySize, islandSize);
//Store the map
char[][] map = mg.getMap();
for (int x = 0; x < mapWidth; x++) {
for (int y = 0; y < mapHeight; y++) {
Cell cell = new Cell();
if (map[y][x] == mg.getOceanChar()) {
//Set ocean tiles to "tuft" textures
cell.setTile(oceanTile);
} else {
//Set non-ocean tiles to "grass" textures
cell.setTile(oceanTile);
}
layer.setCell(x, mapHeight - y, cell);
}
}
Map
City
Buildings
Unit Selections
Game User Testing: Theme of Unit Selection & Spell System
Health Bars
In Game menu
- Feature
- User Testing:In Game Menu
Landscape Tile Design Feedback