Jump to content
  • Advertisement
Sign in to follow this  
tom_mai78101

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

This topic is 2013 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

I'm right now creating my own level editor for a small project I'm working on while I'm on conscription service. I realized mid-development that creating a custom level editor isn't easy as it seems.

 

I thought you just draw tiles and export the map in 2 easy steps. 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.

 

Do you have any tips I can read about for creating a level editor? What methods have you done to overcome obstacles?

Share this post


Link to post
Share on other sites
Advertisement

Hi,

 

Nice editors like this typically require a team to work on them. Making editors is probably considered to be in the intermediate to advanced level of coding skill.  The issue with graphics editors of all types is that you will have to learn some low level coding concepts. Even if you are not using C++, getting a very thick book on C++ pipeline creation would be a must to point you in the right direction. Another thick book on your graphics API of your choice would be essential, too. Most other languages would be either very difficult to find the resources or simply not available.

 

This really is not in the area of game programming but game engine or pipeline programming. Why not use the level editor of an open source game engine and customize it to your liking?

Share this post


Link to post
Share on other sites
Editors are actually a sneaky kind of tool that most people go "huh" when they get to, or at least I did.

As 3Ddreamer said though the reality is that even something like a 2d tile map editor can be pretty involved, usually you're talking about at the least implementing something like basic OS gui controls(menu bars and such) that might require reading up on, or using a toolkit like QT or something. 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. Then you have to implement the actual editing, that usually means having your same map objects that you would in the normal game and making a bunch of click commands stuff that modify their in memory representation, which then changes how they're drawn onscreen too. After all that you still have to write the code to export it to the file type you want. For a lot of games the tools are literally half the coding project, yet they don't get nearly as much love.

Its one of those things you might want to look into an open source tool to use unless you have a serious need to make one, or want to learn how to make said tool by itself. Frankly for a lot of big games the editor basically becomes its own mini game of sorts, it may have scripting editors and custom entity placement and all kinds of magical tools to export specific data for that engine. It may be one monster tool or suite of tools that all the designers and artists and level designers are working with for a long time. Edited by Satharis

Share this post


Link to post
Share on other sites

I've built a couple level editors.

 

A 2D tile editor (just recently - still in development but it does most of what I need), and a full 3D level editor for my undergraduate project at university.

 

Level editors are a lot more complicated than they initially seem. You need a good chunk of the game's functionality in the editor itself along with a lot of extra functionality on top. Top of the line editors usually are fully integrated into the game and you can jump in and test your level almost seemlessly.

 

At the very least you need:

-GUI/Window code

-Other interface code (picking, multi-select, user friendly features like undo/redo for all of your operations)

-Rendering code (you need to render the textures you load and the tiles you've placed, and any other entities you've added)

-Asset management code (texture/tile/shape/entity loading/saving/adding/deleting/exporting)

-Simple camera code (you need to navigate your map somehow)

 

There are probably a lot of things I forgot to add here. For 2D games I like to be able to drop a character into the editor and move around testing the collision detection and layer transitions (i.e. going up stairs), this requires including more things into the editor.

Share this post


Link to post
Share on other sites
Thanks for the feedbacks. I do know that there are some listed above in all of your posts aren't in my custom level editor yet, at least it gives me an idea on what I should be doing, rather than what I could add to enhance the editing experience. I have also heard of games integrated into editors, such as Blizzard's games, so integration seems like a good advanced step.

Does picking a very-high level programming language helps with development of a custom level editor?

Share this post


Link to post
Share on other sites

This is one of the reasons I like writing my own software rendering code for games, and only use SDL to display the final frame on the screen... I can just use the same rendering code in the editor, and dump it to the screen basically the same way.

 

My main advice is to watch out for feature creep. My editor has gotten a little excessively nice to use, but over 16K lines of code to wade through ohmy.png

 

I'm a big fan of C++ with smart pointers and RAII style programming for this kind of thing. FLTK is my current API of choice, but WxWidgets and Qt are good too.

 

I would recommend NOT to scrimp on undo/redo functionality, because the feeling of safety it provides makes working much more relaxing smile.png At least one level of undo/redo, but preferably multiple. My system is pretty elaborate, but I can describe it if you want.

 

Serialization is another big thing. That is, saving and loading from disk. I like to keep actual disk operations to a minimum, and do all my serializing in memory. For example, I have a Map class with lots of member variables, which is where all the actual editing happens, and a MapSaveData class, which is really just a single block of data, which can be created from a Map, or a Map can be created from it, or it can be written or read from disk with a single fwrite/fread.

 

IMO, the main reason to make your own map editor is the ability to place sprites and enter custom data for them akin to RPG Maker. If all you need is basic tilemap editing and placing of enemies in a side scroller or something, then it may not be wroth the trouble... although it will still be good learning experience if you've never done anything like it.

Edited by DekuTree64

Share this post


Link to post
Share on other sites

Would using an existing third party editor like Tiled be an option?  If your actual end goal is to create your game, then I don't see why not.  If your end goal is the editor itself, then probably not.

Share this post


Link to post
Share on other sites

My tip is:

 

Bodge any old thing together for now that allows you to make levels for your game. Or even use something prewritten like Mappy. Hell, you can do tile based level editors in Excel with CSV output for all it matters.

 

If, in six months, you are still working on the same game, start to think about making a better level editor.

 

I've "wasted" so much of my life making complicated editors for games that I then lost interest in.

 

If you do decide to write an editor, the tip above about Undo/Redo is a very good one. If you don't plan Undo/Redo from the very beginning, it is almost impossible to go back and implement it later on.

This is actually good advice as a generalization, I still fall into this trap myself all the time despite the fact I should know better. Sometimes its actually more efficient to make maps and stuff for your game with something completely stupid like a text editor. Why? Because the alternative takes -much- longer. Investing in a big 3d editing suite makes a lot more sense when you have 50 people working with you on a game for two or three years than it does for a school project.

Share this post


Link to post
Share on other sites

I'm going to echo Aardvajk, just whipping out a simple 2d tile based editor isn't that hard and a good exercise.  It won't be fully featured, but that's probably okay.  And the nice part is that you can keep building on it if you keep making 2d tile based games.  

 

Trying to build the editor into the game can also be a valid tactic.  If your game code already has access to a good gui, it can happen pretty smoothly.  And if it doesn't, well it gives you an excuse to build ui that might come in handy for the game as well.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!