Jump to content

  • Log In with Google      Sign In   
  • Create Account

How Do I Make a Level Editor


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 AimKing98   Members   -  Reputation: 123

Like
0Likes
Like

Posted 10 March 2013 - 10:20 AM

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.cool.png



Sponsor:

#2 proanim   Members   -  Reputation: 446

Like
0Likes
Like

Posted 10 March 2013 - 12:04 PM

See here

 

http://www.lazyfoo.net/SDL_tutorials/

 

search entire web site it has everything that you need to know about SDL. There is also an article on how to make level editor.


Edited by proanim, 10 March 2013 - 12:04 PM.


#3 TimA   Members   -  Reputation: 139

Like
1Likes
Like

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.

http://www.fltk.org/shots.php

 

As for tutorials...googling SDL tutorials dropped these as the first two links:

 

www.sdltutorials.com/
lazyfoo.net/SDL_tutorials/index.php
 
 
but it's always good to read the API:
 
So in short, what you want to learn:
SDL, SFML, Allegro (your game, maybe your level editor, research these libraries, pick the best one for what you're making)
C++ filestreams (loading and saving files)
GUI-creation (graphic user interface for your level editor)
How to use libraries (SDL is a library, FLTK is a library...libraries are your friend, learn to use them)
How to read and understand API manuals (A library could be the most amazing thing on earth, if it doesnt have good documentation its useless)
 
Or you could just use someone elses level editor and just have a function in your game that knows how to read their map files.
 

 



#4 kuramayoko10   Members   -  Reputation: 386

Like
0Likes
Like

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.

Programming is an art. Game programming is a masterpiece!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS