Search Unity

Help Wanted Would server should I set? What it has to do?

Discussion in 'Multiplayer' started by rango302, Mar 26, 2021.

  1. rango302

    rango302

    Joined:
    Feb 1, 2018
    Posts:
    18
    I am planning to make a multiplayer game and I am new to the multiplayer world. After I searched around to get to know it, I am even more confused, now I am not sure what a big picture would look like and whether what I know is true. But I still got a plan. Please tell me if I am wrong.

    I know there are many solutions out there to make a multiplayer game. Photon, Mirror, MLAPI, Forge, DarkRift, and Unity Netcode (ECS + DOTS). Some of them are similar and some had huge differences. Here is what I guess so far: would

    • Photon PUN, Mirror, MLAPI, Unity netcode (ECS) are basically client-hosted, I have to at least make a relay server/ rent service to deliver the matchmaking. But is this enough?
    • MLAPI can also host a dedicated server, but I am not sure how, the tutorial shows if you want to host 1 game you have to run a 1 game first. What if you have to host 100?
    • Client host had insecurity because the host can modify the game to cheats. Most importantly, players would get the IP of other players that leads to potential hacking.
    • Client host would be divided into a few approaches. 1. Sync game state, 2. deterministic lockstep 3. deterministic forward. While 2, 3 is secure than 1 but why?

    I know people would ask what game are you making? how much budget you have? etc...
    Let's say the game would be a coop RTS mobile game (I have not decided yet TBH)
    Thanks for reading to here
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,627
    If you want to run more than 1 dedicated server instance on the same hardware, you run them on different ports. You should try out several networking API's to see what you like and what you don't. I know it is time consuming, but you're not going to get enough information from just reading opinions and looking at documentation.

    I'm not aware of any high level networking system which directly implements lockstep. You'd probably need to roll your own on top of a lower level networking system, but networking using lockstep is actually pretty trivial. You're just syncing player inputs and a bit of control data. The hard part of lockstep is designing your game so it is entirely deterministic, including on different CPU's from different vendors (Example, Intel and AMD CPU's are known to calculate floating point math ever so slightly differently, so you basically can't use any float math anywhere in the game's simulation - I wouldn't be surprised if the same issue exists between different mobile chip vendors).
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,627

    As far as security, the most secure approach is to do any calculations that matter to the game on a dedicated server under your direct control, trusting nothing provided by any client. Also do not send the client any data it does not require. Anything calculated on the client and trusted by the rest of the game is open to hacking.

    For example, speed hacks in games are often caused by the client in local control of its own player character's movement, then syncing that movement back to the server. The server trust's the client's movement as legitimate, and syncs it to the rest of the clients. So a player hacks a client's movement code to make the player's character move at otherwise impossible speeds, teleport, fly, etc.

    Lockstep sort of has good security by default, since the state of the game world isn't synced at all. Anything a player tries to cheat on their client, should just get their client out of sync with the rest of the players, so shouldn't harm the other players.
     
  4. Xentios

    Xentios

    Joined:
    Jan 15, 2019
    Posts:
    12
    I am also new and i don't even get which photon to use for a turn based game.
     
  5. rango302

    rango302

    Joined:
    Feb 1, 2018
    Posts:
    18
    This is probably by far the most sensible advice I am getting. Documentation is neither incomplete or not updated. The most horrible part is people on the internet have diverse opinions on frameworks. I don't know who to trust.

    By far I have tried MLAPI and I have trouble on connect players over the internet. Since there are no direct cloud services provided by the framework like Photon, I guess I have to implement my own game server for matchmaking and relay. Using PUN is straightforward. But then as you said, open to hacking.

    I read an article about how to plan a deterministic lockstep server. Their solution is using fixed point math calculation. Making your own server should cost a lot and I probably do it at least after this project.

    I know Photon used to have a deterministic tool called Photon TrueSync and it is recommended in the other post. I read the development tutorial and it does sync the input of players to be deterministic. But it is no longer developing and turned into Photon Bolt and Photon Quantum (Which is very expensive to use said in another post, around 1000/month, I kinda believe so because the cost is not shown on the Photon page). I don't know about other tools like Unity hosting and matchmaking service, I bet it is expensive too
     
    Joe-Censored likes this.
  6. Xentios

    Xentios

    Joined:
    Jan 15, 2019
    Posts:
    12
    I think Photon Quantum is for AAA companies or big indies. It also shows the pricing on the page and it start with 1000$.
     
unityunity