Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Revenant

dmsvg.py: make pretty SVG renders of maps

Recommended Posts

Great to see tools like this, I am wishing for a nice WAD2vector since forever now. Does this actually work with UMDF? I tried it with my map and it just told me "MAP01 not found".  Doom2.wad worked fine, though.

Share this post


Link to post

UDMF will be supported whenever I end up merging support for it into the underlying WAD editing library, which is in progress, so... eventually.

Share this post


Link to post

@Revenant considering bringing this and the older DMVIS up with @Xymph - DoomWiki maps are currently also generated with a .py script but aren't colored. Perhaps you and him can share some ideas?

 

Super interesting stuff, by the way, and useful on more levels then one may initially think of.

Share this post


Link to post
Posted (edited)

The wiki is actually something I very much had in mind when I was working on this, since I thought it could well come in handy. The script that's currently used on the wiki for drawing maps is actually what dmvis is directly based on.

 

To that end, @sponge was the one who originally suggested some of the additional nice features I mentioned in the OP, which I might experiment with later on.

Share this post


Link to post

Keep up the good work, I'd love to make some Doom automap posters for myself some day. Or maybe a coffee table book featuring "The Evolution of Doom Mapping" along with Screenshots and... map layouts.

Share this post


Link to post

This is badass! Been wanting a tool like this for some time now.

Share this post


Link to post
Posted (edited)

For anyone curious, I saw the big SVG files and how slow they can get, especially on mobile, and spent a couple of hours seeing if I could render the SVG to tiled images. The end result was this: https://spongeserv.com/doommaps/

 

In this case, you're trading off performance for filesize, as the 6 zoom levels here make up about 15mb of JPGs instead, but the end result will run great even on lower end phones/tablets. Knocking off a zoom level might get it down to 8mb or so.

 

The conversion process is pretty straightforward, although converting SVG files to PNG files is needlessly complex, and I settled on a node package svgexport that basically runs headless Chrome in the background.

node ./node_modules/svgexport/bin/index.js $1.svg $1.png pad 8192:8192 "svg{background:black;}"
mkdir $1
for z in 0 1 2 3 4 5
do
        zz=`expr $z + 8`
        sz=`echo 2^$zz | bc`
        convert $1.png -resize ${sz}x${sz} -crop 256x256 +adjoin -set filename:f "%[fx:page.x/256]_%[fx:page.y/256]" "$1/${z}_%[filename:f].jpg"
done

The disk space might make something like this unworkable for something like DoomWiki except for the most high profile of maps, but I could definitely see a TC release hosting their own maps as a guide for key locations and such. I know I would've loved something like this playing through some mods.

Share this post


Link to post
Posted (edited)

That's something I'd likely be keen on adding to my site @sponge, that's definitely a great addition to Revenant's work!

 

What map formats does this support? :)

Edited by Dragonfly

Share this post


Link to post

Aw man, Google Doom Maps. Awesome. When do we get a Street View?

Share this post


Link to post
Posted (edited)

I tried it and got a "Rendered filenames." message. Has it completed creating the output file? I can't find the file anywhere on my HDD. What am I doing wrong?

 

OK, I was supposed to give it a filename and not write "filenames" in the command. D'oh! So good so far, but I can't open the file. Nothing shows up, it's just a blank screen. Do I need to add more options to the command line or something? I'm a dummy at this, I know. Sorry!

dmsvg.exe -o helpself.svg "C:\Doom\Levels\Helpyourselfish\helpself.wad" map map01

 

Edited by Chris Hansen

Share this post


Link to post
On 5/5/2020 at 2:16 AM, elend said:

Aw man, Google Doom Maps. Awesome. When do we get a Street View?

idgames_blue.jpg

Share this post


Link to post
13 hours ago, Chris Hansen said:

I tried it and got a "Rendered filenames." message. Has it completed creating the output file? I can't find the file anywhere on my HDD. What am I doing wrong?

 

OK, I was supposed to give it a filename and not write "filenames" in the command. D'oh! So good so far, but I can't open the file. Nothing shows up, it's just a blank screen. Do I need to add more options to the command line or something? I'm a dummy at this, I know. Sorry!


dmsvg.exe -o helpself.svg "C:\Doom\Levels\Helpyourselfish\helpself.wad" map map01

 

 

The filenames and map names should both be entered without anything in front of them, like:

dmsvg wadname1 wadname2 wadname3 map01

You can specify multiple WADs to use; if you're rendering a PWAD map be sure to include the correct IWAD so that the necessary palette/graphics can be used.

Share this post


Link to post
On 5/4/2020 at 12:22 PM, Dragonfly said:

What map formats does this support? :)

Doom and Hexen/ZDoom formats are both supported, though I've only really tested it with Doom maps so far. Others should also come out looking alright except in cases when non-64x64 flats are used (e.g. some Heretic maps, or ZDoom maps that use high-res flats, etc)

 

@sponge If you're interested, I could probably add an option to my script at some point to support directly generating PNGs at various zoom levels, which would probably speed things up since it could just traverse the map a single time and output multiple raster images instead of having to fire up Chrome multiple times to rasterize the same SVG file over and over.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×