level editors programming tutorial
Hey
I''ve been writing a very small and very-basic 3D engine. I used a small file to do the testing ( a simple room with a few walls ).
The thing is that i should have made the level editor as soon as i decided on the map format, but, as i understood it, building a level editor from scratch alone may even take more time then the time it takes building the 3D engine.
(i''ve just realised why people tend to make their engine using Quake''s MAP format: there are lots of level editors)
Anyway, i''m making an engine with portals and i can''t realy seem to find info on "how to make your 3D level engine".
Do ya know any links on the subject?
thanks in advanced
Wolverine,
If you know what sort of information is required to
represent the world (in the MAP file), it should be easy
to create tools that put the world information in the right
format. For instance, if you are making a regular brush
tool (I think that's what it is called in the Quake editors),
it should be relatively easy to come up with:
Let the user click a point on the screen. Convert this screen
point to world space. Let the user move the mouse and when they release the mouse button, convert the new screen point to world space. Calculate the other two points based on the first two. Store these four points in the appropriate format (eg. convert to local space if necessary).
You could do the same for a select tool - Let the user click a point on the screen. Convert this screen point to world space. Let the user move the mouse and when they release the mouse button, convert the new screen point to world space. Select all brushes with all vertices within the range of selected points minz, maxz, miny, maxy (for the left view).
Does that make sense? What exactly are you having problems with?
Paulcoz.
Edited by - paulcoz on November 19, 2000 6:31:20 PM
If you know what sort of information is required to
represent the world (in the MAP file), it should be easy
to create tools that put the world information in the right
format. For instance, if you are making a regular brush
tool (I think that's what it is called in the Quake editors),
it should be relatively easy to come up with:
Let the user click a point on the screen. Convert this screen
point to world space. Let the user move the mouse and when they release the mouse button, convert the new screen point to world space. Calculate the other two points based on the first two. Store these four points in the appropriate format (eg. convert to local space if necessary).
You could do the same for a select tool - Let the user click a point on the screen. Convert this screen point to world space. Let the user move the mouse and when they release the mouse button, convert the new screen point to world space. Select all brushes with all vertices within the range of selected points minz, maxz, miny, maxy (for the left view).
Does that make sense? What exactly are you having problems with?
Paulcoz.
Edited by - paulcoz on November 19, 2000 6:31:20 PM
quote:
..."but, as i understood it, building a level editor from scratch alone may even take more time then the time it takes building the 3D engine."
Very true I know of number of ways to create worlds.
1)Make a brush based csg - 3D
2)Make a boundary type surfaces i.e. vertices, edges, faces, halfedges, etc. and do boundary evaluation for csg.
3)Make an overhead map in 2D and use extraction to get 3D, this is limited way to build worlds aka. doom style. Need to have floor/ceiling info for creation of windows, etc. Here you can use 2D boundary eval. csg or bsp csg.
4)Make convex/concave cells with thickness and each cell connected to other through portals. Possibly some csg needed here for carving windows, etc.
5)Make a boundary eval. csg with vertices, edges, etc. and involve vertex editing. This one is hard to implement.
In all these cases it's possible to do cutting in realtime and only limited(speedwise) by size of the level. In this case the whole world is made in object space or world space (depending if you want to rotate the level and place it in position). The whole level consists of linked brushes so the more you have them the longer it takes to check for intersection with a cutting brush.
The easiest:
1)Portal based
2)Brush\bsp based
3)Boundary eval. i.e. csg based
4)Csg based with point modification
If you get the chance, download the free truespace 1.0 3D editor program and experiment with sweep mode, bevel mode, 2D polygon csg and point editing for starters. Check out doomed (free with source) doom editor to see how an overhead 2D cell based editor works. For bsp\brush style check out free w\source Genesis3D 1.1 editor and possibly??? for portal based one check out Crystal Space engine. An another one could be QRadiant, i.e. quake based (brush/bsp cutting). There's also a csg/boundary eval. one called "poly engine/solid editor" from here: alexey
The hardest editors to make are patch/b-spline/nurbs type editors because it's hard to make them precise and w/o errors. The ones I've described above are polyhedra based i.e. primitives made out of sheets or faces, no curves. I've made a simple 2D boundary eval. editor that you can find on my website. I think you can write it so that you can extract the resulting shape into the vertical to get 3D, then you could feed it into bsp compiler and create a solid based bsp level editor if you wanted. Solid based level is where you have a closed cell and each face has a front and back. If you traverse the bsp tree and you end up in the back node of a face then you're in solid space, good for collision detection.
Like you see there are tons of ways to make an editor but all will be somewhat constrained in the kinds of levels you can create. For example, the genesis3d editor can do csg operations but no vertex/point editing so once you create a box you can't deform it by creating new vertices and edges. You can scale, shear, translate and rotate it though. Good luck!
my homepage
E-Mail: BlueOrbSoftware@mailcity.com
Edited by - JD on November 20, 2000 1:28:38 AM
yep...
i was thinking in a DOOM style level editor, since it looks easier to make then all the others. if i started to make a quake style level editor with 3 windows for the each axis plus 1 window for 3D level preview, i have the fealing that i would only finish it when i''m 70 years old...
anyway...
i''ve never used doomed, but i know what kind of editors you''re talking about. when i started making levels for doom i used DEU, wich was simple to use and did the job well done. maybe making a similar editor with a few enancements could do the trick.
thnks for your help.
i was thinking in a DOOM style level editor, since it looks easier to make then all the others. if i started to make a quake style level editor with 3 windows for the each axis plus 1 window for 3D level preview, i have the fealing that i would only finish it when i''m 70 years old...
anyway...
i''ve never used doomed, but i know what kind of editors you''re talking about. when i started making levels for doom i used DEU, wich was simple to use and did the job well done. maybe making a similar editor with a few enancements could do the trick.
thnks for your help.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement