Search Unity

Question Netcode: How to fake input for thin clients?

Discussion in 'NetCode for ECS' started by bobbaluba, Nov 20, 2020.

  1. bobbaluba

    bobbaluba

    Joined:
    Feb 27, 2013
    Posts:
    81
    So the docs say:

    "Thin clients cannot be presented, and never spawn any entities it receives from the server. However, they can generate fake input to send to the server to simulate a realistic load."​

    In my current setup the server instantiates a ghost for each player and sets owners accordingly the clients attach an ICommandData buffer to the player owned by the client. This works for normal clients, but not for thin clients, since these are never spawned (as per the documentation above).

    How then are we supposed to send inputs from thin clients. Is it not compatible with having command streams on server spawned entities?
     
  2. adammpolak

    adammpolak

    Joined:
    Sep 9, 2018
    Posts:
    450
    You will need to have the thin client create a "shell" entity just to hold ICommandBufferData and then have the NetworkConnectionEntity CommandTargetComponent point at that entity.

    https://github.com/Unity-Technologi...s/Asteroids/Client/Systems/InputSystem.cs#L34