Hi
I am a new unity user, i completed several tutorials and decided to head into making my first game.
I’m trying to keep it as a simple first project where you’d manage a shop and expand gradually.
However here is something i’m not sure i’m doing correctly;
The player will be able to upgrade the shop as time goes on. He doesn’t get to choose where the upgrade goes, it is pre-determined. He can upgrade the rooms of his shop in any order he wishes.
Now the question is, what is the proper way to do it?
I’m thinking of making a different grid for each room, and several different tilemaps in each grid that represents the room’s upgrade.
Each tilemap in each grid would start disabled except the “level 1” tilemaps, then when the player upgrades a room, the “level 1” tilemap is disabled and the “level 2” tilemap is put in it’s place.
I made a small representation in this picture
There is the starting house with the player in it, and the upper level tilemap next to it (they would normally be layered on top of the previous tilemap but disabled).
I haven’t found any answer to this question yet. Is this the right way to do it? Or should i programmatically set the tiles?
Thanks in advance.
I’m not sure what the best way of doing it is, but you can consider creating individual scenes for every room. Then when the player unlocks a new room, you “additively load” in the scene. This is a technique that you can also use to create randomly generated dungeons, that use pre-made “rooms” similar to what you want to do.
SceneManager.LoadScene("YourScene", LoadSceneMode.Additive)
Take a look at this video to get an idea of this
I looked into your suggestion. Using several scenes might not work considering i’m using a top down view and i would like to keep every room loaded at all times, just replace them for their bigger version once when they get upgraded.
Your idea could work though, i simply do not know if it is more efficient than disabling a tileset and enabling another on top of it.
I do procedural generation for my tilemaps, but design-wise what you have proposed sounds like it would be easier for the situation you’re describing. If you decide to make the houses more dynamic, like different rooms that are optionally added, the programmatic approach might become better. A minor modification: unless these room upgrades happen over the course of minutes or are especially large, I’d create a prefab for the different houses and instantiate instead of leaving them disabled, and destroy the old house.
Thanks alot for the feedback!
I won’t make the house too dynamic for my first project, so i might stick to what you said.
Just one thing, i could make a prefab of each possible house and switch them out however the player will be able to decorate the house and put down furniture, so i need to keep those. I think switching the specific tileset would leave the furniture untouched.
All in all i got a good idea of what to do now, so that helps!
Btw if you want to know the buz-word for what I suggested, it’s called “Random Generation”. Where the world is created from pre-made assets. Then there is procedural generation, which is on some level the same thing, but at a much more granular level (I.E. minecraft, terraria, etc…)
I think what you’ll find as you learn as that there are a hundred ways to do the exact same thing. Finding the “best” way can be challenging, because it can be dependent on your situation. In the end, if the game does what the user expects, it doesn’t matter how poorly it was coded 
I think you’ll find what you like as you go. Particularly by realizing how terrible you made something previously, tearing it out and re-doing it. It’s exactly how a painter paints a picture! They paint over what they’ve done a hundred times before calling it good enough