How to asynchronously load and transit between 2 levels with 2 different game modes ?

Hi everyone,

I’m starting to dive into the thrilled world of asynchronously things I can do with Unreal… And for a multithreaded engine. I have to admit it’s a whole hell T_T.

I followed the tutorial in https://answers.unrealengine.com/questions/46503/how-to-use-preparemapchangecommitmapchange.html

The problem is when you do that you actually load the actors referenced in World2 inside World1 (and I’m still looking for a use case for this feature having 2 levels working at the same time, maybe for a local multiplayer where each one of the players can switch to the main menu and let the other one play ?)

Because, as an example, in Kingdom Hearts 3, when you’re going from classic gameplay to Cooking Mama sort of mini game. I hope it’s not the same game mode and EVERYTHING is not written inside 1 and only 1 GameMode with a state machine (based on the hypothesis they used this approach of course)

So to summarize all this :

Using PrepareMapChange/CommitMapChange,

How can I go from World1 which has its own GameMode, LevelScript...etc to World2 which has also its own GameMode, LevelScript...etc asynchronously ? With just 1 level active at a time ?

Thanks by advance everyone,

Alexandre

You can load and unload sub-levels just fine. Changing game modes I don’t think will work. Maybe make a generic one that covers both cases?

I guess you could get a pointer to the GameMode, delete it, and spawn a new one (never tried). It would cause some very abrupt changes though.

Seamless travel can change the game mode. It even allows you to override a CopyProperties method so you have a chance to copy data over from the previous game mode. It’s a bit finnicky to get working and I never used it in single player games.

Are you talking about Level Streaming ? Yeah I know :confused: But it’s not what I’m looking for.

Do you know if someone successfully achieve that ? I will make my research.

For now I’m trying to use LoadPackageAsync() and then OpenLevel().

Thanks guys :slight_smile: