Page 1 of 1

How to make a simple Map Editor

Posted: Sat Mar 03, 2012 9:28 pm
by vitinho444
Hey indies!

Im currently using allegro to release the #5 of the "sequel" of my game: Shoot2Survive.

Im using a map system based on a file that has a sequence of numbers, like 1, 2 ,3, 4 and that.
So per example:

Code: Select all

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
This is a basic map builded only with a tile.

So, what i want to make so i can make bigger maps is a simple map editor, that can edit a file and place the 1 and 2 and 3 as i say...

Do you guys have something in mind to help me?

Re: How to make a simple Map Editor

Posted: Sun Mar 04, 2012 6:31 pm
by UnknownUser
the simplest way would be making the map editor open up the map file reading in it's content and then, translate the numeric to pics so you can
see what you will edit and then when you add or delete stuff the program will make a change to that map file thats what i would do it's very simple
but works..

you have to make your map in to xml based formats and then make it support orhogonal and isometric maps
then add in undo/redo function and copy/paste, and have a function that you can turn in to a custom
spott for anything, tiles, layers, objects etc.

there is a lot of openSource stuff you can check out..

Re: How to make a simple Map Editor

Posted: Sun Mar 04, 2012 9:55 pm
by vitinho444
thanks for the reply, i would like to keep this simple like it is, not using xml because i dont know how to implement into C++

Re: How to make a simple Map Editor

Posted: Sun Mar 04, 2012 10:09 pm
by Jackolantern
Just make it text files then. The only real benefit in using XML in this case (since you probably won't be sharing the maps with other people's applications) would be organization of the data. And since the map data is pretty simple, I don't see that it would be worth finding an XML library and learning to use it just for this.

Re: How to make a simple Map Editor

Posted: Mon Mar 05, 2012 12:08 pm
by Chris
I'd consider using JSON before XML, XML in my opinion isn't very well thought out, bloated, and too old school. It's the reason why the logic between HTML and JavaScript takes a while for some people to grasp. You basically want to catagorize everything, then uncatagorize it again to get a result. Programming logic is a very mathmatical means of catagorizing things. Some parts of XML catagoriztazion are in my opinion are done the wrong way round if want to easily get a result programatically.

Re: How to make a simple Map Editor

Posted: Mon Mar 05, 2012 8:11 pm
by Jackolantern
Very true. JSON > XML any day in my book.