altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 17 forks source link

Parked Vehicles sometimes get reset to a previous position #1077

Open JulianMa opened 3 years ago

JulianMa commented 3 years ago

Client/server version

Build #5.4, branch release, known by our project since December 2020

Current behavior

I know, that this Issue is known in the alt:V Team for a long time and that several other Projects can confirm this aswell. I'am openeing this Ticket, so we can collect as much Informations as we can, to maybe reproduce this one day.

I try to explain everything we found out

I build a simple Teleport Detection for our Live-Server, to estimate the size of the Problem. It works like this:

There is no single line of Code in our script, which is changing a Vehicles position, so this should not effect the result.

At the moment i'am using a rather low threshold of 85 units per second. Normaly no vehicle should be able to reach that. We dont have any Air-Vehicle. But this doesnt really matter, as i have log entries showing speeds of > 400 Units/s, which are just impossible to reach.

A typical Log Entry looks like that:

Click to show ```json { "vehicleId": 143, "vehicleSpeedInUnitPerSecond": 438.43224012886617, "netOwnerId": "Florian_Danmow", "detectedAt": "2021-04-01T19:42:56.709Z", "oldPos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "newPos": { "x": 96.96263885498047, "y": -216.27691650390625, "z": 54.3524169921875 }, "netOwnerHistory": [ { "oldNetOwner": null, "newNetOwner": "Erik_Foley" }, { "oldNetOwner": "Erik_Foley", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "Erik_Foley" }, { "oldNetOwner": "Erik_Foley", "newNetOwner": "David_Paul" }, { "oldNetOwner": "David_Paul", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "Erik_Foley" }, { "oldNetOwner": "Erik_Foley", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "Erik_Foley" }, { "oldNetOwner": "Erik_Foley", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "Max_Broady" }, { "oldNetOwner": "Max_Broady", "newNetOwner": "Ryan_Rice" }, { "oldNetOwner": "Ryan_Rice", "newNetOwner": "Zac_Cooper" }, { "oldNetOwner": "Zac_Cooper", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "Michael_Crook" }, { "oldNetOwner": "Michael_Crook", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "Erik_Foley" }, { "oldNetOwner": "Erik_Foley", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "Klaus_Steinbeiss" }, { "oldNetOwner": "Klaus_Steinbeiss", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "David_Paul" }, { "oldNetOwner": "David_Paul", "newNetOwner": "Luka_Enis" }, { "oldNetOwner": "Luka_Enis", "newNetOwner": "Alex_Bonkov" }, { "oldNetOwner": "Alex_Bonkov", "newNetOwner": "Mike_Ehrmantraut" }, { "oldNetOwner": "Mike_Ehrmantraut", "newNetOwner": "Dufo_Cordes" }, { "oldNetOwner": "Dufo_Cordes", "newNetOwner": "Alex_Bonkov" }, { "oldNetOwner": "Alex_Bonkov", "newNetOwner": "Mike_Ehrmantraut" }, { "oldNetOwner": "Mike_Ehrmantraut", "newNetOwner": "Alex_Bonkov" }, { "oldNetOwner": "Alex_Bonkov", "newNetOwner": "Eddy_Schmitz" }, { "oldNetOwner": "Eddy_Schmitz", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "Mike_Ehrmantraut" }, { "oldNetOwner": "Mike_Ehrmantraut", "newNetOwner": null }, { "oldNetOwner": null, "newNetOwner": "Mike_Ehrmantraut" }, { "oldNetOwner": "Mike_Ehrmantraut", "newNetOwner": "Karl_Bergmann" }, { "oldNetOwner": "Karl_Bergmann", "newNetOwner": "Cindy_Braun" }, { "oldNetOwner": "Cindy_Braun", "newNetOwner": "Alex_Bonkov" }, { "oldNetOwner": "Alex_Bonkov", "newNetOwner": "Dimitri_Baranow" }, { "oldNetOwner": "Dimitri_Baranow", "newNetOwner": "Alex_Bonkov" }, { "oldNetOwner": "Alex_Bonkov", "newNetOwner": "Eddy_Schmitz" }, { "oldNetOwner": "Eddy_Schmitz", "newNetOwner": "Arthur_Pendragon" }, { "oldNetOwner": "Arthur_Pendragon", "newNetOwner": "Eddy_Schmitz" }, { "oldNetOwner": "Eddy_Schmitz", "newNetOwner": "Maxi_Kowa" }, { "oldNetOwner": "Maxi_Kowa", "newNetOwner": "Maximilian_Zeitler" }, { "oldNetOwner": "Maximilian_Zeitler", "newNetOwner": "Eddy_Schmitz" }, { "oldNetOwner": "Eddy_Schmitz", "newNetOwner": "Karl_Bergmann" }, { "oldNetOwner": "Karl_Bergmann", "newNetOwner": "Allan_Harrington" }, { "oldNetOwner": "Allan_Harrington", "newNetOwner": "Ronny_Lich" }, { "oldNetOwner": "Ronny_Lich", "newNetOwner": "Triix_Shelby" }, { "oldNetOwner": "Triix_Shelby", "newNetOwner": "Florian_Danmow" } ], "positionHistory": [ { "entityId": 143, "pos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "netOwner": "Ronny_Lich", "model": 3057713523, "timestamp": "2021-04-01T19:40:45.981Z" }, { "entityId": 143, "pos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "netOwner": "Ronny_Lich", "model": 3057713523, "timestamp": "2021-04-01T19:41:00.498Z" }, { "entityId": 143, "pos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "netOwner": "Ronny_Lich", "model": 3057713523, "timestamp": "2021-04-01T19:41:15.033Z" }, { "entityId": 143, "pos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "netOwner": "Ronny_Lich", "model": 3057713523, "timestamp": "2021-04-01T19:41:29.555Z" }, { "entityId": 143, "pos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "netOwner": "Ronny_Lich", "model": 3057713523, "timestamp": "2021-04-01T19:41:44.093Z" }, { "entityId": 143, "pos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "netOwner": "Ronny_Lich", "model": 3057713523, "timestamp": "2021-04-01T19:41:58.604Z" }, { "entityId": 143, "pos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "netOwner": "Ronny_Lich", "model": 3057713523, "timestamp": "2021-04-01T19:42:13.125Z" }, { "entityId": 143, "pos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "netOwner": "Ronny_Lich", "model": 3057713523, "timestamp": "2021-04-01T19:42:27.660Z" }, { "entityId": 143, "pos": { "x": -72, "y": 6357.99560546875, "z": 31.3524169921875 }, "netOwner": "Ronny_Lich", "model": 3057713523, "timestamp": "2021-04-01T19:42:42.178Z" }, { "entityId": 143, "pos": { "x": 96.96263885498047, "y": -216.27691650390625, "z": 54.3524169921875 }, "netOwner": "Florian_Danmow", "model": 3057713523, "timestamp": "2021-04-01T19:42:56.709Z" } ], "model": 3057713523 } ```

Frequency I just checked the logs, and there were around 60 Vehicle teleports in the last 7 days. Today, there were 7 teleports.

Videos Here is some footage of our users, showing the Bug in action:

Expected behavior Vehicle will stay on old Position.

Steps to reproduce As far as we know, there is no way of reproducing this.

Context (environment) We are one of the larger alt:V Projects, with Players peeking around 300-650. This Issue seems to occur more often, when there are more Players on the Server.

Possible solution There is no known solution.

JulianMa commented 3 years ago

I extended my logging yesterday and found out something really interesting. I'm also saving every netOwnerChange event to a List, with some useful informations like position of the vehicle and time of the netOwner change. When a teleport gets detected, this list will also be dumped as json.

Every time a Teleport happended, the last netOwner before the teleportation was only netOwner for a really small time. Often < 200ms. Then another netOwner switch occured, and the vehicle was on the older position again.

These are two netOwner Change Events, in which the vehicle was teleported between. Note the timestamps:

{
            "oldNetOwner": null,
            "newNetOwner": "Liv_Gee",
            "timestamp": "2021-08-27T21:56:27.540Z",
            "position": {
                "x": -1371.138427734375,
                "y": -864.8175659179688,
                "z": 15.05859375
            }
        }, {
            "oldNetOwner": "Liv_Gee",
            "newNetOwner": "Anna_Black",
            "timestamp": "2021-08-27T21:56:27.640Z",
            "position": {
                "x": -23.696701049804688,
                "y": -139.08131408691406,
                "z": 56.5596923828125
            }
        }

This really looks like a caching/timing issue on netOwner migration.

Here are other examples of the same thing:

Teleport 2 - netOwner Change History ```json { "oldNetOwner": null, "newNetOwner": "Sascha_Mayer", "timestamp": "2021-08-27T14:36:40.829Z", "position": { "x": -755.037353515625, "y": -1079.037353515625, "z": 11.4022216796875 } }, { "oldNetOwner": "Sascha_Mayer", "newNetOwner": null, "timestamp": "2021-08-27T14:36:41.029Z", "position": { "x": 1248.4879150390625, "y": -3163.252685546875, "z": 5.4373779296875 } } ```
Teleport 3 - netOwner Change History ```json { "oldNetOwner": null, "newNetOwner": "Freya_Brown", "timestamp": "2021-08-27T19:44:36.398Z", "position": { "x": -1675.92529296875, "y": -513.085693359375, "z": 36.794921875 } }, { "oldNetOwner": "Freya_Brown", "newNetOwner": "Nick_Gamble", "timestamp": "2021-08-27T19:44:36.602Z", "position": { "x": 86.87472534179688, "y": -154.62857055664062, "z": 54.6724853515625 } } ```
Teleport 4 - netOwner Change History ```json { "oldNetOwner": null, "newNetOwner": "Ella_Tuc", "timestamp": "2021-08-27T21:34:21.295Z", "position": { "x": 289.74066162109375, "y": -1988.3604736328125, "z": 20.4842529296875 } }, { "oldNetOwner": "Ella_Tuc", "newNetOwner": null, "timestamp": "2021-08-27T21:34:21.452Z", "position": { "x": -356.8747253417969, "y": -399.5208740234375, "z": 30.021240234375 } } ```
deluvas1911 commented 3 years ago

Can confirm this issue. Can reproduce this also when having cached position and becoming netowner for a small duration (<250ms)

JulianMa commented 2 years ago

The number of teleportations hasn't changed, after the commit in 6.0 which tried to fix it. Yesterday, there were 27 Vehicle Teleportations on Prod Server. Feel free to Contact me on Discord, when you need other Informations: r3sist3nt#3119