vendredi 22 janvier 2016

ue4 multiple level zoning, and architecture

It is important to understand how ue4 works to make a multiplayer game.
A dedicated server runs only one level (physics, replication, ...).
You have multiple possibilities. If all your players are changing of zone at same time, and the zone is loaded only at this moment, your server can change zone, and load it, and the clients will do the same.
One server is enough

But if you wish to have several zone running at same time, you must keep in mind, that you must have one dedicated server per zone.
The client will connect to the server it needs at the moment it wants.
From my side, when client is launched, it is not connected. It shows a level with a tiny scene, and an UI to fill knickname, and a button to connect.
Once player clicks on connect, I send a connection to the first server using IP and port.
it is enough. Once connected, the server will send the level to load, and replicate actors which need to be replicated.

during game, maybe player wish to change zone, to travel elsewhere. I will disconnect to current server, probably load a temporary level, with tiny scene, to wait connection to other server, and then I will connect to a new IP/Port, to reach the new server hosting the level I want to travel to.
Once again, the server will send the name of level to load, and replicate what it needs.

Finally it is quite standard as an architecture, but you don't have choice, it is way to do.

I got a question on instantied zone. I think best way is to have a running server by instance too.

Aucun commentaire:

Enregistrer un commentaire