Search Unity

Way to create persistent worlds with many players - new multiplayer system?

Discussion in 'Multiplayer' started by derpiboii, Apr 19, 2019.

  1. derpiboii

    derpiboii

    Joined:
    Jan 2, 2018
    Posts:
    3
    Hi there,
    I am just wondering if it will be possible to create persistent worlds for many players with the new tech stack and transport layer. Is there some way to cluster the world so each server can handle a part of the map without confronting the player with loading screens when walking into a nother zone? So is it possible to have many players play in the same, consistent world?
    Thanks
     
    ascavalcante80 likes this.
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The current state of Unity's new multiplayer code is very low level. Everything you described you would have to build on your own on top of what has so far been made available.

    I was looking into seamless server hand offs for my own game and it is a very tricky issue with lots of corner cases you'd need to resolve.

    Here's an example:
    Your game uses projectile weapons, you fire your weapon at a target across a server border. What happens?

    Does the target actually get hit? Does the projectile disappear as soon as it hits the server border? If the target does get hit, how does that work? The server with the target didn't create the projectile, so do the two servers constantly move objects back and forth between the servers?

    How do you get notified of the result of the hit? Does the server with the target tell your client directly that you hit the enemy, or does it relay the message to the server where you're located to tell you? But what happens if you fire the projectile, and before it hits you cross the border?
     
    Last edited: Apr 19, 2019
    ascavalcante80 and Munchy2007 like this.
  3. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    This makes my brain melt just thinking about it. I'm sticking with loading screens between zones :)
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    It did the same to me. I went with the client is connected to a single zone, the terrain they see overlaps adjacent zones (so it doesn't always look like they will fall off the edge of the planet) but they can't see other objects from the adjacent zones, and loading screens as the client switches zone servers.
     
  5. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    I took a similar approach, except that my maps/zones are designed with impassable borders and as it's a top down camera view similar to something like Diablo 3 the player doesn't ever see the edge of the terrain.
     
    Joe-Censored likes this.
  6. ddalacu

    ddalacu

    Joined:
    May 13, 2014
    Posts:
    31
    Have you took a look at SpatialOS, it does exactly what you want, persistence, huge maps and shared work using workers
     
  7. ascavalcante80

    ascavalcante80

    Joined:
    Jun 28, 2018
    Posts:
    12
    Have you guys found a kind of simple tutorial or example of this kind of implementation ?