Or, you could just put spaces between your tile ids in the map file, and parse all the spaces out so all you’re left with is integers, which can have a much wider range in terms of the number of ids. Is there some reason why you can’t do that?
That would work better than my current system haha. I chose to keep no spaces for reasons such as resource consistency, but I can see how this could create larger files in some cases. Good idea!
Why go with base 10 integers? Hexadecimal numbers will give you a wider id range with less characters needed if you’re worried about size when using text formats.
I decided to cap at ‘0000’ instead of hex conversions for a few reasons:
- Even if you texture sheet is 32x32, the number of possible textures is 1024. In order to reach the limits, you’d have to have a 100x100 texture sheet which is not very practical in the 2D design world.
- File size will remain consistent. You won’t have to worry about your file workspace increasing after you save.
- It encourages smaller texture sheets (my own personal preference)
Yeah, I guess that would be silly to have such a large file…
But I managed to add it in! Now I can easily create map files, thanks to you!
Keep up the AMAZINGLY awesome work.
-wes
Doppler, I am noticing some bugginess with the saving. I am getting extra 0’s sometimes. It keeps happening, and I don’t know why. I am pretty sure it could have something to do with your 4-digit system (not sure how though :P).
For example, one line will have 135 digits total. 135/4 is not a whole number, thus making this system break!
Wierdly enough, however, the Editor seems to open the file again without flaw.
Here is the pastebin.
I hope I am not making a ridiculous mistake!
-wes