Map Editor/Tookit
#1 Members - Reputation: 168
Posted 06 June 2012 - 07:43 AM
I now want to improve the complexity of my games, and hopefully create a good, unique 2D game. I have been reading about game physics and am trying to create an engine with basic physics. I intend to have complex game objects, as well.
Now, to I want to make a utility or a map editor to help me design levels which my game can use. Something in which I can place objects arbitrarily, and define their properties.
I have been searching, but I haven't been able to find any tutorials/articles for this particular topic. I'll really appreciate if you can tell me how I should approach this. And what should I use to do it. Is SDL sufficient, or do I need something else?
#3 Moderator* - Reputation: 5411
Posted 06 June 2012 - 09:26 AM
If you really want to make your own... well that's a decent undertaking. I'd recommend using Qt for your GUI, and to start by figuring out how to create simple Qt applications, building up to your map editor. Or you could just modify Tiled as necessary, but that's still a fair amount of work to figure it all out.
Edited by Cornstalks, 06 June 2012 - 09:27 AM.
#4 Members - Reputation: 3285
Posted 06 June 2012 - 11:33 AM
You can use Tiled to create maps. It allows for custom properties to be added to tiles, layers, and objects.
If you really want to make your own... well that's a decent undertaking. I'd recommend using Qt for your GUI, and to start by figuring out how to create simple Qt applications, building up to your map editor. Or you could just modify Tiled as necessary, but that's still a fair amount of work to figure it all out.
For a level editor, I would stay the hell away from C++. Even with Qt.
The end result of a level editor is generally a data file. It doesn't need to be fast, nor in the same language as your game, so there is little to no reason to pay "the C++ tax". This is one of the reasons why C# is so popular among tools programmers. Unlike in C++, making GUI apps doesn't involve the same amount of fun as a root canal.
That said, if you do go ahead with C++, use Qt!
#5 Members - Reputation: 168
Posted 06 June 2012 - 02:21 PM
It looks quite suitable for what I have in mind. Something like this will also allow me to place objects arbitrarily, and define behavior.
What I have in mind is a top-down action/puzzle game in which you have to lure your enemies into traps. In my map editor I would like to place these traps, mark their bounding polygon, along with their position, orientation and scaling. You can have different types of traps. One is your run-of-the mill snap-trap, which ensnares when you step on it. The other is triggered by a button somewhere on the map, which swings a hammer about a certain point, smacking any enemy unlucky to be there. So say I load the snap-trap object, I can mark it's behavior as self-triggered and effect as ensnaring. Then I load the hammer-trap, which is triggered by the button object, and adds another collidable entity into the world, which swings in a certain area, having certain acceleration, mass, etc. This trap will have a new game object to add when it is triggered.
I think an xml format map is suitable for it, I can separate surfaces from objects. I can add or neglect properties for the <object> tag, ensuring that I can define different types of behavior.
Is this approach towards levels too naive/improper? I really have no idea. And can something like this be implemented using Qt? Qt seems like the tool to add more utility, rather than using keys to select layers or mouse wheel to pick assets.






