Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Memfis

Picture to map?

Recommended Posts

How difficult it is to make a program that would take a picture made of lines and maybe small circles and transform it into a Doom map with linedefs, vertexes and sectors? Small circles = vertexes, so the program knows where each line begins and ends and doesn't transfrom one kinda curved line into 100. Then I could draw maps while riding the subway = awesome. :D)

Share this post


Link to post

Well it certainly sounds like a great idea, I don't know how possible it would be though.

Share this post


Link to post

Well, I know that the folks at the Elma Online community made a similar converter for the game and its level format is quite close to Doom's: a bunch of polygons consisting of vertexes and lines that connect them. (levels look like this: http://elmaonline.net/images/map/115303/975) So I guess it isn't too unrealistic.

Share this post


Link to post

I imagine going from pixelated image data containing arbitrary configurations of lines to (x,y) vertices would be a pain in the ass, unless your input image was in some sort of vector-graphics format or something. Does sound like a fun idea though.

Share this post


Link to post

Ive heard talk about a plugin or something that you could run with doombuilder 2 that would let you import an image as a backdrop for your canvas, so you could scan a drawing you made on paper, lay it out on your grid in doombuilder and trace the lines yourself.

i know thats not what you meant but that seemed to be the most practical use for doom map drawings to me.

i would imagine such a program wouldnt be as exact as youd like it to be, like using extra vertices in places where youd rather it not, or vice versa. Or some hallways would be too narrow to fit through or something. Also unless your map is all outdoors or caves or something, aligning teleport flats or ceiling lights would be a bitch

drawing the sectors is usually the fastest part of making a map for me. Its applying and aligning textures, and changing light and height variation, and testing traps and stuff that are the most strenuous parts.

Share this post


Link to post

Post an example drawn image. My schedule is booked solid for masturbating about 16 hours a day, but maybe I can work in an hour here or there on this project if you are willing to pay ONE MILLION bitcoins to me. After payment is made, I do not promise to start or finish anything but I will keep the bitcoins.

The little circles as vertex rule would help distinguish curvy and non curvy lines. One problem if it mattered is it probably would have a lot of lines that weren't perfectly horizontal/verticle. Then again it wouldn't be hard to search all lines and if a line is ALMOST horizontal, just auto snap it to completely horizontal. But you probably wouldn't draw perfectly like on graph paper, so one side would warp out of scale or start going slightly crooked or something.
Plus I'm shit at coding so probably couldn't even do it. Actually maybe but I like to have low expectations of my self.
Also drawing in marker vs pen vs pencil vs faint vs dark vs lined paper vs graph paper etc would be a huge pain.

Share this post


Link to post

Obviously it would probably not be able to do much beyond just drawing in linedefs for you. Height variations, textures, flats, things, etc. would all have to be done later. And as 40oz points out, those (well, some of those) are the time-consuming parts. In any event I imagine it would be hard to implement without a mess of unclosed sectors and weird angles and single-sided linedefs that shouldn't be single-sided and so forth. On the other hand, it could be amusing to scan any old line drawing into and see what happens.

Share this post


Link to post

If you mean converting a vector format like SVG into a level then it's probably not too hard. If it's a bitmap you're talking about then that would be harder although still possible. Would need to do edge finding and then convert the lines into shapes adding vertices automatically as appropriate.

I'm not sure the tiny circles idea is necessary or would work too well - at best it could be used as a hint for straight lines. But you could potentially detect them fairly easily using a Hough transform.

A bigger problem is figuring out which way round lines should be. You'd want to be able to use the "tiny line sticking out of front side" notation used in most editors as a hint, ideally. But that should be optional and it should figure out a sensible answer itself if there is no hint.

There are ambiguities that I'm not sure how to resolve. For example how can the program distinguish a sector-in-a-sector from a pillar? Maybe there should be some notation (like an 'X') to mean "empty space here" and the default should be to always generate a sector. When fixing up in a traditional editor it's easier to delete a sector than add one.

Share this post


Link to post

I would love a program that could convert a vector drawing into linedefs even.

I've thought about an idea for a "high-level" doom editor, that uses mainly vectors and then renders down into a wad. You could even have stuff like multiple layers for floor height, ceiling height, and brightness, with the editor generating sectors as needed. I don't have anywhere near the coding skill to be able to pull this off, though.

Share this post


Link to post

I'd like to see an editor that could do bezier curves, converting them into individual line segments as appropriate.

Share this post


Link to post
fraggle said:

I'd like to see an editor that could do bezier curves, converting them into individual line segments as appropriate.

GZDoom Builder has "Draw Curve" tool.

Share this post


Link to post
40oz said:

Ive heard talk about a plugin or something that you could run with doombuilder 2 that would let you import an image as a backdrop for your canvas, so you could scan a drawing you made on paper, lay it out on your grid in doombuilder and trace the lines yourself.

You don't need a plugin for that. Just go to Edit -> Grid and backdrop setup

Share this post


Link to post

It's relatively trivial to go from an already vectorized 2D representation to another, and Doom's level format is just that.

However a working Doom map also needs splitting into sectors and a void/hollow distinction for closed shapes, and those would be super-hard to generate automatically to any satisfactory degree, so a lot of manual editing would be required anyway.

In my opinion, such a program would only aid you in importing either very rough outlines based on real data (e.g. streets and blocks in a city map, or contour lines for a mountainous/hilly outdoors), simple appartment plans (perhaps with prefabs for certain symbols) or shapes of such complexity that can only be generated programmatically e.g. fractals, but not draw stuff down to room detail.

It would certainly aid in making more life-like maps, but the degree of manual editing required would still dominate the building time, to the point that you wouldn't save much time at all.

There are even mobile apps that take photos of real places and then attempt to build a rough DXF floor plan....but you need a LOT of carefully-placed photos to cover even something like a simple appartment. You'd still be better off drawing the plan manually, IMO.

Share this post


Link to post
Maes said:

In my opinion, such a program would only aid you in importing either very rough outlines based on real data (e.g. streets and blocks in a city map, or contour lines for a mountainous/hilly outdoors), simple appartment plans (perhaps with prefabs for certain symbols) or shapes of such complexity that can only be generated programmatically e.g. fractals, but not draw stuff down to room detail.


This is what I was working on for a bit today:


It's not at all close to done, but it's already becoming more difficult to manage than I'd like. To keep the right proportions, I need a lot of guiding linedefs and vertices, and whenever they intersect it adds complexity. It'd be much easier to do something like this in inkscape and then just export it to a program that spits out some linedefs, and then bring that into GZDB or whatever.

I've been playing with WadC a bit which looks sort of good for things like this, but it's not really geared towards circular measurements, and the syntax kind of hurts my brain. I think if I wanted to use it properly I'd need to make some better documentation, and write a bunch of functions maybe.

Share this post


Link to post
plums said:

It'd be much easier to do something like this in inkscape and then just export it to a program that spits out some linedefs, and then bring that into GZDB or whatever.


What would be easier to do? The outlines? Probably yes, without all that pesky automatic linedef stitching getting in the way, but you'd still need to manually insert sectors later, which AFAIK is not exactly ideal in DB/DB2 (actually, it's discouraged, and practically impossible at the scale you are planning). You could turn off auto-stitching and forced gridding though, or use simpler editors which let you edit more freely/with less "benevolent guiding".

Which brings me to my initial point, once again: you don't need a tool which can just translate AutoCAD or whatever lines and arcs to Doom linedefs, you need something that can also handle sectors and other quirks of the Doom engine for you, and that's already a way, way more complex problem. Otherwise, such tools only do half the job.

plums said:

I've been playing with WadC a bit which looks sort of good for things like this, but it's not really geared towards circular measurements... I'd need to make some better documentation, and write a bunch of functions maybe.


I foresee a lot of cartesian-polar (and viceversa) conversions in your future ;-)

Share this post


Link to post
MaxED said:

GZDoom Builder has "Draw Curve" tool.

I'm sure there are plenty of editors that let you generate curves. I mean editing in terms of curves, like how you can put bezier curves in SVG files and go back and edit them later. For Doom you'd need to translate from some other format of course.

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
Sign in to follow this  
×