Problem: Every time you click on a burg/marker, it had to scan through all 13,496 vault files looking for a matching fmg-id. This was extremely slow and made the feature unusable for large vaults. Solution: Implement a smart index that maps fmg-id to file paths. How it works: - Index stored in memory (fmgIdIndex object) - Persisted to localStorage (survives page reloads) - Loaded on init, saved on changes - When looking up by fmg-id: 1. Check index first (instant!) 2. If found, verify file still exists and ID matches 3. If not in index, search vault and add to index - Automatically updates when notes are created/saved through FMG - Handles stale entries (file deleted/modified) Performance improvement: - Before: O(n) - scan all 13k files (very slow) - After: O(1) - instant lookup from index - First click on burg: May need to search (builds index) - Second click on same burg: Instant! Opens note directly This makes the Obsidian integration actually usable. Create a note once for a burg, and every time you click that burg again, it opens instantly. |
||
|---|---|---|
| .docker | ||
| .github | ||
| .vscode | ||
| charges | ||
| components | ||
| config | ||
| heightmaps | ||
| images | ||
| libs | ||
| modules | ||
| styles | ||
| utils | ||
| .gitignore | ||
| CLAUDE.md | ||
| CODE_OF_CONDUCT.md | ||
| Dockerfile | ||
| dropbox.html | ||
| icons.css | ||
| index.css | ||
| index.html | ||
| ISSUE_TEMPLATE.md | ||
| LICENSE | ||
| main.js | ||
| manifest.webmanifest | ||
| OBSIDIAN_INTEGRATION.md | ||
| README.md | ||
| run_php_server.bat | ||
| run_python_server.bat | ||
| run_python_server.sh | ||
| sw.js | ||
| versioning.js | ||
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.
Pull requests are highly welcomed. The codebase is messy and requires re-design. I will appreciate if you start with minor changes. Check out the data model before contributing.
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