• How to make a map maker with Pygame/Python?
    9 replies, posted
I'm trying to begin working on another game but I want to be able to make maps and such for it. My previous games were all just randomly generated things and I have no clue how to go about creating a map making tool. I've tried Googling it and I got some source code for some map makers some people made for their games but they are all written in Python 2 and I'm using Python 3. I tried converting it over with the 2to3 script but it didn't work. If anyone has done something like this and wouldn't mind giving me a hand I would appreciate it.
You should really build a level editor around your game. That way you can take your existing game systems and build around them to allow for editing, then come up with a file format to store / load these maps. The only difficult thing about a level editor is the map format, and maybe a little bit of UI design if you aren't too familiar with that.
Yeah, you should spend a fair bit of time thinking up (or researching) a format to store your maps in a way that's not bloated, but not too restrictive. Most of the work is right there. Creating the tool for actually editing it shouldn't be so difficult if you made the format in a sensible manner.
But you shouldn't really care about optimizing the file format at the beginning. It can get quickly a headache and is not worth it.
If you make the format too redundant that it makes the filesize large, it's not good. If you try to compress the map format down too far you won't be able to add new features on to it later. You have to find a happy medium between the two, where it's expandable but not wasting valuable space on long identifiers or tying identifiers to too many things.
I really just don't know how to do something like this, like I can't think of what needs to be done to create a map maker for a 2d platformer game in my head. I know what I need to do to make the platforming part fine, just not the maps. I assume it would need to involve a grid (which I have barely touched)?
I tried this. It's fucking hard. Good luck.
I think I've got a decent method in mind for it. There are only a few things I need to work out now.
It seems you're asking about the logic behind building a map maker for a game? Simplest map editor, notepad. Well when you make a game you store your map data in a file (or files) and your game reads it when it loads the map. You basically do the same thing with a map editor but instead you also write data to that map file. The main difference being that your map editor won't have the logic behind any entities. AI won't move, physics blocks won't have applied physics etc. etc. (in a nutshell)
[QUOTE=lazypenguin;31074701]It seems you're asking about the logic behind building a map maker for a game? Simplest map editor, notepad. Well when you make a game you store your map data in a file (or files) and your game reads it when it loads the map. You basically do the same thing with a map editor but instead you also write data to that map file. The main difference being that your map editor won't have the logic behind any entities. AI won't move, physics blocks won't have applied physics etc. etc. (in a nutshell)[/QUOTE] Ya I've got it all figured out now. I'm in the process of writing it.
Sorry, you need to Log In to post a reply to this thread.