Is it possible to do level streaming in a multiplayer game? Also I am thinking of making a hunting game which I would like a decent size map. Is it possible to make a good size map in UE?
Level streaming does function in multiplayer games. However, when any player steps into a level streaming volume, the connected level will load for every player, even though the other players are not inside that volume. Logic for streaming volumes is hardcoded to replicate streaming state changes to all clients, so level streaming in a multiplayer game may not be useful without changing source code.
You can, however, achieve a similar effect with some creative use of Blueprints and Trigger Volumes.
This way the streaming level will only be streamed on the client when the local character steps into the Trigger Volume.
Hope that helps get you started!
Thanks for pointing this out. However can I ask you how you would stream players for example. Imagine you get into a new area and there are a few players in there at the moment. They shouldn’t be visible if you are outside that area so that kind of dynamic content should be streamed too. In this case the pawn cannot be assigned to a specific level or should it be done that way each time a player enters or leaves an area ?
The same question applies to anything that could potentially be relocated to a different area during game (runtime).
You wouldn’t want to stream characters. Streaming actually loads and unloads assets from the game, and you wouldn’t want to remove a player’s character from the game so that another player wouldn’t see it.
What you’re looking for is replication based on distance from a player, I think. Check out this video tutorial series from one of our developers:
This includes information on how to set whether an actor or event is replicated for a client based on its distance from the player.
If you have more questions about how to set that up, please open a new post with your questions as they don’t really fall under the topic of level streaming. But if you do, please link to it here so that others with the same train of thought as yours can follow along. Thanks!
Thanks for your reply. I have already watched those videos and I’m not so sure they apply in this case. I actually really did mean loading and unloading assets. When you make a level streamable all the actors (thus assets) attached to it are being loaded and unloaded with it. Now I’m talking about a case where some of those assets would be allowed to change level during runtime.
Lets imagine an MMO game where players can drive vehicles. If a vehicle is set to be streamed with a specific level it would mean when a player drives it to another level another player would not see it in that very level as it would only get loaded into its (client) memory while he’s walking on the vehicle’s initial level.
Replication (if I understand it correctly) is meant to synchronize data. Meaning if a chest is not visible to a player due to distance its state and configuration information (like is it open or not etc) can be directed to a player from within a certain range. My point is whatever the player’s distance the chest will still be loaded into its memory. Maybe it will get loaded when it becomes replicated but it wouldn’t (as I understand) get unloaded once the player leaves the predefined range.
In an MMO-like game with a huge map and hundreds of thousands of objects (actors, assets, whatever) you cannot imagine having all those assets continuously in a client’s memory. Distance culling and distance-based replication are in my opinion a different matter. Here I think I’m really talking about content streaming for loading and unloading on demand.
I hope you understand what I’m trying to say. Maybe replication does participate in some memory cleaning. Maybe the garbage collector you use does load and unload some things at some specific times. But it sounds strange to me.
Sorry for insisting and actually still replying here. I will make a dedicated question if you confirm that this doesn’t apply to this one.
For a much larger world, you would probably need to use something like World Browser, though there are some known limitations in regards to multiplayer. MMO-like games require a great deal more custom setup than a simpler level using level streaming as described above. I believe you’re correct about replication configuration not being the solution to your problem; I misunderstood what you were trying to achieve.
I would recommend checking out some of the information in this forum post, starting with Sean’s and ddvlost’s responses:
I’ll check in with a few developers and see if I can find someone who can give you some more insight regarding larger-scale multiplayer.
Thanks. I’ll keep reading on there when I have the time. Note that I’m already aware of how to use the World Composition and its critical multiplayer limitation:
“Multiplayer also adds a restriction that world origin rebasing should be disabled”
If I read correctly we’ll be limited to a +/- 5km radius around the world origin.
I hope this will change in the future.
Thanks for your replies. And to point out that link that will be useful if they keep it up to date with the changes as they come.
Dedicated server does not support this kind of things. Spawned players will exist on all clients, regardless of the distance and will be removed only when player is disconnected from a server. The same rules apply for all other actors, they will stay in memory while owning level is still loaded.
Now I’m talking about a case where
some of those assets would be allowed
to change level during runtime.
I think actors should not change levels. With your vehicle example, streaming level should not own vehicle. Streaming levels should just own spawn points with information what kind of actor should be spawned from here, and when the actor is spawned it should be in the persistent level.
Unreal dedicated server does not work as MMO server, it can be used as an dungeon/instance server. Our licensees usually write their own MMO server solutions.
Ok thanks for the precisions.
Our licensees usually write their own MMO server solutions. Would be nice to get more info about this theme. How to build a own server solution. Where to get info about this? Thanks!
Sorry for grave digging but this has never been resolved. Are there any resources or code plugins that can help stream levels in and out locally? Is Epic planning on supporting this in upcoming versions?
I’d love to have world composition / level streaming supported with dedicated servers. Please make it a thing!