Help with tilemap engine?

Started by
13 comments, last by Tantere 16 years, 11 months ago
Now I need to create tilemap engine for my game, tiles are 32*32. I need to create tilemap engine with C++ and SDL. I created simple tilemap engine for one of my SDL games, but the map data was in a .txt file: Like 0, 0, 1, 1, 2, 5, 5, 0, etc. But now I would like to create more advanced tilemap engine, that the maps would be created inside the code and/or with mapeditor. I have no idea where I should start to create the tilemap engine.. Any tips?
Advertisement
Hi Tantere,

What do you mean by more advanced tilemap engine?. What you have there is adequate for what you are doing and is what most people do when they start off i.e. place the tile data into an external text file and load in as necessary. Looks good enough to me.

MAMEman.
What exactly do you mean by "more advanced"? You have to be a bit more specific..
Tilemap engine like in most of the 2D games.

You create map with editor, and save it with the editor for example as test.map. If you open the test.map with text editor, it doesn't show you: 0, 3, 1, etc. I shows you something like "b4IœÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ-?ÿÿÿÿÿÿÿ". Something that you cannot read. You need the game's editor to open it.
Oh, I see. Well, it's mostly done in hex code (and possibly some kind of encryption). If you don't know what hex is you can read some about it here:
http://en.wikipedia.org/wiki/Hexadecimal
Note that you'll also need an hex editor.

However, this is not a recommended way if you still are in the learning stage as it requires that you know a thing or two.
Quote:Original post by HomerSp
Oh, I see. Well, it's mostly done in hex code (and possibly some kind of encryption). If you don't know what hex is you can read some about it here:
http://en.wikipedia.org/wiki/Hexadecimal
Note that you'll also need an hex editor.


Eh?
I mean, maps like in these games, the maps are made with the game's map editor.

Like in these following games...
R: http://crimsonengine.com/R/main.html
Tapan Kaikki: http://www.acid-play.com/download/ultimate-tapan-kaikki/
We Got Explosives 2: http://koti.mbnet.fi/jonneweb/img/pelit/kuvat_/we_got_explosives21.jpg

Try searching from google for more info.
There is nothing advanced about it. All it is doing is storing the map in a binary format which you may be able to 'read' in a hex editor.

Steven Yau
[Blog] [Portfolio]

There are any tutorials of storing data in binary format?
Yes, but you can't just create an map editor without having a map file structure.
And most map files are made in hex, that's why you see those weird characters.
Quote:Original post by HomerSp
Yes, but you can't just create an map editor without having a map file structure.
And most map files are made in hex, that's why you see those weird characters.


I know, but I need help with the tilemap structure.. Like what variables do I need, etc.

This topic is closed to new replies.

Advertisement