Multiplayer - Best Method for level switching

So, I need some tips. I have thought of somethings, let me know if they’re good ideas or not.

Well, my first idea were to create the player’s avatar on the server, and then create it over to the client. But if I do that, then I am literally going to put my self in a hole because then I’d have to change the server’s scene (which I don’t want). So, that’s probably not such a good idea.

My second idea is to create the avatar only if the clients (players) are in the same scene. Let me know the best method - I want to use the most common and useful method.

There’s always a third option is to open different ports for the different scenes, but that’s kind of really lame and would take out my router. So, yes, please let me know if you know any good methods.

The questions are:

What is the purpose of the server?
What is the purpose of the client?

Those are very intelligent questions to ask yourself.

The client is used to connect and send data to the server, while the server sends data back to the client. So, I guess, I can use the server to only send messages to the client. Messaging the client that there’s a new person in the scene or that the person exits the scene. So maybe my second idea is actually a proper way of doing things.

Most modern games are server authoritative, your first method. But this requires the server to be running the game, as you describe, and it presents interesting problems when there is high ping (above 100ms, server authoritative games are unplayable).

Beck when modems were less reliable, the second method was used, using the server just as a sort of ‘router’ taking packets from everyone and redistributing them. This is the approach I favour, since my ping to the US (on a good day) is in excess of 200ms, making most modern games unplayable. This is also the simplest to code, and a single server can easily ‘host’ or ‘route’ different concurrent games with very very little CPU overhead.

The only reason i see that modern games use the First method. (Host a game send send it to Client) Is to prevent hacks from getting into the system… Depending on what you are doing in your game you could do the second method but do some anti-hack code. You all ready know how everything will react. Example: you programed your character to move at 3 units per sec so the server watches the characters and checks to make sure that they move under 4-5 units per sec. (this is a work around for lag…). Or Your player has just did an event and gained so items in their inventory. the Server checks to make sure you completed the quest first so you cant item hack the game…

Thanks for sharing. I’ll definitely keep a look out for that.

This is the purpose of client/server for communication … it is an important aspect.

But I want to know about another aspect of you game: what does the server do in difference to the client (regarding to your game logic).