I’ve already spoken with @keely about this, but I have some additional thoughts I will share here…
I want to share a concept of storing data that applies to all tiles in the game, and storing data that applies for the specific tile in the cell, in case it gives you any additional ideas.
I will use my game, Super Mario Bros. Crossover, as an example. Let’s say you are placing an item block on a tile map. An item block can contain 14 different items. If you had no way to store data on the tile map, you’d have to create 14 different tiles. But Bricks can also contain the same items, so again, you’d have to create 14 versions of the brick tile without being able to store data. If you are storing data on the map, this would take up 14 bits, and you’d only need one tile each for brick and item block.
However, this data is specific to the brick/item block tile. The game may have another kind of data, as mine does. In SMBC, different tiles appear or disappear depending on what difficulty you are playing on and what character you are playing as. So we would also need to be able to set flags on the cells that say whether or not this tile should appear on easy mode or hard mode, etc. These flags need to apply to all tiles.
So using these examples, I think you would at the very least want two ints to store data. One could be used for storing global data for all tiles (i.e. hiding a tile on hard mode), and the other would would be used for storing data specific to the current tile (i.e. the item an item block contains). You could even call them globalFlags and instanceFlags, but you probably shouldn’t because I don’t know if everyone would use them that way.
Anyway, this is how I would use the data for this game, but I could see myself using the same setup for other games. With one 64-bit int, I could still do it this way by reserving the first 32 bits for instanceFlags and the last 32 bits for globalFlags. It really doesn’t matter how the bits are split up. I’d recommend an absolute minimum of 64 bits, but I think 128 bits would be better and should be enough for most people.
Maybe someone else will come up with a reason for needing more data than just flags, but I haven’t thought of one yet.