- Added compatibility lookups for legacy single-SVG callers to ensure existing workflows function during migration to new architecture. - Implemented `getLayerSvg`, `getLayerSurface`, and `queryMap` functions as stable globals. - Migrated relevant code in `draw-state-labels.ts` to utilize the new `queryMap` function for scene-aware lookups. - Updated `layers.js` to manage layer visibility and registration more effectively. - Introduced `LayersModule` to handle layer registration, visibility, and ordering. - Created `WebGLSurfaceLayer` and `SvgLayer` classes to encapsulate layer behavior. - Refactored `TextureAtlasLayer` to utilize the new layer management system. - Updated HTML structure to accommodate new SVG and canvas elements. - Ensured all TypeScript checks pass with zero errors on modified files. |
||
|---|---|---|
| .docker | ||
| .github | ||
| _bmad | ||
| _bmad-output | ||
| docs | ||
| public | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| biome.json | ||
| CODE_OF_CONDUCT.md | ||
| Dockerfile | ||
| ISSUE_TEMPLATE.md | ||
| LICENSE | ||
| netlify.toml | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
| vitest.browser.config.ts | ||
Fantasy Map Generator
Azgaar's Fantasy Map Generator is a free web application that helps fantasy writers, game masters, and cartographers create and edit fantasy maps.
Link: azgaar.github.io/Fantasy-Map-Generator.
Refer to the project wiki for guidance. The current progress is tracked in Trello. Some details are covered in my old blog Fantasy Maps for fun and glory.
Join our Discord server and Reddit community to share your creations, discuss the Generator, suggest ideas and get the most recent updates.
Contact me via email if you have non-public suggestions. For bug reports please use GitHub issues or #fmg-bugs channel on Discord. If you are facing performance issues, please read the tips.
You can support the project on Patreon.
Inspiration:
-
Martin O'Leary's Generating fantasy maps
-
Amit Patel's Polygonal Map Generation for Games
-
Scott Turner's Here Dragons Abound
Contribution
Pull requests are highly welcomed. The codebase is messy and I will appreciate if you start with minor changes. Check out the data model before contributing.
The codebase is gradually transitioning from vanilla JavaScript to TypeScript while maintaining compatibility with the existing generation pipeline and old .map user files.
The expected future architecture is based on a separation between world data, procedural generation, interactive editing, and rendering. The application is conceptually divided into four main layers: world data and styles (state), generators (model), editors (controllers), renderers (view).
Flow: settings → generators → world data → renderer UI → editors → world data → renderer.
The data layer must contain no logic and no rendering code. Generators implement the procedural world simulation. Editors implement interactive editing tools used by the user. They perform controlled mutations of the world state. Editors can be viewed as interactive generators. The renderer converts the world state into SVG or WebGl graphics. Renderer must be pure visualization step and not modify world data.