Remapping Grid¶
Preserving Data After Changing TileCount¶
During development, you may encounter situations where your grid is already populated, but you realize that the current TileCount
is either too small or too large. In such cases, if you change variables like TileCount
or GridSize
, the grid will lose all previously stored data. However, you can avoid this issue by using the Remap
function.
Steps¶
-
In this example, I have a 50x50 grid with tiles already populated.
-
If I modify the
TileCount
inBP_GridManager
, all the tiles will be removed. -
No need to worry! Just click the Remap Tiles button. Be sure NOT to press the Create Grid button, as this will replace the existing data with new data.
-
This will map your previous data into your new grid!
You can do the same for GridSize
as well.
Caveats¶
While this method works well initially, repeatedly using it on the same original data will eventually lead to data loss.
Remapping Deleted Types¶
If a deleted type exists in your level, remapping is helpful to reset any tiles that were using the deleted type to Default. This ensures that there are no referencing issues in the future.