Hi there, I am trying to make a map system for my 2D pixel-art metroidvania in Godot 4.2.1 where the player reveals the map as they go. I haven't done this before and the way I plan on doing it will create thousands of variables, depending on how many areas the game ends up having. One map will have 220 variables each.
All these variables will need to be saved and loaded later so the game can remember how each map has been revealed.
I've made a grid of 220 squares that will cover each map. If the player's icon on the map touches a square, the square checks which map this is, then removes itself and states something like:
map01_sqaure01_revealed = true
So I'm basically making a variable for each individual square on each individual map. It will end up being one gigantic list of variables to be stored and loaded later.
Is this the dumbest way one can go about doing it? I feel like there has to a much better way with dictionaries or arrays or some other way where you can still have the game remember when the player loads their game. I almost never use arrays and dictionaries, and not sure how that would make a difference.
I wonder if somebody can help. I'm not sure if writing down 10000 variables is agood idea, especially since it feels like there must be a better way and also not sure if adding this amount of global variables will have an effect on the game's overall performance.