3D Level Editor?
Members - Reputation: 100
Posted 20 March 2011 - 10:05 PM
I've recently begun working on a 3D level/WYSIWYG editor for an XNA engine, instead of running inside XNA the XNA portion of the editor will run inside a Windows Form. I've been able to get the form work done and even get an XNA window running inside the form that can import content files (courtesy of samples on the XNA site although the rendering hasn't been optimized for the engine yet).
Now I'm a bit stuck here, I don't know how to proceed! I've been looking for books/tutorials that can point me in the right direction in regards to getting WYSIWYG editor type features implemented but they all seem to be dedicated to 2D editors, does anyone know of any resources that I can turn to for further information (manipulating objects, having multiple objects available at once in the world, etc) on 3D editors?
GDNet+ - Reputation: 10739
Posted 21 March 2011 - 05:43 AM
Unfortunately, as you realize, there isn't a lot of specific information on creating 3D editors.
further information (manipulating objects, having multiple objects available at once in the world, etc)
However, in general, manipulating objects in an editor, with regard to specific techniques, doesn't differ significantly from how it's done in a game - picking, dragging, etc. I'm not an XNA person, but the SDK should have examples which illustrate (at least) moving the eyepoint location, picking objects, etc. Those activities, for a starting point, are easier to do in 2D than 3D. You may want to consider, similar to many editors, multiple windows - several orthographic views and a 3D view. As a first step, translate and rotate an object in a 2D view, and render it in both 2D and 3D views. The math for that type of interface, similar to the Hammer editor, for instance, is much simpler than picking, translating and rotating in a 3D view.
With regard to WYSIWYG aspects, at least for a 3D view in your editor, use the same rendering engine as you do in your game, or, at least, those aspects of the rendering that are important - shaders, textures, etc.
To get ideas for interfaces, user manipulation of objects, etc., you may want to try out several open-source 3D editors (if you haven't already) to decide on what type of interface you want. Then take a look at the source code for that editor to see how it's done.
Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.
You don't forget how to play when you grow old; you grow old when you forget how to play.
Members - Reputation: 376
Posted 21 March 2011 - 09:39 AM
My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz
"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."
Members - Reputation: 582
Posted 21 March 2011 - 11:42 AM
It could accelerate your development, by exposing the 3D world in a visual way.
It requires a bit of effort to write and maintain, but at the end of the day it pays every single hour you spend working on it. You could start by setting up a viewport and moving the camera around. Then load objects, implement picking and selecting objects or set of objects, move, roatate , scale, clone etc,. Having a rich GUI tool-set fo RAD applications is a handy thing. Everyting in the world could be made visual and tweakable - materials, shader parameters, transformations, physics etc.
Your editor could be uber editor and do everything you can think of, or you could have a set of small editors to edit particle systems, physics systems, GUI interface etc.
Writting a 3D editor that uses you engine could force you to implement the interface to your graphics engine in a usable way. You will feel the need to make it usefull, simple and will think about every function and parameter you export from your engine , test it and debug it right away in the editor. Writting an editor that uses the engine is similar to writting a game that uses the engine. You could even write and play your game using the editor. When tested, make an exe that call the same functions and you could release a game demo. You could attach your dll engine process to the editor.exe and step into and debug your engine code.
Members - Reputation: 100
Posted 21 March 2011 - 08:46 PM
Thanks for all the responses!
For the time being the editor will mainly focus on scene editing and if there is a need for other elements I'll consider adding them in later on. I figure for the time being I should work on implementing a free form camera into the XNA window, that way when an object is loaded you can move around it.
At the very least, this should make level design somewhat easier since you can see the maps better than if it were all hard coded into the game.
I forgot to mention in my original post that I did find this tutorial,
Unfortunately, it doesn't look like it made it past two posts but it might serve as a good starting point for those stuck in a similar boat.
Thanks again for the tips!