Hello!. I would like to know what I would have to learn or know how to do in order to make a level editor. For Example, I would like to make a level editor that would let me load tiles from say .png image on my computer that say I have made in Photoshop or gimp. I have a pretty good understanding of c++ and I am planning on learning SDL so I could start on my game. Any links to tutorials would be helpful.
How Do I Make a Level Editor
Members - Reputation: 441
Members - Reputation: 139
Posted 10 March 2013 - 12:07 PM
A level editor is just a program that creates files. How it does this is totally up to you. You pick what data is necessary to save from the map (images to load, positions of objects, etc.). You either have your level editor save this as plain text, or you save it as binary (raw bytes).
Your game will have a function for loading the map from a file. How this function works will depend completely on how you wrote your save function (since it's effectively reversing it).
If you're asking how to create the GUI for the level editor, then it depends. You can use SDL, SFML, Allegro, or any other graphics library if you're up for creating a bunch of form elements (picture boxes, menus, textboxes, etc.) I think SDL has some 3rd party add-ons that help with that, not 100% on that though, haven't used it in a while. Last I knew, SDL was capable of loading PNG's through SDL_image. (windows binaries should be pre-built with it, in linux I assume it would have it as long as it compiled succesfully and found an appropriate version of libpng).
Another option would be to use something like FLTK (pronounced full-tick). This is a library for creating GUI's and would probably make creating your level editor a lot quicker.
As for tutorials...googling SDL tutorials dropped these as the first two links:
Members - Reputation: 386
Posted 10 March 2013 - 08:35 PM
It is always nice to find some reference on already built level editors.
I wrote my own level editor when I was starting game programming.
Because I always forgot some feature and I learned something new, I ended up reengineering the editor several times.
That was good to my learning, but if I had looked at something like Tiled before, maybe I would have learned some stuff faster.
Edited by kuramayoko10, 10 March 2013 - 08:35 PM.