Multiple, concurrent UWorlds

Hi,

I would like to have multiple, concurrent UWorlds for a singleplayer game. Has somebody here experience with this? Or can somebody estimate how hard it would be to get that feature working?

Thanks!

While you can create multiple worlds easily enough, being able to swap between them is not a ‘built-in’ feature.
I looked into this a while ago for our ready room feature.
Though I made progress, I did not have the time to experiment and flesh it out, so stopped work on it and moved on.
May get back to it at some point.

From memory, swapping the rendering between the worlds was easy enough.
Swapping controls, not so much.
I believe that is where I left things - figuring out how to get the player controller, local player etc to work across multiple worlds.

There is probably a much simpler way to go about it, but at the time, I couldn’t see it.
Perhaps someone from Epic has some ideas.

You can search for post by he was working on UWorld UMG Widget, he had to scratch that. It was partially working but engine is not ready for multiple worlds and so you can not package game.

Thanks Kris and nonder! I’ll have to learn more about this… but if Nick Darnell as an Epic employee had problems to get it working it’s probably a bit too advanced for me.

Kris, if you ever find the time to make progress on this, please let me know!

Just for my own education, what would be an example use case for multiple UWorlds? I’m having trouble visualizing what that would be.

Imagine wanting to show a viewport in the UI where there’s maybe a character, spinning on the pedestal for your inventory screen. Normally you’d need to place that character somewhere off in the world where nobody could see it in a box you could never get to, and render from that location. Having a pocket universe avoids all the complexity of worrying about those two universes ever overlapping. At the same time, it adds a whole host of new problems :slight_smile:

Wouldn’t it be easier to just implement it for rendering purposes, then? That has a much more common use-case (rendering 3D elements into UI) than fully-featured (featuring playerController and everything) concurrent worlds. Isn’t that how the editor implements the many different viewports (persona, blueprint editor viewport, mesh preview, etc)?

No, the editor uses completely separate scenes and UWorlds for all those viewports. The classic forward solution of “MyMesh->SetTransform(); MyMesh->Draw()” is not a viable option in Unreal. Because UE4 uses a fully deferred renderer, it’s not currently possible to just draw a complex mesh directly to the backbuffer on top of the UI using a forward rendering method at will.

I want to work on a space game in which I would like to simulate an economy with agents. X3 Terran Conflict did this with a larger scope. I would like to work on a small version of this.

The games universe would consist of separate sectors that are connected by jumpgates. There would be two separate game updates: one in the sector where the player currently moves around in his ship and a second simplified simulation that updates concurrently several hundred trade ships once or twice per second without collision or physics in the rest of the games universe. Just an update of the ships location and from time to time some processing to find a new deal for a trade.

Since the games universe consists of separated ‘sectors’ I think the best way to do this in UE4 would be to have multiple worlds, basically one world with its own scene manager for each sector. With level streaming all entities end up in the same scene and I think that won’t work out.

That’s why I want this.

Another usecase would be a variation of what Nick already mentioned: a planetary 3D map like Elite Dangerous (looks like this). I would like to switch between the space scene in the ship to such a 3D map. From what I have found so far in the documentation I currently would have to load another level and hide the planetary map somewhere in my scene. I think it would make much more sense to simply have a different scene (=world) and then switch between space scene and map scene.

Thanks for the info, everyone. I see I still have a ways to go with this engine. :slight_smile:

@Nick,

Have you been able to move forward on the UMG Viewport widget that is in experimental ? I know that the purpose of this, but there was some work to do on the engine to properly use the correct World ^^

Haven’t revisited it in awhile. I think there’s been some improvements, but I think there’s a few things outstanding. I know a PR came in about fixing a few of them recently.

Does this mean that even the asset viewers in the Content Browser have their own worlds? Like the static mesh editor and material viewports etc? If so wow… crazy stuff.

I was wondering, couldn’t you take the simpler approach:

  • Each object has a InstanceId (default being 0)
  • Only render objects which are in the same InstanceId as the playercontroller

Wouldn’t that achieve what you’re looking for in a simpler fashion? You could manipulate it to whatever you wanted based on the InstanceID, whether its rendering, gameplay,etc.

Good to know that you are moving a bit forward on this.
Just in case, you can say send a feedback that there is some community interest on this.

thanks,

Hey Nick,

Any updates on the viability of this option?