Archived

This topic is now archived and is closed to further replies.

Coding a simple 3d level editor

This topic is 5516 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ive been messing about with 3d demos etc in opengl, and i was wanting to create a level editor to make life easier. Heres what i thought, usual 4 pane application, move in each of the windows with the arrow keys and pgup and pgdown (to move along the axis), and pick specific points in the window using the mouse to create vertices. Then when you select the polygon uve just made you can choose a texture to apply to it. Hope that made sense, thats my plan can anyone give some advice I dont actually know how to do the 4 windows part and dont know how to have a texture browser, could you point me towards some tutorials or explain how to do it, i know windows API (obviously nothing advance as you can see), dont have any major problems with OGL, but dont know MFC Thanks

Share this post


Link to post
Share on other sites
i once tried to learn mfc but i stopped reading the book after 60 pages
60 pages of blah blah blah and a code example to learn how to set up an mfc application
lol and for 40$
i won t read the rest of the book is just one of all these crappy learn mfc books

if anyone could point me to a tutorial part with quick mfc tuts which only describe what you need and doesn t mention tons of useless crap you never need

Share this post


Link to post
Share on other sites
Been thinking about similar stuff recently too.

MFC will work with OpenGL flawlessly, I''ve done it before, but I had a small problem with getting menus and stuff to refresh over the GL window, but no biggy.

As for the 4 panes, do you have any experience with MFC? If so, you should be able to use the splitter window class or something like that.

I hope you''ve got lotsa time avaiable, and you should plan very meticuously.

As far as actual editing, I''d recommend you do something similar to most 3D editors, use brushes. As far as I can tell, a brush is simply a box, sphere, cone, or other predefined polygon mesh. You should make it where you can place these, and then be able to subtract (or CUT) the brushes from the world. Using brushes makes level editing go a lot quicker, and it should look pretty good too.

As far as textures and the like, you''re pretty much on you own there, I dunno anything about it, but you could probably just create an array at run time that stores the name, location, and type of every usable texture in a given directory. Just use a listbox to choose the texture and then apply it.

Lighting, physics, and the like are a little too complex for me to talk about, and I doubt I''d do much good.

Just look at some level editors you may already have, such as UnrealEd (DeusEx or Unreal Tournament), or GEdit (For lithtech games such as AVP2).

Good luck, and keep trying.

En taro Adun!
Doom to all who threaten the homeworld!
*Protoss Zealot - Starcraft*

Share this post


Link to post
Share on other sites
Well, as far as MFC goes, Sam''s Teach Yourself Visual C++ in 21 Days is what taught me. I don''t have crap loads of experience with MFC though, just a some win32 and OpenGL stuff.

En taro Adun!
Doom to all who threaten the homeworld!
*Protoss Zealot - Starcraft*

Share this post


Link to post
Share on other sites
Thanks for the replys everyone.
Don''t know much about brushes but i was thinking that i can create the size of the level (a huge box), make the box a sky box and then start putting my level inside the box.
I now know how im gonna do the texture bit.
Looks like im in for a lot of reading these next few days
My aim is to keep it simple im not gonna do lighting or anything like that yet, just allow the placement of polys and apply textures to them, then save (obviously load and edit will be in it)

If anyone has more advice id be greatful.

Share this post


Link to post
Share on other sites
I'm coding quite an advanced level editor (q3radiant-style CSG, brush-based objects, etc.) at the moment. It's nowhere near finished, but you can take a look at some screenshots by following the DarkVertex link in the sig below. They're old pictures (the user interface has completely changed, see below), but they show you what I'm up to. I've found that it's important to set boundaries, and then to code to those boundaries.

Sit down, with a piece of paper, and plan everything. When you're unsure about something, go to the piece of paper. Don't try and create a map editor that's got so many "useful" features it's impossible to code. And start simple. But don't be afraid to change the program. I recently threw out the entire user interface and started again with it, to make it better. I'm currently moving code around and stuff to fit it in with the new UI.

I mentioned before that it's brush-based, and I've done a huge amount of research into this method of map making. A brush is an enclosed object, like a box, or cylinder, or whatever, which has it's own BSP tree. That sounds scary, right? But it's necessary to do stuff like CSG (think of the Carve functions in Hammer Editor and q3radiant) really easily (well, relatively easily; it's horrible trying to do CSG without BSP trees). If you're really serious about building a fully-featured map editor, like I (stupidly) am, then you should take gameinstitute.com's Advanced BSP, CSG and PVS course, which covers everything you'll need to know, or do some searching around the net on brush-based map editing. You probably won't need to use brushes unless you're doing complex functions like Carve and Hollow, so you can stick with just storing your object's polygons in a list.

By the way, DarkVertex is coded entirely in VB, with OpenGL doing the rendering. I'm using four picture boxes to display the scene...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]


[edited by - iNsAn1tY on November 5, 2002 7:18:59 PM]

Share this post


Link to post
Share on other sites