How many types?!

Blitz3D Forums/Blitz3D Programming/How many types?!

Yes, it would be good to "compact" the data as much as possible (i.e. storing bits instead of integers, if you can, etc). You can use bitwise operators like Shl, Shr, And, Or, etc to help with this.

This may help:
Byte = 1
Short = 2
Int = 4
Float = 4
String = var
Type = size of contents + ? overhead
Bank = size of bank + ? overhead

Also, Luke has a good idea about only necessarily needing one Type of the same terrain. Instead of having one Type containing coords AND terrain data, you could have two separate types. One with coords (though I'm not sure why you would use Types here), and another set with terrain data. That way you wouldn't have to duplicate the terrain data at all (especially for all that water).

What would probably make more sense than using types is something like this:

Dim Map%(2355,1200)

and then in each array cell you could store a Type reference:

Map(0,0) = Water.Terrain
etc

...though it would still require about 11 MB just for the array, which may be a lot, depending. But the good part about that is that if you might only need 100 terrain types instead of 2.8 million.

(Note that there are more ways to optimize, but I'm just trying to offer clues as to what direction you MAY wish to go.)