Search Unity

Creating Groups or Sections to Login to through Netcode.

Discussion in 'Netcode for GameObjects' started by IdleChimp, Dec 6, 2022.

  1. IdleChimp

    IdleChimp

    Joined:
    May 21, 2022
    Posts:
    11
    So, it's been a while since I have done networking. The last thing I used was a server/client architecture--which seems to be what the Netcode examples seem to implement. The server I used before could break up the clients into groups. This is something I really need, because I have different instructors appointed to different students.

    So my question is: How should I approach this concept in Unity's Netcode?

    I've taken the Hello World, Golden Path I and Golden Path II tutorials. I think I get it! But I am having a mental block on how to approach splitting the students up into groups according to their instructor.

    Can someone brainstorm some ideas with me?

    Thanks so much,
    IdleChimp
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,892
    Hard to give advice without knowing what kind of tutoring this is about and why it needs a single server respectively client groups.

    The easiest way would be for each tutor to start their own Netcode server (host). If the tutor needs acces to centralized data (eg presentation data, questionnaires etc), this could be handled by accessing a central tutoring webserver instead.

    Because for Netcode all clients are equal, and they have to be in the same scene too. Any client grouping / group separation is something you‘d have to implement yourself, including assigning clients a group id and also use that group id in rpc messages to direct them only to group specific clients via RpcParams.

    But something tells me that all students and tutors on a single Netcode server is not necessary and just going to overconplicate everything.
     
  3. IdleChimp

    IdleChimp

    Joined:
    May 21, 2022
    Posts:
    11
    Hey CodeSmile,
    First, thanks for posting something about this!

    So, this would be training multiple students in a 3D environment. Most likely an FPS. An instructor would begin the game/simulation and then the students would join that sim based on their instructor.

    Maybe something that would help me with your reply is understanding what makes a Netcode Host and a Netcode Server. Any links for reading? I notice when starting a host (from the examples), Unity creates a Player, but with a server, this doesn't happen.

    I could handle the grouping with a bit of code. I know I will be using a database to store player GUID and ID, Instructors, Instructor ID and there respective simulations and so on. That should help me organize what I need. I'm just in the beginnings of the planning phase.

    I just don't want to jump the gun. I want to know what Netcode can do and maybe what is happening under the hood?

    You say, "But something tells me that all students and tutors on a single Netcode server is not necessary and just going to overcomplicate everything." I think I totally agree after your host comment.

    So maybe you can point me to some reading on how Netcode is implementing the host versus a server. I feel stupid for asking. Because it seems like the host means that a Player is hosting the game. Am I right? I will have a static IP to use for this and notice that the NetworkManager has a convenient input for the PORT number and IP.

    I'll get there! LOL

    Thanks,
    IdleChimp
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,892
  5. IdleChimp

    IdleChimp

    Joined:
    May 21, 2022
    Posts:
    11
    Alright CodeSmile. I am on it! Thanks.