Sign in to follow this  
ic0de

The process of making a level editor

Recommended Posts

I have decided to help out my artists and develop some tools such as a level editor for my engine. Right now the workflow involves exporting chunks geometry data from blender then editing a text file to list the file address of each chunk and its position as well as the position of entities like monsters or lights. I was hoping to create a tool that would generate that file and let the artist move each chunk or entity and see the results graphically. I was wondering is the level editor usually using the same engine (mine is made in house) as the game itself or is it usually an original piece of software? Are there any universal editors than can be scripted to export to a custom map format? Also how does 3d selection work I would assume it involves ray-casting? Can someone point me in the right direction for making a level editor?

Share this post


Link to post
Share on other sites
The editor will be a stand-alone project that links to and uses your actual in-house engine (meaning you need to add support for multiple views to it and remove its game loop if it has one built-in).

Valve Hammer Editor does not export in custom formats, but the .MAP/VMF files it exports are easy to parse and convert to something in-house, though it is unlikely to be suited for your purposes since it cannot load your terrain/models.
You will find that to be a common theme among all editors, so it is generally easier to make your own primitive editor and add it to over time.

3D selection does involve ray-casting. If that worries you, you may not be comfortable enough with 3D math to be able to complete a usable editor.


L. Spiro Edited by L. Spiro

Share this post


Link to post
Share on other sites
[quote name='L. Spiro' timestamp='1350445264' post='4990993']
3D selection does involve ray-casting. If that worries you, you may not be comfortable enough with 3D math to be able to complete a usable editor.
[/quote]

No. That doesn't worry me it's just I already use raycasting(provided by bullet physics) to check if my player can grab something among other things. I was just wondering if 3d selection worked the same way with a mouse as opposed to a rotating view. I was thinking just cast a ray from the mouse into the screen and select whatever the ray hits.

Share this post


Link to post
Share on other sites
Just keep it as simple and practical as possible at the beginning. When I did a simple 3D level editor(simple as in 1 weeks work) I made sure It was a completely separate entity to my game. Therefore, the only thing I needed to do was to decide how I was going to store the data, so I could parse it accordingly when my game loads the level. It did however use alot of the code from my game, most notably the render and input code, with modifications to suit the editor;

Because I had such a short amount of time, I decided to limit the artists abilities to just translate,scale and rotate objects. I also decided to leave out the ability to add textures in the editor. I believe as a starting point, this is what you should aim to do.

You would have to make a decision as to whether or not you want to load the models from within the program dynamically, or to load them before hand. Clearly the dynamic option would be more use to the artist, as they wouldn't need you to dig around the code to load another model, but as a start, the pre-load method is adequate.

For ray-casting, you need to make sure you are only casting inside the "viewport" where your scene is being rendered. Otherwise, you will end up with a bogus cast because of the mouse position taking the entire window into account. Edited by dAND3h

Share this post


Link to post
Share on other sites
[quote](1) Just keep it as simple and practical as possible ... (2) It was a completely separate entity to my game .. (3) decide how I was going to store the data, so I could parse it accordingly ... (4) use alot of the code from my game, most notably the render and input code, with modifications to suit the editor;
Because I had such a short amount of time (5), I decided to limit the artists abilities (6) to just translate,scale and rotate objects. I also decided to leave out the ability to add textures in the editor.[/quote]
Sorry but I disagree on some of the concepts here and I need to point those out so people can properly relate to the efforts involved.

(4), (2) We could discuss that. There's a code dependancy.
(3) this is not future proof. How my code loads its own data is the last of my concerns. What concerns me is compatibility across other DCC tools as...
(6) telling artists "you must use my editor" and "you cannot do that" is pretty far from best practice.
(1), (5) If I'm in a hurry, I don't write a level editor. I bolt my features on pre-made programs. Took me two days to write the blender scripts, and a week to refit the whole asset workflow. And I can guarantee my feature set is pretty rich.

My first (and last) attempt at a "slick" 3D level editor is something around 2001-2004 I think. Words fail to describe how limited it was and how much effort it required. In the end, it was just easier to filter input from other programs (not to mention this is required anyway as there's a large availability of test data on the net).

Share this post


Link to post
Share on other sites

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