I'm just a beginner game developer and working on my own first project (beyond copying other games for learning skills).
Because I really like sandbox games (like Minecraft, Rimworld, Terraria etc..), I am trying to make a 2D grid-based sandbox game.
For now I am building a plan for my game's base architecture, and I'm having an issue managing world data (for more specifically, handling Block/Tile Data).
In a sandbox game, you can easily place or remove some blocks (or tiles) as you like. So you need to store it in some kind of storage and sort it so that you can access these blocks easily.
So I thought I should make an Array that holds pointers to Tile Class instances, and the index in the array corresponds to the grid's index. I started writing code based on this idea.
But here is the problem: since not every tile's size is 1x1, some may take 2x3 blocks. If i just put this object's pointer in the array, there are 6 identical pointers stored in single array.
I think that may not the best way to handle tile data.
I thought there might be some way to handle tile data better than to just put a pointer in array.
So how should my game handle multi-grid-cell sized block (or tile) data?