Search Unity

making a game with a separate server and client project.

Discussion in 'Multiplayer' started by wcallum, Sep 22, 2016.

  1. wcallum

    wcallum

    Joined:
    Dec 26, 2015
    Posts:
    17
    Hi, everyone. I have been recently working on a game with a friend where a player can join a server and play with lots of other people. and I mean lots. I was thinking about 75 people per server. But the land would be very big so the player would not always have to have all the players loaded.

    Becuase of the amount of people I decided that I had to make a game where there was a dedicated server. This would mean that if there was any code on the project for the client it would be a waste.

    So that's my issue. I want to make a game where people send everything to a server and the server send back players positions. while the server is another project.

    anyone know how to do this?

    thanks

    Callum

    and sorry for the bad explanations.
     
  2. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Sounds like you're on the right path already - separate client and server projects with uNet or other network link is the way to go.
     
  3. Hayz0rx

    Hayz0rx

    Joined:
    Apr 2, 2016
    Posts:
    34
    Take a look at:
    http://enet.bespin.org/
    https://www.photonengine.com/en/OnPremise (based on ENet, but some more features)
    I wouldn't call 75 players massive, but you could start by inspecting the photon SDK MMO project, there you can find some examples for region based interest management and item synchronisation / compression.
     
  4. wcallum

    wcallum

    Joined:
    Dec 26, 2015
    Posts:
    17
    Hi

    thanks for the response.

    was this what you meant by photon MMO SDK?:
    https://doc.photonengine.com/en/onpremise/current/applications/mmo/mmo-concept

    I was hoping for some way that I could simply communicate between projects. e.g. send an RPC to the server then the server sends one back.

    is there any way I can do that?
     
  5. wcallum

    wcallum

    Joined:
    Dec 26, 2015
    Posts:
    17
    thanks for the response. but sorry for being stupid,

    what exactly is unet?
     
  6. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    uNet is unity's internal networking system. Just one way to get your communication between clients and server going.
     
  7. wcallum

    wcallum

    Joined:
    Dec 26, 2015
    Posts:
    17
    ok, do you know of any tutorials for what I want, or something like that. I don't want to pester people on this.

    Thanks

    callum
     
  8. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
  9. AlinS03

    AlinS03

    Joined:
    Dec 9, 2018
    Posts:
    5
    Whippets I have this problem:
    I made a different project for the client and a different one for the server, but when I connect as a client to the server, the Player Prefab GameObject from the NetworkManagerScript spawns on the server but it doesn't spawn on the client, it throws an error:
    "Failed to spawn server object, did you forget to add it to the NetworkManager? assetId=ca70e3141cc66db4c9d0bcf4b42a7854 netId=1"
    but I have the PlayerPrefab assigned in NetworkManager on both the server project, and the client project
    Thanks a lot for any response!!!
     
  10. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The Unet HLAPI is not intended for connecting separate projects. There's a few old threads on the topic, which discuss the complications of making it work. Since Unet is deprecated and on the verge of removal I'd suggest just using another API, but you can hunt down those old threads if you want.