Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Where to begin with the new Networking system?

Discussion in 'FPS.Sample Game' started by Trensharo, Nov 1, 2018.

  1. Trensharo

    Trensharo

    Joined:
    Aug 10, 2017
    Posts:
    4
    I am really liking what this project is about and how much it showcases- A holistic example of a game with pro implementation of many different aspects of Unity. The downside to such a large scale project is that it is difficult to gain meaningful context as to how the project was assembled in order to reverse engineer the mechanics.

    My (immediate) goal with the dissection of this project is to establish a most basic multiplayer game using the new Networking system... or to at least partially wrap my head around the transport layer and the scripts involved. I was able to build a couple decent multiplayer games with the UNet HLAPI, and had some understanding of the hierarchy of the Networking classes from top to bottom. My thoughts are that if I can follow along with the development of the new Networking API, I can digest it over time and have a deep understanding of how it works.

    As I've begun to dig into the project, I am having a hard time getting my bearings. There are a ton of Networking scripts all over the place, and where they are implemented is unclear.
    -------------------------------------------------------------TLDR----------------------------------------------------------------------------
    I am hoping somebody with experience in how this project is structured can point me in the right direction on how to dissect how multiplayer was implemented. All I really need is to create spheres with synced transforms that can shoot at each other, and build from there.

    If this project is not the best place to begin, I would appreciate a link to a more appropriate resource.

    Thanks :)
    - Rick Williams
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    676
  3. Trensharo

    Trensharo

    Joined:
    Aug 10, 2017
    Posts:
    4
    Thank you!
     
  4. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    72
    Unity.Transport is only a thin layer. The stuff built on top is really the chunk of what makes the Netcode.
    The Netcode is in Scripts/Networking and main points of interest are NetworkServer/Client. It's very versatile and unlike other network frameworks I have no code changes other than removing the Map sync which is annoyingly intertwined in an else if before Events.

    In that case. A replicated Entity with a moveable comp is enough. There's a MovableCube prefab which is a synced physic object. Then you need to bind another action in the UserCommand and have a system that spawns those and give it force.

    There's a server command,spawnBoxes that shows how this works.
     
  5. AggressiveMastery

    AggressiveMastery

    Joined:
    Nov 19, 2018
    Posts:
    41
    @Trensharo check out Peter's networking video if you have not:


    Cheers