Since worlds in the project supposed to be small I can keep them loaded all the session.
Only thing I need - switch player viewport between loaded worlds and seems like replace it with “Dummy” viewport for a world that “on background” in that moment.
Is it possible?
Do network replication works for all the worlds in the UEngine::WorldList?
Maybe there is some examples.
Regards!
why do you even need to create a uworld?
why not sublevels, dynamic streaming levels, datalayers, or levels?
i think you should start by explaining why are you trying to do this.
handling worlds this way is very weird. and very likely you don’t need it. and very likely it won’t replicate.
you don’t need different viewports. you just need to change the camera.
if you want players not to see each other you need to use netrelevancy.
As I understand sublevels and level streams shares single coordinate grid, actors, lights, etc
Perhaps I can simulate separation of maps with spawing first map in [X=0; Y=0], second in [X=10000; Y=0] and so on.
I will read about datalayers to review it’s features.
Maybe I don’t know something important about level streaming, that can help me.
From my perspective now it would be convenient to separate small maps in personal worlds with it’s own light, actors, coordinates and allow users “jump” between them.
Now I’m moving forward with that. I wrote code to:
Save the original UWorld* handle to interract with AGameMode and use RPCs
Implemented NetMulticast function in the AGameMode to create new UWorld for client and server
Implement method in a APlayerController to switch between worlds - change client viewport
If someone need, I can share the code. But since work in progress - it’s ugly:)
you are still not saying what are you trying to do and why.
it’s really hard for me to give you an answer without that.
i’m confident that if you where to explain why are you trying to do what you’re doing i could give you better suggestions.
and i’m quite confident you don’t need to create uworlds.
just in case, dynamic streaming level can be added multiple times to a level and have a unique transform.
the code is a bit irrelevant at this point, because you will only show what you’re doing, and not why. which i think it’s the biggest issue.
i could help you in doing what you are trying to do, but i really think you will benefit from going in a different direction. also it’s irrelevant if it’s ugly.
My idea is to create a simulator for tabletop games (like Dungeon&Dragons) with features:
First player (game master) able to add multiple locations, place actors, travel points, etc
Then other players able to join and explore locations independetly: first player observes first location, second player - on second at the same moment. This locations may have different lightning, sounds, actotrs
Since number of locations not determined I thought it’s better create a UWorld for each on demand.
English is not my native language, sorry for mistakes if any:)
i see, thanks.
nobody speaks a language perfectly, so don’t worry.
i think you’ll be fine with dynamic streaming levels, aka level instances.
creating a uworld is too low level, and it’s not the usual/normal flow of the engine. it will seriously create issues going forward. i can foresee a ton of issues with that.
the engine supports multiple worlds but it’s not the way to go.
i assume your players are networked, you haven’t said that explicitly.
you are making an assumption, implicitly, that since each player is at a different location they don’t need to see each other’s stuff.
this is a very risky assumption, and kinda makes the whole “networking” thing redundant.
i’d suggest not to assume that, unless you are optimizing and playing with net-relevancy.
but otherwise i’d suggest to just teleport players where they need to.
have a base, empty level, and load the sublevels using loadlevelinstance.
you can specify the transform manually and reuse them. so you can have the same sublevel many times. it’s amazing.
it will streamline everything i think. and allow you to have dlcs later on.
please search online for the docs of level instances.
Thanks for the suggestion, I will google the information about that
Yes, players are networked
They can be on the same location and one can “jump” to another and then “jump” back without ServerTravel or something
If I can spawn sublevel on demand and make separate global lightning, sounds, etc and hide/show it for specific player, then it fits fine for my needs
yes you can bake the lights separately on them.
there’s also something known as light levels , but those work a bit different, i havent used them in conjunction with level instances.
yes i think this will work.
and also will take care of async/sync loading too.
also if you need to make the player and/or camera stay still. you can either change the camera for the player, or have a dummy pawn that can’t move, with a specific camera, and posses that temporarily.
you can have a small level instance in a far reach place hidden in a black box, where you use as “loading screen”.
or you can fade the camera black in/out, which is what i’d do to not have to bother about all this.