Online multiplayer. 1 'main-world' & smaller ones.

Hello there fellow developers, artists!

So, I don’t think giving much info about the game is required now. Basically what I want is to have a main world / overworld, players will drop into, (unless they were at some place else the last time). And from that world you could visit other -smaller- locations. This is something you could see in morpg’s, for example.

While these morpg’s seem to be a main concept on forums and answers, there doesn’t seem to be any information regarding this…

Anyways, imagine a X-amount of players in 1 area/world. One of them walks over to an entrance that leads, maybe, underground. This one person should be seperated from the others.

I tried playing around with scenes for this, but that just messed up the server. But I don’t think you should use different lobbies/rooms for this either?

Those games usually have a lobby system that pops up after you signed in. It lets you choose a world while theyre all identical. Still, within those worlds you can still do what I explained above.

I’m working on a multiplayer RPG myself at the moment, and it works something along the lines that you are describing if I understand you correctly.

So when a player goes through a ‘portal’ into another map, the scene changes for that player, and his character becomes invisible to anyone still on the old map, and becomes visible to anyone else that is on the new map.

The way that I handle this is by keeping a reference to the map ID that the player is currently on (using RPC to update the value on all clients) and comparing that value with the ID of the current map on the corresponding client. If they match I show the player, otherwise I hide the player.

I haven’t looked into how to stop sending network data between players that aren’t on the same maps, however in my case as I’m using PUN+ I’m thinking it’ll be something to do with groups,

So you do use scenes for this? I tried this, but when I did it with the client, the host could still see the client. When I did it with the host, the client lost his player completely.
I think showing/hiding the players works, but that can’t be good. If you’re just switching their mesh on and off, the game and server are still processing all those ‘invisible’ players.

In games with similar systems, you often see a quick loading screen, so it seems that the server is reconnecting the player to this new location.

I mentioned this in the last paragraph of my post, it’s something I still need to address, however my initial goal was to enable map changing on a per client basis and implement the mechanics of hiding the player objects based on their location in the game world as seen from each connected client. That part is working perfectly, so next I’ll look at how to prevent clients synchronizing data to other clients that aren’t on the same map, and as previously mentioned I’m thinking that groups will be the way to approach this.

I probably should have mentioned also that I’m using the new SceneManagement system to additively load and unload the maps, so I’m not actually changing scenes as such, I have a root game scene which never changes and I additively load the maps onto that.