Storing tile info

BlitzMax Forums/BlitzMax Beginners Area/Storing tile info

Hi.

I am trying to make a tile based platform game. I made the tiles in a strip and loaded them with LoadAnimImage and the read a text file which stores the level data as:
000000
000000
000000
111111
222222
222222


sort of thing. What would be a better way of doing it which is still quick? Like it is now i can't tell whether the tile is passable or not.

Any suggestions?

Matt

That'd be the way I'D do it. The text file is for the map or level you're displaying? Then looks like you have the bases covered.

perhaps making two (or more) arrays.. on to hold the image pointer in an x,y format, and one to hold info on collision at the same x,y coord..?!?
something like;
image_to_draw = MAP_ARRAY(x,y)  ; returns image number
collision     = COL_ARRAY(x,y)  ; returns 1 if collidable, 0 if passable

store and load everything in a normal textfile..
perhaps the first two numbers to redim the array size, then you can loop through the map and collision (++ if other) to set stuff up..

.. that's how I would do it anyways... but it's only 1 way of doing it..

That's the way it was done in the alien breen remake, there were several layers including a collision layer.
Each layer was simply an array that stored the required values.

I've just suggested to somebody else they use map_array(x,y,1) with the third dimension walkable/non-walkable.
Is this a good way of doing it?

I oculd try both ideas, is there any difference in size or speed betwee having maybe 3 arrays holding data or having one array array holding the data like TonyG suggested?

I'd like to know this as well as I'm surprised people here use different arrays.
I would also extend the third dimension to hold data such as
which tile to display when destroyed, terrain cost to traverse N/S/E/W, cover, concealment, noise etc etc.
Not sure of the benefit putting this stuff in a type/list now.

Wow! I would have never thought of holding those sorts of things about tiles. Its amazing how interactive you could get a tile based game to be!

I use a 2D array of types. My type holds all sorts of things, terrain cost, population, food, you name it.