Search Unity

New to unity netcode questions

Discussion in 'Multiplayer' started by BIT-64, Feb 21, 2023.

  1. BIT-64

    BIT-64

    Joined:
    Apr 29, 2017
    Posts:
    43
    Hello,

    I have been looking into netcode and there are 3 questions that I cannot seem to find the answer too, if anyone has an idea I would appreciate the information.

    When using netcode, is it possible to create objects that once created do not need to transfer any data, ex: a tree"?

    Is it true that netcode has a hard time supporting a large amount of simple objects, ex: bullets in a shooter, let's say 500).

    And how do you do pathfinding with the navmesh, I was reading that the feature is not yet implemented in netcode? How can I get a character from A to B.

    I am looking at creating a colony builder.

    Thank you
     
  2. MrBigly

    MrBigly

    Joined:
    Oct 30, 2017
    Posts:
    221
    I only looked at netcode for gameobjects, I haven't developed with it. That said, I want to take a stab at your second question and my answer is agnostic to the specific network solution you choose.

    In general, no netcode can scale hundreds of objects without trading off something in return because bandwidth is the immovable bottleneck. So when it comes to projectile rounds in the hundreds, I would not think in terms of each round having its state sent across the wire. Instead I would come up with a way to emulate large quantities with few state.

    For example, if a machine gun is pushing out 20 rounds a second, your gun should have a deterministic spread. So you just need to send the state for the first round and the rest can be determined on each client for you.

    This is not to say that each round leaving the gun has the same aiming vector, or the same initial starting position, but it can all be managed with far less bandwidth than sending full position and aiming vector for each round in the air.

    So in answer to your second question, the answer depends on how you send state for bullets, and is not unique to Netcode for Gameobjects.
     
    Last edited: Feb 21, 2023