Suppose in a game in a scene there are many Terrain objects with Buildings, how can we make sure that less memory is used, like should we create scene files per terrain object with building and compile it seperately and when the player is in one terrain object , then that tearrain object and close by tearrin scenes are only loaded, others unloaded. How do we implement it in source code.
I dont know how to do it but most games does it that way, the best way I have seen this implemented is in Metroid prime, in Metroid prime a room its only loaded when the player tries to open the door and the door only opens when the room is finish loading, that way the game world looks seamless with minimun impact on performance, I guess you could use gates or doors in certain parts of the game.
Like for example if there is a city or a town in the game only the external walls are loaded, you open the door and enter the city, the door closes behind you and the terrain you left behind is destroyed. And viceversa when you exit the city the door closes and the city map is destroyed. No loading times are needed because loading takes places in the time it takes the door to open.