I’m building an open world game in UE 5.5.
My intention was to create the outer world as a large open world (World Partition level) and then have separate levels (Level Instance) for the outer shell of buildings and a separate level for the inner decorated buildings with all its assets and lighting.
I setup a system where you can click the door or a house in the open world to transition from the outer world to the interior house level (using the “Open Level” node) which works fine.
The issue is that I want the NPC who has the plan “go to the kitchen” to be able to follow you through the door to the level even if you’ve gone into the interior first. I’ve got as far as the NPC figuring out it wants to go to the kitchen and to get there needs to use the exterior door.
However, if the player goes though first it calls the “Open Level” blueprint node which instantly unloads the main open world meaning the NPC if he’s behind you can’t follow you through because he’s unloaded. I found the “Load Level Instance” node which loads the level over the top of the open world but I’m not sure whether this is best practice and if it messes with World Partition doing its thing?
I like the design choice of having separate levels for interiors but need to find a solution to allow the NPC AI to keep following through the door if that’s its plan. I was exploring the idea of keeping the open world level open for 30~ seconds to allow the NPC to follow me through the door but cant find a good way to do this with world partitions. (Only care about NPCs fairly close by with the plan)
Am I forced to do some hacky estimation to determine the NPCs proximity to the door? E.g., if the NPCs plan is use the door and is within some distance, just spawn them after distance / time period to give the illusion?
How should I structure my levels to allow NPCs to follow through level loading and generally manage this sort of persistence?