H3mapgen
An attempt to build a comprehensive map generator for Heroes of Might and Magic III
Install / Use
/learn @radekmie/H3mapgenREADME
h3mapgen
An attempt to build a comprehensive map generator for Heroes of Might and Magic III
Design
<p align="center"> <img src="design.png" alt="Design" height="357"> </p> <details> <summary>nomnoml source
</summary>#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> .]
]
</details>
Setup
$ git submodule update --init --recursive
$ make
Run generator
From 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 '>'.
Run GUI
There's no single executable file yet, but you can run it with love2d:
love h3mapgen.love
Run in Docker
$ 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:new
This 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.
Random notes of Kuba S.:
- 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.
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
