Proper Way to Modify Maps

Lets say I have a farm with a few buildings on a single map. The goal is to allow the player to upgrade this farm.  When the farm is upgraded, new buildings, characters, decorations, etc will appear. Initially I was just going to build several versions of the same map, one for each upgrade. The upgrades aren't necessarily sequential though, so the possible building combinations just scaled out of control really fast. I'd also like to avoid having many, mostly redundant maps with a few minor differences between them. 


 My question is, what is the correct way to tackle this problem? I have seen posts about dynamically swapping tiles. I don't know if there are any caveats with this method though. Are there any issues with scaling? I can see there being a difference between swapping in a building vs revealing a hole in a wall or showing a treasure chest.


Any help is appreciated!
A good idea is to do a transfer to a different, Updated farm nap. 
If I make a different version of the map for each upgrade I'd end up with quite a few versions of the same map with a different configurations of buildings. I imagine this would become unwieldy very quickly.


Hopefully there are other solutions. 
Scripts 
Scripts 

Neeva is right! But the specific script you'd need would be something like THIS plugin and the other plugins in this series!
Wow. Um thanks. Happy I helped  😀
Neeva is right! But the specific script you'd need would be something like THIS plugin and the other plugins in this series!



Thank you for your answers, both of you!


I'm not sure this what I need even though it's very cool. I may not be explaining it well.


I have a normal sized outdoor map, we can call it a farm. At certain points in the game the player will be able to "order" construction of new buildings such as a barn or stables etc. These buildings will have predefined locations on the map where they will appear. The problem I have is the sequence of these buildings isn't linear. The player can order any building they want provided they have the money for it.

So what I'd need is the ability to place an entire building on the map in a script. I have seen multiple threads regarding adding and removing tiles but nothing about changing collections of tiles. I'm not sure if it exists but being able to import chunks of a map into another would work as well. That way I could have a starting map with no buildings  finished map with all the buildings. That way I could just "cut and paste" sections for the finished map over the starting map dynamically.


my question is whether that is possible or if there are any considerations I should be aware of be of, such as a huge performance hit etc.


Thanks again!
That's why I mentioned "the other plugins in the series" because there are many! The one you probably most want is THIS one since it lets you add and subtract templates from maps so you could add a barn or take away a barn or add a different barn. Try the demo that is provided and you'll see that it is used to change carpets and wall paper of a small house but the same could be done with barns and farming stuff on a larger scale!
That's why I mentioned "the other plugins in the series" because there are many! The one you probably most want is THIS one since it lets you add and subtract templates from maps so you could add a barn or take away a barn or add a different barn. Try the demo that is provided and you'll see that it is used to change carpets and wall paper of a small house but the same could be done with barns and farming stuff on a larger scale!



Thanks so much, I'll look into this!

Original thread: https://forums.rpgmakerweb.com/threads/proper-way-to-modify-maps.59648/