ashgrid 1.0.2
ASHGRID is a procedural map generator written in D.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
ASHGRID
ASHGRID is a procedural map generator written in D.
Examples
Initialization
auto settings = new MapSettings(seed, width, height);
Generating a map
auto biomes = generateBiomes(settings,
[
Biome.plain : 0.4f, // 40% plain
Biome.forest : 0.4f, // 40% forest
Biome.swamp : 0.2f // 20% swamp
]);
generateWaterBiome!Biome(settings, biomes,
Biome.water,
(b) => b == Biome.plain || b == Biome.forest);
generateWaterBiome!Biome(settings, biomes,
Biome.dirtyWater,
(b) => b == Biome.swamp);
generateRivers!Biome(settings, biomes,
Biome.water,
(b) => b == Biome.plain || b == Biome.forest);
generateRivers!Biome(settings, biomes,
Biome.dirtyWater,
(b) => b == Biome.swamp);
auto heights = generateHillHeights(settings);
auto biomeTiles = generateTiles!(Biome, BiomeTileType)(settings, biomes, heights, (g,b,h)
{
auto tile = defaultTileGenerator(g,b);
tile.height = h;
return tile;
});
Generating a dungeon
auto biomes = generateDungeon!Biome(settings, Biome.none, Biome.wall, Biome.plain);
auto heights = createCoordinateArray!int(settings.width, settings.height);
auto biomeTiles = generateTiles!(Biome, BiomeTileType)(settings, biomes, heights, (g,b,h)
{
auto tile = defaultTileGenerator(g,b);
tile.height = h;
return tile;
});
How you render everything is up to you and will depend on your game engine etc.
You may use the functions createCoordinateArray() and getCoordinateIndex() to interact with the final produced map.
- 1.0.2 released a day ago
- bauss-dev/ASHGRID
- github.com/bauss-dev/ASHGRID
- The MIT License (MIT)
- Copyright © 2025 ASHGRID
- Authors:
- Dependencies:
- none
- Versions:
-
1.0.5 2025-Jul-11 1.0.4 2025-Jul-11 1.0.3 2025-Jul-11 1.0.2 2025-Jul-11 1.0.1 2025-Jul-10 - Download Stats:
-
-
0 downloads today
-
3 downloads this week
-
3 downloads this month
-
3 downloads total
-
- Score:
- 0.5
- Short URL:
- ashgrid.dub.pm