[OneSync] Ghost cars, Syncing issues (SEMI FIXED SEE COMMENTS)

So weird the blimp issue is fixed for me, now its a bunch of peds spawning and seagulls. Ped density is the lowest it can be without removing them too.


How about instead of being so blunt you provide contextual information regarding this, such as spawn logs or similar? I’ve said many times that I can’t reproduce these issues myself without any info, and the only issue variant that did have a repro provided (by @Less?) did seem resolved.

Here’s for instance a quick sample of a server-side script that’ll show creations and deletions of faraway entities (that might be considered problematic) plus their model hash.

local ids = {}

AddEventHandler('entityCreating', function(ent)
    local owner = NetworkGetEntityOwner(ent)
    local oc = GetEntityCoords(GetPlayerPed(owner))
    local ec = GetEntityCoords(ent)

    if #(oc - ec) > 422 then
        ids[NetworkGetNetworkIdFromEntity(ent)] = GetGameTimer()
        print("big dist", GetPlayerName(owner), ent, #(oc - ec), NetworkGetNetworkIdFromEntity(ent), GetEntityModel(ent))
    end
end)

AddEventHandler('entityRemoved', function(ent)
    local id = NetworkGetNetworkIdFromEntity(ent)

    if ids[id] then
        print("remove big dist", id, GetGameTimer() - ids[id])
        ids[id] = nil
    end
end)

Ideally, every big dist of a model shown to be population-generated should be tied to a remove big dist almost right away.

Are you using onesync_forceMigration?

Please don’t set ‘density’ values, they usually don’t ever do what you expect them to do (in reality, many of them actually just limit range, not density). These for example look like scenario peds, rather.

thx so much. the problem has been fixed!!

Apologies, I should have provided more details.
Server Artifacts: 2802
+set onesync legacy (.bat file)
set onesync_workaround763185 true (server.cfg)
set onesync_forceMigration true (server.cfg)
set onesync_distanceCullVehicles true (server.cfg)

This is the current setup I am running when still getting blimps/froggers falling from the sky.
Sometimes they recover, and fly away. Other, times they crash and burn. They seem to disappear after a bit, whether they have crashed or not. Using suppression seems fine. Only other issue seems to be sometimes vehicle will spawn that can’t be deleted, and when you open the door it freezes you in place.

Tested the provided:


AddEventHandler('entityCreating', function(ent)
    local owner = NetworkGetEntityOwner(ent)
    local oc = GetEntityCoords(GetPlayerPed(owner))
    local ec = GetEntityCoords(ent)

    if #(oc - ec) > 422 then
        ids[NetworkGetNetworkIdFromEntity(ent)] = GetGameTimer()
        print("big dist", GetPlayerName(owner), ent, #(oc - ec), NetworkGetNetworkIdFromEntity(ent), GetEntityModel(ent))
    end
end)

AddEventHandler('entityRemoved', function(ent)
    local id = NetworkGetNetworkIdFromEntity(ent)

    if ids[id] then
        print("remove big dist", id, GetGameTimer() - ids[id])
        ids[id] = nil
    end
end)
1 Like

… and what’s the output from it?

1 Like

Actually getting the same issue. Infinite spawn vehicles of PNJ and syncing problems. Look, i’m trying to enter the vehicle but I stand right in front of it, stuck on this animation.

Just like if vehicle isn’t really there. We have updated to 2802 today, and have set
+set onesync legacy (bat file)
+set onesync_population true (bat file)

1 Like

How hard is it to provide a repro, run the logging script, write proper English (what’s a “PNJ”?), use the variables mentioned a billion times in this topic that you should use, or put in any effort at all, before crying that you have “the same issue” without being anything but a pestilent leech?

I’m sorry for my bad English at the time I wrote the comment.

PNJ means NPC, i’m sorry for that. I couldn’t understand what is “repro” and where I can run the logging script.

The issue seems to be sometimes NPC vehicle will spawn that can’t be deleted, and when you open the door it freezes you in place (moslty NPC vehicles but it happens on players vehicles when they move too far away of their vehicle). Seems like they are not synced at all with players.
And as the NPC vehicle is stuck on place, it spawns another NPC vehicle until this one isn’t bugged, creating crash and explositions.

This issue seems to happen when there is more than one player in the “zone”. We do not have any script that set or modify the NPC density.

This should be mitigated by onesync_forceMigration 1 though if you can find out what causes it that’d be infinitely better.

Just to show a proof of concept, this is basically what can happen.

Should it be onesync_forceMigration 1 or onesync_forceMigration true? Also when im running it with set onesync legacy, onesync_forceMigration true, onesync_workaround763185 true, and onesync_distanceCullVehicles true, everything is good but when people buy vehicles it shows they own it in the db but they are unable to take it out. Have no clue if its because of the onesync_forceMigration true but when I added it the problem arose.

What should be the correct way then to adjust the denisity of npc cars and peds?

yeh i would be intrieged what the optimal way to set a normal population of peds is?

1 Like

NPC vehicles are disappearing in front of the eyes when a little too far away.

1 Like

how to stop the spawn of a specific vehicle?

SetVehicleModelIsSuppressed(GetHashKey("VehicleSpawnName"), true)

but this only works to spawn npc in a car, or to a car in the city, which are parked in parking lots, otherwise I write it, cars remain in the parking lots

Citizen.CreateThread(function()
while true do
Wait(100)
SetVehicleModelIsSuppressed(GetHashKey(“hydra”), true)
end
end)

2 Likes

Has anyone found a solution to this problem? Here I am having the same problem, driverless cars appear, the NPC’s driving is erratic, they appear with punctured wheels, they abandon the cars, some remain bug and I cannot delete them, they generate traffic jams and massive accidents, I am trying to find the right solution and it seems that I cannot find it, if someone has it please contact me and try to help me, thank you very much!

i have it too