Do you have any tips to share on making/creating a level editor?

Started by
24 comments, last by Alundra 10 years ago

from your original post, it sounds like your building a game (perhaps as a hobby), and are now working on a level editor.

just get something working as quickly and easily as possible. if possible, use third party tools and / or code to save work and time.

if you plan to release and include the editor, then you can worry about polishing it up.

a built in editor is nice. a stand alone generic editor in a linkable module is even nicer. you can just plop it into all your games, and they ALL have a built-in editor.

editors are basically just glorified paint programs (or 3d modeling programs for 3d level editors). draw the screen, left click = draw with current tool. click on buttons or menu picks or right click to change tools, save, etc.


Does picking a very-high level programming language helps with development of a custom level editor?
whatever can do the job, runs fast enough, and takes the least time to learn and implement. that's the language / tool to use. pretty much for all cases, and for all things related to game development. this of course does not factor money (costs) into the equation.


Even though my project is very small, the most I can do is creating GUI for the level editor. I wasn't able to implement the editing features I had in mind.

all you need is the ability to clear the screen, draw a tile, and draw text. the only GUI components most games need is a popup menu (doubles as message dialog), and a text entry dialog. everything else is usually some complex game specific custom screen (made simply by clearing the screen, drawing tiles, and drawing text).

its nice when the gui components of a game have a look and feel custom designed for the game.

so one of the first things i do is write menu() and getstring() routines for the game. the code is always the same, except for how they are displayed. that gives me ready to go gui components in the game for use with a built-in editor. my stand alone linkable 3d modeler and animation editor module uses generic menu() and getstring() routines from the low level game library used by the modeler and all the games.


at least it gives me an idea on what I should be doing, rather than what I could add to enhance the editing experience.

are you building games, or editors? Better a cool game with a rough editor than a rough game with a cool editor.

i heard of one guy who spent 3 years building the game engine and world editor, and then used the editor one time, for about 3 days, to build the game world.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Advertisement

are you building games, or editors? Better a cool game with a rough editor than a rough game with a cool editor.


A rough editor of a rough game, this is my current situation.

Once you have the GUI elements you still basically have to create a mini version of your games' full on rendering.

I.e. for a 2d game you'd have to draw all the tiles in your game to a context in the window, just like the regular game, although it might be a significantly stripped down version of course.

A game engine should compile to a library or DLL. The actual rendering system of the engine should be used in both the game and the editor.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid


A game engine should compile to a library or DLL. The actual rendering system of the engine should be used in both the game and the editor.

L. Spiro catches a good one, this is the most important part because you want to factor the most you can.

After that, you have two options : using QT or use your gui system like unreal engine 4.

If you don't have a gui system or just have basic one go for QT, you will win time.

If you go with QT, you will have to link widget with your engine in a reusable way.

A good way to do that is to have a RenderWindow class with the window handle inside it that will be linked on the QT widget.

Why reusable way ? Because for a particle editor or other preview window you will need to use it.

You will always think "reusable" to factor the most you can, that means write widget class.

QT has all you need to make your editor working but you will certainly have to write custom widget to be artist friendly.

Here a screenshot of my WIP editor to give you idea of what you can have with QT : http://uppix.com/f-DreamEditor12535094cf00161a20.png

It's important to note that with QT you don't need a lot of code to have result and cross platform.

Once you have the GUI elements you still basically have to create a mini version of your games' full on rendering.

I.e. for a 2d game you'd have to draw all the tiles in your game to a context in the window, just like the regular game, although it might be a significantly stripped down version of course.

A game engine should compile to a library or DLL. The actual rendering system of the engine should be used in both the game and the editor.


L. Spiro

Oh no! I wrote two different engines using the same method of graphics rendering for my editor and game. Is it acceptable? D:

Is it acceptable?

Throw away all code you have ever written in your entire life and start again from scratch.

That depends on what the level of acceptable is. In general, not even a little bit.

But the damage is done. Never do it again.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Rubbish. I can think of hundreds of reasons NOT to use the same renderer in the editor as in the game.

For example how can you write a tool to generate light maps if your renderer requires a light map?

You would have a blank screen to work with until the light map is generated.

It's nice to be able to use the same renderer, but you have to have another renderer to use when you are working.

Load in a million point terrain mesh and try to display it with your game renderer, chunk your machine, get less than 1fps and try to work with it. Display it using a simple point display, let the editor convert it into chunks and build display lists etc. Then render it with the final renderer.

The editor has to be able to display whatever elements you need in the final game and generate the elements the final renderer needs to be able to operate quickly, therefore it HAS TO have it's own renderer.

Also why spend time writing code for all the gui widgets you would need for an editor, and then ship them in the game? I drop an OpenGL or XNA window into a windows form application and then use all the toys windows gives me for free. Saving me massive amounts of time writing folder browser dialogs, file dialogs, etc.etc.etc.

The editor is not a product you are going to sell, so why spend the resources on it if you don't need to.


Oh no! I wrote two different engines using the same method of graphics rendering for my editor and game. Is it acceptable?

It's not ideal, because you've almost certainly spent more time on it than you needed to, and because you now have two sets of code to maintain; any additional features you add will need to be added to both sets of code, and any bug-fixes will need to be applied to both sets of code. This means it takes more time to add new features, and increases the chance that you'll introduce small errors into one set of code.

However, I wouldn't consider this such an extreme problem as L. Spiro seems to be suggesting as long as it works for you, and in some (often simpler) cases it may even be useful to you if you want to display the graphics in the game and editor in different ways.

- Jason Astle-Adams

Understood. smile.png

I got my own custom level editor finished, with the main features, "New", "Save", and "Open", done. Even though I started working on the editor with a different set of rendering pipeline down the road, I used what I learned from here to create it. biggrin.png It's a wonderful experience, and I'll probably share it on the Developer's Journal.

Sony recently open sourced a tonne of code for making editors here: https://github.com/SonyWWS/ATF

As for language, at the last 4 jobs I've had, it's been C++ for the engine and C# (mostly) for the tools because productivity is generally more important than optimization for tools.

This topic is closed to new replies.

Advertisement