Jump to content

PNG2WAD, or: How i stopped worrying and started converting PNG's to maps


Redneckerz

Recommended Posts

  • 2 years later...

It is very interesting. And what is there to convert levels from AssaultCube (cube 1 engine, 2.5d) to doom map in this way? First we take a screenshot of the map in assaultcube, and then we convert it into a doom map and then we edit our hands in the editor (Doom builder, etc.)?
 

20230629_09.04.22_ac_urban_CTF.jpg

Edited by camper

Share this post


Link to post
3 hours ago, camper said:

It is very interesting. And what is there to convert levels from AssaultCube (cube 1 engine, 2.5d) to doom map in this way? First we take a screenshot of the map in assaultcube, and then we convert it into a doom map and then we edit our hands in the editor (Doom builder, etc.)?
 

20230629_09.04.22_ac_urban_CTF.jpg

If i get it right, if you mimic this same layout in solid color, it could technically port them over. 

 

Could be interesting because you could then convert most Cube levels over to Doom given time and effort.

Share this post


Link to post
2 hours ago, Redneckerz said:

If i get it right, if you mimic this same layout in solid color, it could technically port them over. 

 

Could be interesting because you could then convert most Cube levels over to Doom given time and effort.

This is just a screenshot straight from AC's multiplayer game in Spectator State. I think this should be redrawn, as shown in the first post of this topic.

Yes, I would like to experiment with it.

Share this post


Link to post

I've made a map generator to accompany PNG2WAD. Was a fun little project, though it features a handful of small issues and things to work on.

 

https://www.dfdoom.com/mapgen/

 

Some examples of its output:

fed7994b6f0f7184acedf80f416889be.png

 

If I were to develop further I think making a few more prefab rooms would be a good starting point, as well as a variety of start rooms and additional modifiers.

 

It's a shame PNG2WAD doesn't support additional features such as control over enemy/thing placement, teleporters, sector height variation / stairs, etc.

Edited by Dragonfly

Share this post


Link to post
On 9/20/2020 at 2:54 PM, Dexiaz said:

 

Well...I've already did this (nsfw) many years ago without special converters...shame on me.

 

So since imgur has purged this post, what the heck even was the image?

Share this post


Link to post
15 hours ago, Dragonfly said:

I've made a map generator to accompany PNG2WAD. Was a fun little project, though it features a handful of small issues and things to work on.

 

https://www.dfdoom.com/mapgen/

 

Some examples of its output:

fed7994b6f0f7184acedf80f416889be.png

 

If I were to develop further I think making a few more prefab rooms would be a good starting point, as well as a variety of start rooms and additional modifiers.

 

It's a shame PNG2WAD doesn't support additional features such as control over enemy/thing placement, teleporters, sector height variation / stairs, etc.

 

Do you have the source for the generator published anywhere? I'm curious about the generation; looks like you might just be generating rectangles next to other rectangles? Have you looked into using a quad tree? Chapter 3 of the free Procedural Content Generation in Games book goes into this. 

 

I think if things like height variation get added to PNG2WAD it will start to get out of hand - either the image will have to rely on a ton of subtle shade differences that humans won't perceive very well or it would need multiple images (for layers) and it starts kinda defeating the point, since it would be easier just to fire up a map editor.

Share this post


Link to post
4 hours ago, david_a said:

looks like you might just be generating rectangles next to other rectangles?

 

Nailed it! :p

 

You can view the source as you would any webpage, it's all there: [edit: linking to a view-source: link on DW becomes broken, probably some link sanitisation going on there - but yes, right click then view page source and you'll see everything]

 

It's not overly sophisticated by any stretch of the imagination, just a fun little weekend project. As it stands I don't feel motivated to go too in-depth and elaborate on this generator when the output will always be flat and there's no control over enemy placement or thing placement - some maps are practically impossible (well, unpleasantly difficult) despite being laid out well simply due to the PNG2WAD tool picking random options. 😅

That said, I do think I could repurpose this generator into a D&D map generator of sorts, if I set up a tileset for it - and that would be worthy of studying better generation methods; Thanks for the link!

Edited by Dragonfly

Share this post


Link to post

Ah, I didn't realize it was all client-side JavaScript.

 

I've messed around with generating levels for ECWolf since it has a text-based level format similar to UWMF that's not too bad to deal with. My generator was also at the stage of "slapping rectangles together." I found that book which has a lot of interesting ideas for more sophisticated generators, but I think one of my limiting factors is that I barely care about Wolf 3D so it's hard to get motivated. For something like D&D maps the ideas in there would be great. The stuff with "grammars" for describing the flow of a level sounds really neat.

 

The prohibitive effort involved with making a "real" generator led me down the path of trying to use a GAN to generate levels based on user-created maps, but there's just not enough of them. I downloaded all I could find and after filtering out all the absolute garbage I only had something like 5,000. I can't remember if that was before or after I expanded the data (mirroring, rotating, etc).

 

Oh, I remember that I did make a cave level generator using cellular automata. That's also covered by the book I believe; it's a fun rabbit hole to go down!

Share this post


Link to post
1 hour ago, david_a said:

Oh, I remember that I did make a cave level generator using cellular automata. That's also covered by the book I believe; it's a fun rabbit hole to go down!

 

On one hand I'm quite excited / interested in the idea of diving deeper... On the other hand I'm rather hesitant, knowing just how much time it'd eat up! 😅

 

Definitely something I've got some interest in though, so I won't say never! Thanks for your insight, I appreciate it.

Share this post


Link to post

I realized I have a some images on my work machine I can show off. Attached is a generated cave. The pink dots are light sources and the yellow dots are treasure (supposed to be hidden in the shadows). I made a lighting system for ECWolf that relied on a ton of different texture definitions. It was completely fake (items/enemies/etc weren't affected by it) but still looked pretty cool.

 

You can see that just the preview image could probably be pretty useful for D&D.

 

I had moved on to generating caves in Doom instead of Wolf 3D since the limitations were annoying. Far, far harder. I don't have anything on hand to show off, but where I left off was adding height variations. What I tried was very unsatisfying and it didn't feel very cavey.

 

Cellular automata for caves is pretty simple to get going with, but the hardest part will be stopping! 😊

 

Seed 01 - Step 11 - Treasure.png

Share this post


Link to post
4 hours ago, david_a said:

I realized I have a some images on my work machine I can show off. Attached is a generated cave. The pink dots are light sources and the yellow dots are treasure (supposed to be hidden in the shadows). I made a lighting system for ECWolf that relied on a ton of different texture definitions. It was completely fake (items/enemies/etc weren't affected by it) but still looked pretty cool.

 

You can see that just the preview image could probably be pretty useful for D&D.

 

I had moved on to generating caves in Doom instead of Wolf 3D since the limitations were annoying. Far, far harder. I don't have anything on hand to show off, but where I left off was adding height variations. What I tried was very unsatisfying and it didn't feel very cavey.

 

Cellular automata for caves is pretty simple to get going with, but the hardest part will be stopping! 😊

 

Seed 01 - Step 11 - Treasure.png

 

This is awesome! Yeah, definitely something to get stuck into in the future.

 

The other option I always see thrown about is making use of perlin noise, which I'm not so sure would be good for rooms and such but I know it's a great technique for natural terrrain. I recently watched a video of a talk that took place at Jfokus 2022 on how the Minecraft developers made use of several different sets of Perlin Noise to handle their world generation. I'm sure in practice it's a lot of work to implement but the way it's explained here makes it sound achieveable. Again, another avenue I'd definitely be interested in pursuing.

Share this post


Link to post

Gradient noise (I think everyone uses Simplex nowadays; also from Ken Perlin) is good if you want to create enormous or perhaps infinite terrain. It's not so great for something like a cave in Wolf 3D / Doom / D&D where you want it to be an enclosed area. Cellular automata excels at that since you can set up the rules so that the empty area will never connect with the border. Chapter 3.4 in that book talks about CA a little, but there are lots of detailed write-ups online.

 

Edit: One more link - if you haven't seen the Red Blob Games tutorials you're in for a treat. He has a ton of interactive explanations for various topics.

Edited by david_a

Share this post


Link to post
  • 1 month later...

I experimented with converting map images from AC to wad.
1. First you need to remove the distortion of the map, I did this on boxes that are actually cubic in shape and using aspect ratios led the image to ensure that the boxes were square, not rectangular. Then the extra parts of the image were transferred to the alpha channel.
2. Then I reduced the resolution, considering that 1 pixel has a size of 64*64, by the way, the size of the small box in AC is also close to the size of 64*64. Therefore, it is not difficult to choose a reduction factor.
3. The next step is painting. I just painted all the corridors black and outside the sectors white.
4. Next, convert the image to wad using png2wad. And only then there will be a manual edition of the map.

 

Spoiler

20230629_09_21.52_ac_dust2_TSURV.jpg.05543dd68d0eb5943898db13a22f0f39.jpgk8v_dust2.png.272b24ac9a915f98d160530ac2ab6d5b.pngk8v_dust2_55.png.1efd955a519c05e65468cf688758b786.pngk8v_dust2_55blk.png.2f98d57f1a080f9453c5e6bcedf69cdb.pngslade_dust2.png.52b0b7887295dd2b9a838f0d0df0e673.png

 

Edited by camper

Share this post


Link to post
16 minutes ago, camper said:

I experimented with converting map images from AC to wad.
1. First you need to remove the distortion of the map, I did this on boxes that are actually cubic in shape and using aspect ratios led the image to ensure that the boxes were square, not rectangular. Then the extra parts of the image were transferred to the alpha channel.
2. Then I reduced the resolution, considering that 1 pixel has a size of 64*64, by the way, the size of the small box in AC is also close to the size of 64*64. Therefore, it is not difficult to choose a reduction factor.
3. The next step is painting. I just painted all the corridors black and outside the sectors white.
4. Next, convert the image to wad using png2wad. And only then there will be a manual edition of the map.

 

In Doom Builders you can put the image as a background and it should help to draw further geometry

image.png

Edited by SilverMiner

Share this post


Link to post
  • 3 weeks later...
On 9/1/2023 at 12:11 PM, SilverMiner said:

 

In Doom Builders you can put the image as a background and it should help to draw further geometry

image.png

This is great advice, unfortunately I only appreciated it now that I installed the old doom builder, in addition to the ultimate doom builder. In the ultimate doom builder this doesn't work correctly and it confused me a bit.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...