How to make a simple Map Editor

For discussions about game development that does not fit in any of the other topics.
Post Reply
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

How to make a simple Map Editor

Post 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?
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
UnknownUser
Posts: 51
Joined: Tue Sep 08, 2009 2:54 pm

Re: How to make a simple Map Editor

Post 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..
When a programming language is created that allows programmers to program in simple English, it will be discovered that programmers cannot speak English. ~Author Unknown
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: How to make a simple Map Editor

Post 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++
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: How to make a simple Map Editor

Post 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.
The indelible lord of tl;dr
User avatar
Chris
Posts: 1581
Joined: Wed Sep 30, 2009 7:22 pm

Re: How to make a simple Map Editor

Post 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.
Fighting for peace is declaring war on war. If you want peace be peaceful.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: How to make a simple Map Editor

Post by Jackolantern »

Very true. JSON > XML any day in my book.
The indelible lord of tl;dr
Post Reply

Return to “General Development”