An attempt to build a comprehensive map generator for Heroes of Might and Magic III
nomnoml source
#arrowSize: 0.75
#direction: right
#fill: transparent
#font: monospace
#leading: 1
#lineWidth: 2
#padding: 10
#spacing: 25
#stroke: #000
#title: design
#.vertical: bold center direction=down
[<reference> H3PGM |
[<vertical> Meta |
[seed] -> [LML]
[LML] -> [MLML]
[MLML] -> [MDS]
]
[<vertical> Renderable |
[CA] -> [Plugins]
[Plugins] -> [CA]
]
[<start>] -> [Meta]
[Meta] -> [Voronoi]
[Voronoi] -> [Renderable]
[Renderable] --> [.h3m]
[Renderable] -> [<end> .]
]
$ git submodule update --init --recursive
$ makeFrom the project root directory run lua generate.lua initial-h3pgm. The output from all stages of generation is saved in output/<seed>_<players>. That directory should contain these directories and files:
| File | Description |
|---|---|
dumps/*.h3m |
State at various moments (map). |
dumps/*.h3pgm |
State at various moments. |
imgs/LML-*.dot |
LML at different evolution stage (source). |
imgs/LML-*.png |
LML at different evolution stage. |
LML.dot |
Final LML (source). |
LML.png |
Final LML. |
emb.png |
Embedding result. |
emb.txt |
Embedding coordinates. |
graph.txt |
Graph structure. |
map.h3m |
Playable map. |
sfp.txt.* |
SFP algorithm arguments. |
Example: lua generate.lua '>'.
There's no single executable file yet, but you can run it with love2d:
love h3mapgen.love$ git submodule update --init --recursive
$ docker rmi h3mapgen:old || true
$ docker tag h3mapgen:new h3mapgen:old || true
$ docker build --tag h3mapgen:new .
$ docker run --rm --name h3mapgen --volume $(pwd)/output:/app/output h3mapgen:newThis will remove the old image, tag the new as old, build the new and run a volatile container, which will save the output in ./output.
- In case you don't know that: the first rule is that the code in
masteris compilable at all times. You should check that before commiting. - I've created a separate branch for development of cellular automata. Creating branches for other parts of the project is highly encouraged.
- File
src/cellular/board.hppcontains declaration ofBoardandCellas well as some tools and functions of general use (not only for cellular automata). It seems reasonable to me for us to include this file at every stage that makes use of the game board represented by a grid of black/white cells instead of creating several inconsistent abstractions. Also, I think that the declarations should be replaced by proper class definitions soon (for the sake of convinience). Feel free to work on it. - I've been storing the intervening board-like results in a text files (see
output/directory). To preserve the consistency of the format, please use theprint_boardandload_boardfunctions fromsrc/cellular/board.hpp. - My english isn't perfect - I'm aware of that. Please correct every mistake you spotted. I'd appreciate that.
