Duke4.net Forums: Convert MAP file to PNG file (2D visualization) - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Convert MAP file to PNG file (2D visualization)

User is offline   Blackthorn 

#1

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!

Attached thumbnail(s)

  • Attached Image: example.png


This post has been edited by Blackthorn: 11 July 2017 - 01:22 PM

0

User is offline   oasiz 

  • Dr. Effector

#2

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:

Posted Image

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.
1

User is offline   Blackthorn 

#3

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)

This post has been edited by Blackthorn: 11 July 2017 - 02:13 PM

0

User is offline   Micky C 

  • Honored Donor

#4

Welcome to Duke4.net, where the Eduke32 source port gets daily updates >20 years after the game's release Posted Image
0

User is offline   oasiz 

  • Dr. Effector

#5

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 :P

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.
0

User is offline   Blackthorn 

#6

Thanks a lot oasiz!

I ended up reading the map file myself haha.

But again, thanks a lot for the information!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options