Hello.
I'm building an application (C#) for Duke Nukem (another netplay launcher), and I'm trying to implement a map preview feature.
I need a way to generate a PNG or any image file format from a given .map file. (I've uploaded an example)
It could be a command line tool or maybe even some code.
I've found some really old stuff that won't even run on Windows. (like these: http://dukertcm.com/...3d-tools-build/)
The only working program I've found is this one http://ajgelado.eres...PView2beta2.zip (posted here http://www.amcwebfor...hp?topic=5632.0)
If you run that executable with the first argument being the .map path, it will open the 2D visualization just like the way I need it.
You know, I could print the screen and crop out the part that I want but that would be a really hacky mess.
So, if you guys know of any way to generate a image file from a .map file, I would really appreciate it!
Page 1 of 1
Convert MAP file to PNG file (2D visualization)
#1 Posted 11 July 2017 - 12:54 PM
This post has been edited by Blackthorn: 11 July 2017 - 01:22 PM
#2 Posted 11 July 2017 - 01:24 PM
I guess you can use my SVG MAP converter and conver that SVG to PNG later on..
My link
I used wkhtmltoimage for conversion with some SW beta maps for documentation purposes.
Command line: wkhtmltoimage.exe --quality 1 --zoom 2 e1l1.html e1l1.png
Spits out this:
If you want to study the SVG sources I did, I can of course help there as well.
Code is very ugly though..
Writing straight to a bitmap shouldn't be too hard.
My link
I used wkhtmltoimage for conversion with some SW beta maps for documentation purposes.
Command line: wkhtmltoimage.exe --quality 1 --zoom 2 e1l1.html e1l1.png
Spits out this:
If you want to study the SVG sources I did, I can of course help there as well.
Code is very ugly though..
Writing straight to a bitmap shouldn't be too hard.
#3 Posted 11 July 2017 - 02:05 PM
Hello oasiz.
Impressive tool, and outputing the SVG is not really a problem since I'm using WPF (although it would be really helpful to already get a bitmap)
The only thing that will be a problem is that it requires the user to input the name of the .map. Do you think it would be too hard to modify it in a way that it simply "eats" in the .map and straight outputs the svg?
* by "eating in" I mean like, simply passing in the path to the .map as an argument.
Also, can you provide the source code?
(I got say I'm really impressed that I got an answer so fast in here, I didn't thought I was gonna get a reply at all, even less a working one, everything related to Duke Nukem 3D is so ancient haha, thanks a lot mate)
Impressive tool, and outputing the SVG is not really a problem since I'm using WPF (although it would be really helpful to already get a bitmap)
The only thing that will be a problem is that it requires the user to input the name of the .map. Do you think it would be too hard to modify it in a way that it simply "eats" in the .map and straight outputs the svg?
* by "eating in" I mean like, simply passing in the path to the .map as an argument.
Also, can you provide the source code?
(I got say I'm really impressed that I got an answer so fast in here, I didn't thought I was gonna get a reply at all, even less a working one, everything related to Duke Nukem 3D is so ancient haha, thanks a lot mate)
This post has been edited by Blackthorn: 11 July 2017 - 02:13 PM
#4 Posted 11 July 2017 - 04:29 PM
Welcome to Duke4.net, where the Eduke32 source port gets daily updates >20 years after the game's release
#5 Posted 11 July 2017 - 10:43 PM
Sure thing, I can provide those to you via PM.
The code is kinda ugly enough that I'd rather not post it publicly as most of it was simply a curiosity experiment done with qb64 over a weekend and later on decided to wrap it up for a release
Accepting a map as an argument is trivial, plus I can speed up the conversion / questions quite considerably.
I can run you through the code that gets x1y1-x2y2 coordinates for walls in an array (along with sprite xyz), after that the drawing operations should be relatively simple.
Got discord or similar?
Might be easier in real time.
The code is kinda ugly enough that I'd rather not post it publicly as most of it was simply a curiosity experiment done with qb64 over a weekend and later on decided to wrap it up for a release
Accepting a map as an argument is trivial, plus I can speed up the conversion / questions quite considerably.
I can run you through the code that gets x1y1-x2y2 coordinates for walls in an array (along with sprite xyz), after that the drawing operations should be relatively simple.
Got discord or similar?
Might be easier in real time.
#6 Posted 12 July 2017 - 02:22 PM
Thanks a lot oasiz!
I ended up reading the map file myself haha.
But again, thanks a lot for the information!
I ended up reading the map file myself haha.
But again, thanks a lot for the information!
Share this topic:
Page 1 of 1