The Doom Map -> Graphic Converter, also known as Maptosvg, is a program I've been making that interprets an SRB2-format (Doom-format, precisely) level into a graphical overhead map. It depicts elements such as map shapes, floor graphics, Things, and other things to make a visually-appealing map. Have you ever seen those cool maps on Nintendo Power that document game levels? Yeah, this program makes one of those.
Technically, it creates an "SVG", or "Scalable Vector Graphics" image of the map, but it can save to PNG as well. It's currently in the "Beta" phase. This is currently not considered production code and program functions may be incomplete. (but try it out, anyways!) Maptosvg is written in PHP and is made possible using the "PHP-GTK2" framework; such binaries are included in the zip archive, so Maptosvg is ready to use out of the box.
Note that, because this is not production code, glitches WILL exist in some generated maps (though most maps are already quite acceptable: see "Meadow Match", for instance.) Therefore, they are probably not suitable for distribution just yet (unless you're willing to fix them up yourself using Inkscape, which I don't mind at all.) This is essentially a "demonstration" release. Therefore, I ask that you do give comments and report bugs!
Release
=====================
Current Version: Beta 2.1 v0.51 (6/16/07)
Download: http://digiku.freepgs.com/maptosvg/maptosvg_b2.1_v0.51.zip (11.00MB)
Upgrade Instructions:
-------
For upgrading from any previous version of Maptosvg to Beta 2.1 v0.51, one must COMPLETELY OVERWRITE the directory of the previous version. One can ensure that this is done by deleting the install directory, first. (NOTE: If you ripped SRB2's resources for this program, you can simply keep those and then reapply them to the new installation in the same manner.)
Release Notes:
-------
Screenshots
=====================
(Thumbnail, click for full size.)
Must-Know Information
=====================
1. Try leaving your mouse cursor over a GUI element. This pops up a tooltip which provides information on what the element does. Sometimes, this information is important.
2. A command line mode exists with this program. Run "maptosvg.exe.bat /?" on the command line for more information.
3. This program makes extensive usage of SRB2's graphics. NO IWAD SUPPORT IS IMPLEMENTED. All graphics must be ripped into Maptosvg's "data\SRB2\" directory, in each graphic's respective subdirectory. They also MUST be converted to PNG. However, if SRB2's graphics aren't present, the generated maps will still use placeholder graphics, instead.
4. This program WILL LOOK LIKE IT WILL FREEZE, yet it actually HAS NOT. It's making extensive calculations, though it's not refreshing it's UI. This issue gets better once the message "Generating code..." appears in the program's window.
5. PNG SAVING TAKES A LONG TIME, DEPENDING ON THE SIZE OF THE RESULTING IMAGE. (Sidenote: Beta 2 v0.5 also had major bugs where it actually fed the program a broken SVG image, so errors were not obvious and PNG saving looked like it was going on forever. However, as of Beta 2.1 v0.51, errors should be much more obvious; the program now quits outright whenever an error in PNG saving has occurred.)
6. INFINITE LOOPS are known to be invoked in this program. If the map looks like it's taking an extremely long time, an infinite loop may have been caused, so the program never ends. An effective way to tell if an infinite loop has occurred is by checking its memory usage. One can do this by opening the Task Manager via Ctrl+Alt+Del, and then going to the "Processes" tab and looking for either "php.exe" or "php-win.exe". Basically, if the program's memory usage doesn't change for a long period of time despite its CPU usage, then that means nothing is changing and an infinite loop may have been caused.
Enabling verbose output is also a good way to check for infinite loops. If the text makes references to blank entities (i.e. "next_linedef test sidedef: [blank]") and repeats many times over, then an infinite loop was invoked. (Sidenote: Infinite loops should only occur AFTER "Generating code..." appears on the program's window.)
Questions
=====================
Is this for th--
Yes, this is for the Wiki!
But did you have to do this?
No, but I thought that this was just too cool of an idea to pass up. :)
-------
Program-related
-------
How fast does the program work?
It's not too bad. Running Maptosvg with the --cmdwindow handle returns a benchmark at the end of the generation. On a 2.2ghz Athlon 64 computer, I get:
MMZ (MAP99): 0.981695890427 seconds
GFZ1 (MAP01): 174.293874979 seconds
How do I use an "SVG" file?
SVG files can be opened using graphics editors that are capable of opening SVG files. Recent versions of Paint Shop Pro and Photoshop should be able to open them. The GIMP opens them as well. Said editors can only import SVG files, which are vector, to a raster image. To edit SVG files, one would need a dedicated SVG editor. Inkscape is my personal favorite. http://www.inkscape.org
See also: http://en.wikipedia.org/wiki/Scalable_Vector_Graphics
How long is PNG saving supposed to take?
Read the notice in the PNG saving dialog. I'm not kidding.
Sapphire Falls Zone at 1x scale (or 100% scale) is 4608x8512 pixels big. On a 2.2ghz Athlon 64 setup, that takes about 2 minutes.
Doesn't this program draw floor graphics? Why don't I see them?
To draw floor graphics and Thing sprites, Maptosvg needs SRB2's graphics. They're not included in the zip package. No, I will not possibly infringe STJr's copyright and package them alongside Maptosvg. No, I will not help you out with grabbing SRB2's resources, either. I will give you some hints, though:
* Map graphics go into "data\SRB2\Map\"
* Thing sprites go into "data\SRB2\Sprites\"
* Maptosvg ONLY works with PNG.
Does this program also work with Doom maps?
Doom maps haven't been tested, actually, but it should. Just load a Doom map into the program, select the MAP number, and go!
As for the Doom graphics, just put the Doom graphics in the same directory as the SRB2 graphics, respectively. Map graphics go into the "Map" directory, Thing sprites go into the "Sprites" directory, and Maptosvg only works with PNG. For Things and Sky support, editing "maptosvg_defs.cfg" is also necessary.
Maptosvg does not yet have any proper Doom support (though it has been designed with such an idea in mind since its inception.) I intend to introduce proper Doom support in a future Beta 3 version.
-------
Package-related
-------
This is coded in PHP, right? Isn't that for websites?
Actually, PHP can also be used for local programs, like command line programs (Lumpmod is one such program.) GUI programs (such as XWE and SLumpEd) can also be made using PHP, using the PHP-GTK2 framework. It's really quite amazing stuff. See http://gtk.php.net/ .
When making programs and utilities of this sort, PHP sort of simply becomes just another language, like C.
So if this is coded in PHP, will this make any outside connections? Will this open up holes in my system so it's susceptible to hackers and attacks? Since this program includes PHP, does that mean I have a server now?
It shouldn't. This program does not make any outside connections to the internet of any sort. Furthermore, PHP by itself can only start connections outside; it cannot receive them. An explicit server setup, such as with using the Apache software, is needed for that. And on that note, this program does not include a server setup. It only includes PHP.
-------
GNU GPL and Licensing
-------
This program is licensed under the GNU GPL, isn't it? Where's the source?
A separate source package exists for download. The source is also in the main distributable. The source is included in the zip archive, and is actually used when starting up the program! Look in the data directory. The source files' names start with "maptosvg" and end with ".php" (in the main program file's case, ".phpw".) The source files are divided by class.
I see a GPL violation.
Do tell me about it. I'd really like to know. Send me a PM!
Why the GPL? **** Linux!
I could go on a whole philosophical route, here. Send me a PM and I'll be glad to chat with ya'. (Also, Linux has little to do with the GPL, as far as I know.)
-------
Miscellaneous
-------
How rapid is program development?
Well, I was mostly on vacation in the bulk time that I wrote this, and since I had nothing to do, I worked mainly on this. Development was very fast back then.
Now that I'm back and I have a lot to do, I don't think development is nearly going to be as fast. Future releases may be infrequent (or may not happen at all.) Still, I'm kinda' interested in working on this program, so I can work on it as I see fit.
Isn't there already another way to generate SVGs from Doom maps?
Yeah, I actually ran into that, myself. Though, a crucial difference between wad2svg and Maptosvg is that wad2svg simply reads and draws the linedefs of a Doom map; on the other hand, Maptosvg reads linedefs as well as many other map lumps, and draws sector shapes out of what it figures. This method allows for effects such as floor drawing, while drawing just linedefs does not.
What's in Maptosvg's future?
I want to work on bug fixes with both the map generation and the program, maybe adding a few more useful features (in my eyes, the core features are already implemented at this point,) maybe even a C version? (But that's thinking pretty far ahead.) Overall I just want to fix Maptosvg to a state where it can be called more or less "complete".
Switching from GTK+ to native Windows functions has been another prospect of mine, but this point is being reconsidered, due to certain circumstances.
I found a bug with my map/with the program/I have a feature suggestion.
Awesome! Reply in this topic or send me a PM!
Also, if you found a bug with your map (or any map, for that matter), do share with me the WAD file/map and where the problems are in the generated image. I'll see if I can fix 'em up.
Technically, it creates an "SVG", or "Scalable Vector Graphics" image of the map, but it can save to PNG as well. It's currently in the "Beta" phase. This is currently not considered production code and program functions may be incomplete. (but try it out, anyways!) Maptosvg is written in PHP and is made possible using the "PHP-GTK2" framework; such binaries are included in the zip archive, so Maptosvg is ready to use out of the box.
Note that, because this is not production code, glitches WILL exist in some generated maps (though most maps are already quite acceptable: see "Meadow Match", for instance.) Therefore, they are probably not suitable for distribution just yet (unless you're willing to fix them up yourself using Inkscape, which I don't mind at all.) This is essentially a "demonstration" release. Therefore, I ask that you do give comments and report bugs!
Release
=====================
Current Version: Beta 2.1 v0.51 (6/16/07)
Download: http://digiku.freepgs.com/maptosvg/maptosvg_b2.1_v0.51.zip (11.00MB)
Upgrade Instructions:
-------
For upgrading from any previous version of Maptosvg to Beta 2.1 v0.51, one must COMPLETELY OVERWRITE the directory of the previous version. One can ensure that this is done by deleting the install directory, first. (NOTE: If you ripped SRB2's resources for this program, you can simply keep those and then reapply them to the new installation in the same manner.)
Release Notes:
-------
Code:
Beta 2.1 v0.51 - 6/16/07
=====================
* Major bugfix release for Beta 2 v0.5.
New Features Since Beta 2 v0.5
-------
* Command line options "--scale", "--scale_width", and "--scale_height"
implemented. All determine the size of an output PNG file when using
the "Execute" mode.
* New PNG saving method implemented! May be marginally faster, but a certain
amount of uncertainties may be eliminated by this new method. Also, as a
result, PNG saving is now available out-of-the-box.
Bugs/Issues Resolved Since Beta 2 v0.5
-------
* Program now completely exits when attempting to quit in the middle of
map generation.
* Faulty About dialog replaced with a new, custom-built About dialog.
* Dependency on external program "rsvg-convert.exe" eliminated. PNG saving
is now done internally.
* Incompatible working directories (i.e. any working directory that isn't
php.exe's parent directory) now stop the program. This is more of a hack
until proper support for working directories is implemented.
* Doom I episode support ("E1M1") fixed.
* Memory cap removed. Larger maps that made the program close out should
work now. (Note, however, that they may be susceptible to infinite loops,
since their size may be more prone to having irregularities than
smaller maps.)
* PHP and PHP-GTK2 binaries switched from proper versions to custom versions,
courtesy [url]http://www.perisama.net/[/url] . This should allow those who couldn't
run this program before due to PHP-GTK2 problems to run it now.
* All instances of non-existant graphics should now be substituted with
working placeholders. This includes icons for Things and simply not
filling sectors with floor graphics.
* PNG saving should not crash now even if graphics haven't been installed.
* Placeholder Thing sprites now aligned correctly.
* Placeholder Thing sprites now placed correctly.
* Things now enabled by default again in the "Execute" mode.
* Flat and sky definitions no longer point to broken images. Broken images
make PNG saving fail.
Miscellaneous Changes Since Beta 2 v0.5
-------
* GTK+ upgraded from 2.6.9 custom to 2.10.11 proper. Using an exact
GTK distribution may eliminate issues with some users not being able
to run the program.
Screenshots
=====================
(Thumbnail, click for full size.)
Must-Know Information
=====================
1. Try leaving your mouse cursor over a GUI element. This pops up a tooltip which provides information on what the element does. Sometimes, this information is important.
2. A command line mode exists with this program. Run "maptosvg.exe.bat /?" on the command line for more information.
3. This program makes extensive usage of SRB2's graphics. NO IWAD SUPPORT IS IMPLEMENTED. All graphics must be ripped into Maptosvg's "data\SRB2\" directory, in each graphic's respective subdirectory. They also MUST be converted to PNG. However, if SRB2's graphics aren't present, the generated maps will still use placeholder graphics, instead.
4. This program WILL LOOK LIKE IT WILL FREEZE, yet it actually HAS NOT. It's making extensive calculations, though it's not refreshing it's UI. This issue gets better once the message "Generating code..." appears in the program's window.
5. PNG SAVING TAKES A LONG TIME, DEPENDING ON THE SIZE OF THE RESULTING IMAGE. (Sidenote: Beta 2 v0.5 also had major bugs where it actually fed the program a broken SVG image, so errors were not obvious and PNG saving looked like it was going on forever. However, as of Beta 2.1 v0.51, errors should be much more obvious; the program now quits outright whenever an error in PNG saving has occurred.)
6. INFINITE LOOPS are known to be invoked in this program. If the map looks like it's taking an extremely long time, an infinite loop may have been caused, so the program never ends. An effective way to tell if an infinite loop has occurred is by checking its memory usage. One can do this by opening the Task Manager via Ctrl+Alt+Del, and then going to the "Processes" tab and looking for either "php.exe" or "php-win.exe". Basically, if the program's memory usage doesn't change for a long period of time despite its CPU usage, then that means nothing is changing and an infinite loop may have been caused.
Enabling verbose output is also a good way to check for infinite loops. If the text makes references to blank entities (i.e. "next_linedef test sidedef: [blank]") and repeats many times over, then an infinite loop was invoked. (Sidenote: Infinite loops should only occur AFTER "Generating code..." appears on the program's window.)
Questions
=====================
Is this for th--
Yes, this is for the Wiki!
But did you have to do this?
No, but I thought that this was just too cool of an idea to pass up. :)
-------
Program-related
-------
How fast does the program work?
It's not too bad. Running Maptosvg with the --cmdwindow handle returns a benchmark at the end of the generation. On a 2.2ghz Athlon 64 computer, I get:
MMZ (MAP99): 0.981695890427 seconds
GFZ1 (MAP01): 174.293874979 seconds
How do I use an "SVG" file?
SVG files can be opened using graphics editors that are capable of opening SVG files. Recent versions of Paint Shop Pro and Photoshop should be able to open them. The GIMP opens them as well. Said editors can only import SVG files, which are vector, to a raster image. To edit SVG files, one would need a dedicated SVG editor. Inkscape is my personal favorite. http://www.inkscape.org
See also: http://en.wikipedia.org/wiki/Scalable_Vector_Graphics
How long is PNG saving supposed to take?
Read the notice in the PNG saving dialog. I'm not kidding.
Sapphire Falls Zone at 1x scale (or 100% scale) is 4608x8512 pixels big. On a 2.2ghz Athlon 64 setup, that takes about 2 minutes.
Doesn't this program draw floor graphics? Why don't I see them?
To draw floor graphics and Thing sprites, Maptosvg needs SRB2's graphics. They're not included in the zip package. No, I will not possibly infringe STJr's copyright and package them alongside Maptosvg. No, I will not help you out with grabbing SRB2's resources, either. I will give you some hints, though:
* Map graphics go into "data\SRB2\Map\"
* Thing sprites go into "data\SRB2\Sprites\"
* Maptosvg ONLY works with PNG.
Does this program also work with Doom maps?
Doom maps haven't been tested, actually, but it should. Just load a Doom map into the program, select the MAP number, and go!
As for the Doom graphics, just put the Doom graphics in the same directory as the SRB2 graphics, respectively. Map graphics go into the "Map" directory, Thing sprites go into the "Sprites" directory, and Maptosvg only works with PNG. For Things and Sky support, editing "maptosvg_defs.cfg" is also necessary.
Maptosvg does not yet have any proper Doom support (though it has been designed with such an idea in mind since its inception.) I intend to introduce proper Doom support in a future Beta 3 version.
-------
Package-related
-------
This is coded in PHP, right? Isn't that for websites?
Actually, PHP can also be used for local programs, like command line programs (Lumpmod is one such program.) GUI programs (such as XWE and SLumpEd) can also be made using PHP, using the PHP-GTK2 framework. It's really quite amazing stuff. See http://gtk.php.net/ .
When making programs and utilities of this sort, PHP sort of simply becomes just another language, like C.
So if this is coded in PHP, will this make any outside connections? Will this open up holes in my system so it's susceptible to hackers and attacks? Since this program includes PHP, does that mean I have a server now?
It shouldn't. This program does not make any outside connections to the internet of any sort. Furthermore, PHP by itself can only start connections outside; it cannot receive them. An explicit server setup, such as with using the Apache software, is needed for that. And on that note, this program does not include a server setup. It only includes PHP.
-------
GNU GPL and Licensing
-------
This program is licensed under the GNU GPL, isn't it? Where's the source?
A separate source package exists for download. The source is also in the main distributable. The source is included in the zip archive, and is actually used when starting up the program! Look in the data directory. The source files' names start with "maptosvg" and end with ".php" (in the main program file's case, ".phpw".) The source files are divided by class.
I see a GPL violation.
Do tell me about it. I'd really like to know. Send me a PM!
Why the GPL? **** Linux!
I could go on a whole philosophical route, here. Send me a PM and I'll be glad to chat with ya'. (Also, Linux has little to do with the GPL, as far as I know.)
-------
Miscellaneous
-------
How rapid is program development?
Well, I was mostly on vacation in the bulk time that I wrote this, and since I had nothing to do, I worked mainly on this. Development was very fast back then.
Now that I'm back and I have a lot to do, I don't think development is nearly going to be as fast. Future releases may be infrequent (or may not happen at all.) Still, I'm kinda' interested in working on this program, so I can work on it as I see fit.
Isn't there already another way to generate SVGs from Doom maps?
Yeah, I actually ran into that, myself. Though, a crucial difference between wad2svg and Maptosvg is that wad2svg simply reads and draws the linedefs of a Doom map; on the other hand, Maptosvg reads linedefs as well as many other map lumps, and draws sector shapes out of what it figures. This method allows for effects such as floor drawing, while drawing just linedefs does not.
What's in Maptosvg's future?
I want to work on bug fixes with both the map generation and the program, maybe adding a few more useful features (in my eyes, the core features are already implemented at this point,) maybe even a C version? (But that's thinking pretty far ahead.) Overall I just want to fix Maptosvg to a state where it can be called more or less "complete".
Switching from GTK+ to native Windows functions has been another prospect of mine, but this point is being reconsidered, due to certain circumstances.
I found a bug with my map/with the program/I have a feature suggestion.
Awesome! Reply in this topic or send me a PM!
Also, if you found a bug with your map (or any map, for that matter), do share with me the WAD file/map and where the problems are in the generated image. I'll see if I can fix 'em up.