Download

What is the best way to implement a level that has multiple ingame phases/stages

Hi. I’m developing a game where the player has a hub location (a town with multiple buildings, NPCs etc). You can walk, talk to the NPCs of this hub in-between story missions. This hub location is a separate level, the story missions are on different levels that load when the missions start. I want to add some life to the hub, change it depending of what missions the player has completed. Such as: buildings materials or static meshes change (the buildings get repaired), some static meshes (dirt) disappear, NPCs spawn at different places and say different phrases.

I can do it, but I’m just curious what would be the best way. I thought about multiple ways:

  1. Place all actors to the level manually, make a new BP (or do it in level blueprint, idk) with int variable of hub phase. Add tags to actors like Phase1,2,3 etc. Change phase variable when you complete missions. On Begin Play of hub level -> destroy all actors with tag not equal to hub phase. Add different behaviors in NPCs BP (if phase 1 do A, if phase 2 do B). Then I can just save the hub phase value and the world will be loaded properly.

  2. Make a new BP (or do it in level blueprint, idk) with int variable of hub phase. Create spawners blueprints for each npc or object, add different behaviors based on hub phase value. This seems more complicated.

  3. Create the hub on one level, then use it as persistent level for phases levels. For example Level_Hub_Persistent, Level_Hub1, Level_Hub2 etc. Load different hub phase level depending on what quests the player has completed. Add different behaviors in NPCs BP (if Level_Hub1 is loaded do A, if Level_Hub2 is loaded do B)

How would you do it? Maybe there are better ways?

I’d probably go with separate hubs dedicated to phase level. But it all depends on the size of the hub level, amount of change per phase, and the number of phases.

in other words. If the hub level is already 6GB duplicating it to have10 of them each with a different buildings is insane and would mean having 60GB of wasted material.
Replacing a building based on script rules would keep closer to the 6GB.
Obviously the weight changes when you build. Mine is just a nominal example. (World comp 120GB level folder bakes down to 15gb total on average - for me).

Your 3rd option may be the most ideal one.
you can use manual streaming to determine what needs to be loaded and replace buildings and interiors by isolating each as its own level.
that way the cost is whatever it has to be in terms of everything and each building is completely isolated allowing for more flexibility when swapping out.
so long as you don’t include a landscape within the building.