Hey there, I was wondering if it'd be possible to turn a BUILD map into a 3D mesh. If not, why not?
Maren at
Re: possible to turn BUILD maps into a mesh?
It should be possible, albeit not easy. I've read about tools that partially succeed in converting classic Doom maps (2.5d, just like Build) to Quake maps (3D), but why would anyone want to waste time with something like this?
Plagman at
Yeah, it should be pretty trivial. However, you'll run into problems in the levels that have overlapping geometry. E1L1 has some, but it's really minor. Levels that are built around it, though, will be unplayable.
echeese at
Well, say if I wanted to make a browser based version in flash, I wanna know if I'd have to write my own renderer or not. I probably will, judging by the speed :/
Jinroh at
Yes, it shouldn't be too hard to convert BUILD Maps to 3D. I've considered doing this myself as BUILD is a tool for level construction. However I opted just to make a simple one for my current BUILD Clone.
But if you wanted to do a BUILD type engine in Flash it may be more optimized to do something like the Canvex Team Describes here.
http://canvex.lazyilluminati.com/technotes.html
I saw a Flash BUILD clone that supported true 3D Objects and such, but I cannot for the life of me find it.
Hope this helps some.
Dany at
If this can help you: allow you BUILD map editor to log all points you need into a log file write down the points in your log file to your 3d model editor
Awesoken at
If you only care about the geometry, I have a way of converting Build maps to STL format. STL format is the simplest of all 3D formats: it's merely a list of triangles.
To anyone visiting the URL posted earlier by Jinroh, I would like to point out that the author of Canvex does not correctly understand the inner workings of the Build Engine.
"The engine is based on raycasting in a similar fashion to the Build engine."
False. Build does not raycasting. It is amazing that this myth has propagated so far and wide. In reality, Build sorts walls into perfect front-to-back order. As it draws each wall, it fills in the ceilings & floors, above & below it. Build uses a simple vertical span buffer (only needs 1 top and 1 bottom) to avoid drawing over pixels that have already been drawn.
Jinroh at
Awesoken said at
False. Build does not raycasting. It is amazing that this myth has propagated so far and wide. In reality, Build sorts walls into perfect front-to-back order. As it draws each wall, it fills in the ceilings & floors, above & below it. Build uses a simple vertical span buffer (only needs 1 top and 1 bottom) to avoid drawing over pixels that have already been drawn.
I'm not sure why that is so widely believed to be fact and posted everywhere. You certainly could achieve the same effect with Raycasting, which is what I am working on, but yeah anyone who researches BUILD and posts here should know the difference.
Though I used to be a culprit of that thinking at one point. When I was younger and around 2001-ish and started programming I thought that. ^o^
I thought I recalled you doing something like that from somewhere Ken, that is very interesting. Are there any particular details to the converter that may be interesting?
My thinking would be it just takes the two endpoints of a line and uses them verticies and then uses the height at each endpoint and makes that into two triangles. That's what I would think for walls and then it just works through the sectors doing each wall and then filling in the sector flats with triangles of their own. Tagging walls as portals or double sided as it goes.
Is that about right? ^_^
Thanks Ken.
Awesoken at
Are there any particular details to the converter that may be interesting?
The hardest part of writing a Build map renderer or converter is getting the texture mapping aligned right. Walls, ceilings, and floors have many modes of flipping, stretching, and panning - getting it all right is a full week of tedious hacking. The second hardest part is writing an algorithm, or finding a library to triangulate the ceilings and floors. My Build MAP to STL converter only does the triangulation - and it is not in the most efficient way.
Build (classic) worked with vertical trapezoids, not triangles. These trapezoids are split into 2 triangles only for GPU-based rendering. I suggest you launch JFDuke3D (or a derivative of it), enter the console (usually the Numlock key), and type: GLPOLYGONMODE=1 [enter]. This selects wireframe debug mode. Polymost and classic Build both use the same idea of sorting walls in front to back order. The difference is in the method of hidden surface removal.
Jinroh at
Awesoken said at
The hardest part of writing a Build map renderer or converter is getting the texture mapping aligned right.
Ah! That's right you enabled mappers to stretch and align the textures almost arbitrarily. Yes, that would be a great deal of work for converting to a 3D Based Render. That is very interesting Ken, thank you for bringing those to my attention. I just made a utility that dumped geometry without textures so it was easier not worrying about textures.
Awesoken said at
Build (classic) worked with vertical trapezoids, not triangles. These trapezoids are split into 2 triangles only for GPU-based rendering. I suggest you launch JFDuke3D (or a derivative of it), enter the console (usually the Numlock key), and type: GLPOLYGONMODE=1 [enter]. This selects wireframe debug mode. Polymost and classic Build both use the same idea of sorting walls in front to back order. The difference is in the method of hidden surface removal.
Yes, I figured that is how Polymost rendered things splitting them into two triangles. I'll have to check it out, I never thought of looking at it in a Wireframe view. Yes, my BUILD/ID-Tech1 alike renderer is also using trapezoids.
Thanks Ken.
echeese at
Basically, I'd like to make my own 3D game in flash, but there's a few restrictions. Flash is slow, does not have a Z-buffer and does not automatically sort/clip polygons. I want to make a fairly impressive game at low CPU cost. The newest version of Flash (10) has a new DrawTriangles function and you basically feed it x,y,t(for perspective transform), u,v and a texture and it'll render it. Any hints/tips?
EDIT: Should I post this in a new thread? I sorta derailed it offtopic
Jinroh at
Well, it really all depends on how much 3D Pipeline experience you've had.
Flash is slow, does not have a Z-buffer and does not automatically sort/clip polygons.
Depending on what you want to make indoor or outdoor, you don't necessarily need a Z-Buffer, sure you can get artifacts from Z-Sorting, but in Flash it should be fine. Generally a Quicksort will do fine for any kind of small 3D Engine. A Starfox clone would easily be doable with this.
I want to make a fairly impressive game at low CPU cost.
Well, most Software Rendered 3D Engines Tax the CPU quite a bit. You can surely optimize and I'm fairly certain Flash would run about on Par (at least) with a 486DX or something like that. So you can squeeze quite a bit out of it. Though my assumption is fairly conservative so it may be more capable. Using something like a BSP Tree like DooM or a Raycaster like Kens Labyrinth would probably be the less 3D Taxing methods.
Using the BSP you would be easily able to know what should be drawn when and it would also aid in collision detection. This speeds things up fairly nicely as you don't have to worry about a ton of complex culling of geometry.
The Raycast method is nice because you make approximations of your environment that allow you to render things more quickly. BUILD isn't a raycaster, but it makes approximations on certain geometry by rendering things like walls in vertical spans. As well as like the DooM ID-Tech Engine drawing vertical spans for the ceiling and floor.
The newest version of Flash (10) has a new DrawTriangles function and you basically feed it x,y,t(for perspective transform), u,v and a texture and it'll render it.
The thing you have to consider about Flash DrawTriangles is possible speed considerations. I'm not sure if they optimize for Space, Speed, at all whatever. If they use Fixed or Floating point or whatever. So you may have to do some research to see if you should do your own Triangle Rasterizer or not.
So what it all boils down to is experience and how complex you want your geometry. If you've done a Software Rendered 3D Engine before go for that. If not I'd suggest raycasting like Ken's Labyrinth. Either way that would probably be the quickest way of getting a 3D Engine up and running and you could still do some cool stuff with it. I mean, I am working on a more complex raycaster that deals with geometry like BUILD but it still follows the same basic principals.
Using the Ken's Lab raycast method you can get all sorts of cool things like using Height Mapping (like a voxel landscape) to get more arbitrary geometry. You could do things like fountains or circles, triangles, whatever shape you want. Christopher Lampton's book Gardens of Imagination is a good resource on Raycasting, though most info online is pretty good too.
Ken's LabDemo2.bas http://advsys.net/ken/klab/labdemo2.bas is a good resource as well as http://deltacode.sytes.net/articles.php Joe King's tutorials. Additionally with raycasting you can get decent dynamic realtime lighting and such pretty easily. Point Lights, Directional, and Ambient lights are all easily possible.
If you want to go the true 3D route I'd suggest a BSP or other good PVS strategy. You can read more about BSP here. http://wiki.allegro.cc/index.php?title=Pixelate:Issue_1/BSP_Trees
Sorry if some of the info is inaccurate or you've heard it all before, just wanted to give a thorough answer.
Ciao!!
echeese at
Thanks! I've already made a raycaster ala wolfenstein or klab (http://www.flashgamelicense.com/swfs/swf_t5wzpbja3305.swf), a Star Fox clone (http://www.flashgamelicense.com/swfs/swf_bmj0fs4c3304.swf) (without texture mapped polygons) but I guess the next logical step would be DooM. I've checked out Build's format, and I'm quite sure it's a bit too complicated for someone like me (though I do love the editor)
Jinroh at
Oh sweetness, that's some cool stuff right there. Those are playable too. ;) My stuff never gets past the graphical tech demo phase usually. Trying to break that with my BUILD/iD-Tech 1 clone.
Yes, I would do like a Doom Styled thing personally with a 2D BSP tree for the PVS. I think that would yeild the best framerate in Flash. It's up to you though because I don't know if you care or not about static geometry. Either way, I made a simple BUILD styled editor in an evening. It's not WYSIWYG, but it does the job. So if you didn't feel like making your own I could adapt mine for your file format if you want so you can do some test data and whatnot. That is if you're going to use a 2D Map with line segments. :D
In case you are interested in going the BSP route, I attached a QBASIC App/Source for a BSP Renderer. This one supports as far as I can see from the app, Non-Orthogonal Walls of the same height. Along with Texture mapped Ceilings and Floors.
Hope that helps and good luck!
Seyedof at
Hi,
I have done this partially in the past. Once i was writing a dx based portal engine, i needed some editor and test data for my engine, so i decided to use Duke Nukem maps. So i started to develop a map to x converter (DirectX .x mesh file format). Texture alignment is evil but almost 90% done. But i stopped the project. my converter can convert walls and generate texture coords into x file format but the floor and ceilings are a different story. You should split the floor/ceiling from a polygon (convex or concave) to triangles i.e triangulation which is not as easy at it seems. I have also done this part but did not integrate it into my map->x conversion tool. All a had was the build documentation files, some parts are tricky but it is quite possible to do that. here is an image of one of my converted files, the so called e1l1 map in directx x format, viewed by Deep Exploration's 3d data browser/viewer tool