Flashpants
Member
Hello all
Our game is based off of a 120x64 grid and we want to hold multiple variables of information for each grid square (what room type it is, what's on it etc). The information in the variables will have to be accessed every few seconds by 50-100 different objects, so needs to be as fast as possible.
Unless I'm missing something (I usually am), it seems like the two best ways this can be achieved is to either have:
1. A DS grid with an array for each grid square that holds the information for that cell. The DS grid layout would mimic the 64x64 world grid. I've heard that using arrays is super fast as they are stored as pointers in memory and get automatically cleaned up (and they can also be saved easily).
2. A DS list that holds all the variables for each square (which will need to include every combination of the grids x and y (so that there is one row for each square)). This instinctively sounds simpler but given that I'll need a square for each unique x and y combination I'll need to have 7680 rows x 10+ bits of information in the list, which will need to be searched through very often. I'm not sure if this would be better or worse than having a DS grid with 7680 squares, with 7680 individual arrays for each one
Any feelings as to which one will be faster/"better"?
As always, any help is much appreciated.
Our game is based off of a 120x64 grid and we want to hold multiple variables of information for each grid square (what room type it is, what's on it etc). The information in the variables will have to be accessed every few seconds by 50-100 different objects, so needs to be as fast as possible.
Unless I'm missing something (I usually am), it seems like the two best ways this can be achieved is to either have:
1. A DS grid with an array for each grid square that holds the information for that cell. The DS grid layout would mimic the 64x64 world grid. I've heard that using arrays is super fast as they are stored as pointers in memory and get automatically cleaned up (and they can also be saved easily).
2. A DS list that holds all the variables for each square (which will need to include every combination of the grids x and y (so that there is one row for each square)). This instinctively sounds simpler but given that I'll need a square for each unique x and y combination I'll need to have 7680 rows x 10+ bits of information in the list, which will need to be searched through very often. I'm not sure if this would be better or worse than having a DS grid with 7680 squares, with 7680 individual arrays for each one
Any feelings as to which one will be faster/"better"?
As always, any help is much appreciated.