So I’m looking at implementing a system of saving/loading my 2D platformer’s levels using simple image files to store the tile data etc. since it seems a quick and practical way of doing so, and for something like Ludum Dare it seems popular.
I myself have made a somewhat proper level editor before for a top-down shooter in C++, but that was a lot of hassle at times and it would be nice to get something quite functional up and running before committing to spending time on something like that rather than the actual game if at all possible.
While an image file works fine for a 2D tile array, I’m wondering about how you might go about doing slightly more complicated things like placing enemies?
An enemy or any entity could be a coloured pixel in an image, but then what about the underlying tile? You’d have to either decide the underlying tile will always be empty, some specific tile, or perhaps the same as the tile to the left of it etc. Granted, for a platformer this doesn’t matter as much since most of the time anything behind an enemy will simply be a blank space but for a better looking map you might want to put non-collidable background tiles, perhaps if you were in a cave or something, and then we’d run into problems.
How might you go about something like that then? Allowing a simple image to place map tiles and enemies but not have the enemies prevent you from deciding on the underlying tile? Does anyone ever tend to bother, preferring to just make a proper level editing program when a game requires that ability?
One idea I just had would be a separate image with the same map tile image on it, but with enemy positions overlaid and when the game was loading the map it could simply ignore the map tiles and place the enemies in the right positions while still allowing a human to easily place objects with a feel for where they are in the map. Might be slightly messy though, but I guess it would work.
Any better ideas for quick and easy level editing without resorting to a full editor?
I also do know about Tiled which seems quite popular, but I haven’t tried to learn how to use that just yet.