This may be a little late with the new release around the corner, but after I finally got the hang of lua and the DFHack structures, I realized I could use it to generate a worldmap SVG.
See, in the past I had used python and the various legends xmls, detailed maps and more to generate this file:
Click me, because this map is quite bigBut, it took a long while to load the legends, and not everything can be found in the legends, and the maps need to be manually created with an image manipulation program, and that in turn is not easy to script, and even then I also had to manually add in names and the like. So I was looking for a more scriptable solution.
So I was quite excited to find the map details in the DFHack structures. Of course, these map details are missing the precise region tiles information, because DF just doesn't load those until needed. So I decided to go somewhat the opposite direction and aim to make it very informative.
This ended up with surprisingly cute results:
Now, the above is the SVG linked as an image.
For the interactivity, you will need to open the link directly into a tab (for self-generated svg files, just open them in chrome or firefox (haven't tested anything else)). Here you can see that regions light up when hovered (using css), and clicking them zooms in(using svg views).
- Everything except the site-entity links can be hovered over for more information.
- Everything that glows on hover can be clicked on to zoom in. Use backspace or remove the last part of the url from '#' onwards to go back to the full map.
- On the left hand side there's a list of landmasses. These can be clicked to zoom in.
- On the right hand side there's a list of civilizations and their colors. The colors are the actual colors used by the historical maps for these civs. Clicking their name will zoom in on the area of their claims. The actual claim borders are also drawn into the svg, but hidden by default, as they, while correct, look weird.
- All the colors, outside of the site-entity links and some stroke colors, are stored as inkscape swatches meaning you can open the map in inkscape and change all the colors of the deserts or something.
If you zoomed in on a section, and you link that in an img tag, you will get the zoomed in section (tested on firefox and chrome only), so this code gives the following img:
[img width=400]https://wolthera.info/df-worlds/region1-Slozgo-Sagus-svg-map.svg#221-the-disemboweled-realm-view[/img]
This of course requires that you have a place (server) to upload and access this file directly from.
Here's some other regions I have been testing this script on:
A Pocket islandA Small IslandA Large Region (Warning: 8~mb file)Limitations and things that could use improving:
- The entity links need work. I am not sure how I am going to approach this, as it highly depends on when you'd want them to be visible and how much info you can get about them.
Right now it's not possible to get biomes within a region, which means that I cannot get the permafrost for the artic ocean figured out. This now needs better tropicality detectionI am unsure about detecting a site as a ruin. This seems to be the correct way to handle it. - The script is very messy, I apologize.
- Also only tested on four worlds.
So, without further ado, here's a github gist with the script:
LINK