2 Players 1 Ball how to properly push

Options
hey everyone so i have a small question.
so my current set up is: i have 2 Players: One Master and One Client.
and i have one Ball, thus by default owned by master.
each player, have a "Feet" script, that adds an Impulse to the ball, in OnTriggerEnter

now if Master Player, moves around, then the feet script touches the ball, then an impulse is added locally, and through velocity syncing, on other clients, the ball moves there as well.

now the issue arises, when it is the client that is adding impulse to the ball, since the client is always "reading" the information of the ball from the master, then, my solution was sending that impulse through an RPC command, as soon as the character feet hit the ball, but, this actually causes, a delayed effect, of the ball, being stuck to its place, and moving, after a while (after the RPC has arrived).

any one has any other method to use? i really, am failing to figure out how to handle this situation, of basically 2 players, one pushing the ball.

Note: the game is currently 2 players, in future there will be 4 players, so i'd be very thankful if you guys could help me, not asking for code, but like, the concept, what to use, what to do.

Sorry for poor english.

Comments

  • emotitron
    emotitron ✭✭✭
    Options
    A shared object like a ball is going to run you right into some of the core things that make game networking so difficult, especially without employing extrapolation of inputs. Trying to share objects in a server-less relay environment will be very challenging, as all clients see a slightly different world view and all live in the future compared to networked objects they don't own.
  • JondobGames
    edited July 2020
    Options
    emotitron wrote: »
    A shared object like a ball is going to run you right into some of the core things that make game networking so difficult, especially without employing extrapolation of inputs. Trying to share objects in a server-less relay environment will be very challenging, as all clients see a slightly different world view and all live in the future compared to networked objects they don't own.

    thank you, and an interesting way to put it, how would one extrapolate inputs?
    i mean, movement inputs, it is sort of understandable i am sure there would be some sort of mathematical equation that helps, but, for something like a button press, (the button that i press to throw the ball), i can not think of a way to handle that?
    if you could, perhaps, explain the underlying concepts, i'd be very thankful, or link me to somewhere where i can read more, course/book/tutorial.