How many types?!

Blitz3D Forums/Blitz3D Programming/How many types?!

Whoa that's a lot of memory you are using there, is there any way you can buffer the data? e.g. I would suggest some method of area subdivision to lessen the load.

XXX
XOX
XXX

O is the current "cell" which is the size of the viewable area of the map, and you only keep in memory the surrounding 8 "cell", so if from my little ascii map the player moves north to stand on the top center tile then as he walks onto it you load the row above and discard the bottom row (below the O on the map)

I realise loading while playing slows the game down but if you have such a massive level then I don't think you have much choice.

Alternatively don't use types, if you know the data structure then what I suggest you do is you precompile your map data into a form of byte code and then compress it using some form of table compression, this is a technically more advanced solution but its the same way compilers compress their symbol tables, the idea is that many places on the map are going to be pretty much the same and so you replace said type with a single int that represents the type to fetch from a lookup table.

Hope these ideas are useful

- Luke

PS if I am wrong anybody please let me know...