#Multiplayer Vehicle/Platform Moving

1 messages · Page 1 of 1 (latest)

muted forge
#

I am working on to replicate something like this https://www.youtube.com/watch?v=-ZHHO5IT9CE, in the riding on a raft section. The expected output looks like in the "RV There Yet", "Raft" and "Lethal Company" game, where standing in moving objects/platforms/vehicle looks smooth both in server and clients. I am using Netcode btw.

The Initial Problem: The server sees the nonserver player drifting from the vehicle due to some transform mismatch between the server and the nonserver.

The solution presented in the comments of the video: the creator said that the server handles the physics on the host only, and clients position are client authoritative only when they are pressing movement keys.

Tried Solution:
In server, I tried to snap the player on the moving vehicle, but now it doesn't move visually in the server even if the client is moving around the vehicle(maybe due to the network transform being overwritten by the snapping logic). I then tried to ServerRpc the client's input so the server will know if the client is making any input. I snap it only when the client is not making any inputs, it works but the transition between the 2 is snappy. It teleports, it wrongly predicts, it feels like there's a delay between the visuals of the client whenever the transition happens. It's a strange mix of seeing it locally and then the prediction of network transform whenever the player moves and stops.

Play Deadvale: https://store.steampowered.com/app/3504850/Deadvale/

Play Rise of the Primals II: https://juggernaute.itch.io/rise-of-the-primals-ii-demo

Example uses simulated 100 ms latency.

00:00 Picking up a crate
00:30 Riding on a raft
01:04 Picking up a crate with another player
01:33 Balance scale
01:50 Launching a player

▶ Play video
cinder drift
#

My idea here would be when the client does any sort of input -> send the position in local space (relative to the boat) to server -> server updates all other clients with the new positional instructions. If it's snappy then something is off with your interpolation.

hollow aurora
#

I'm not sure those games are using Network Transforms. You sometimes see some weird teleports that happen.

muted forge
hollow aurora
#

But you might able to get away with swapping the network transform authority on button press

muted forge
hollow aurora
#

I think almost everything is handled client side with clients just broadcasting out their inputs.

marsh nexus
# muted forge Will try

you probably want to use the ECS character controller which supports this and multiplayer cohesively

#

if you want to use GameObjects workflow you can use https://www.youtube.com/watch?v=zBz4kXGXj0I

In this first episode of the series, we kick things off by setting up our multiplayer project using Unity and the free Kinematic Character Controller (KCC) from the Asset Store.

You’ll learn how to:

Set up the KCC asset in a clean Unity project

Implement basic movement and jumping

Prepare your controller for server-authoritative multiplaye...

▶ Play video