Skip to content

ijustneedamail's desync speeculations #181

@cb3hjb

Description

@cb3hjb

problem

Cars in KissMP sometimes end up in different places on each computer.

findings probably maybe right

Car sync works like this on the client:
1. positional values(translative and rotative) of a vehicle are recieved
2. force to nodes is calculated and applied using the ping to the server (I forgot when the predict is called, I'll take a look)
meanwhile:
3. positional data is sent to the server

on the server side:
1. positional data is distributed every tick
2. other vehicle data every 5 seconds

experiments

implemented proper prediction of rotational force, the effect is negligable

speculation

  • Could this cause issues with trailers which have no gearbox/electrics:

async fn tick(&mut self) {

  • ping of other players not used (unless I missed something)
    I only saw some average of the ping to the server beeing used for the prediction

additionally

explanation of the code helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions