#Few Racers have no phasing while in race.

1 messages · Page 1 of 1 (latest)

olive elm
#

There are no error and while debug is on it shows GHOSTED and then DE GHOSTED when I get within the distance set in the config for "Config.Ghosting.NearestDistanceLimit"

Can't make it 0 for obvious reasons but is only "fix" at the moment, but it seems the racers are not registered as racers even though they are in the race and joined the race while in a car.

Tried mostly everything so far but can't say for sure what the issue might be, I did make changes to the original script but I test with default script and still does the same. The only changes I made were for the checkpoint props and the DoPilePfx and added a phone notification for relevant notifications to come "FROM THE PM" to make it a little better to know exactly the amount of GNE received etc.

I made no changes to ghosting, tried giving the players a new alias with the admin tool and made them purchase a new one with a new name but no change has happened.

Is there an idea as to why this would happen? Maybe alias length? Maybe Race length? amount of checkpoints? have only 1 race with 60 checkpoints and the rest are between 30 and 50 checkpoints

olive elm
#
Timer is off
^3playeridx    3    126
target    390914
comparing to player    242690    390914
242690    390914    is same:    false
In same car:    false
^1Not in race
distance    6645.0859375
GHOSTED
Timer is off
^3playeridx    3    126
target    390914
comparing to player    242690    390914
242690    390914    is same:    false
In same car:    false
^1Not in race
distance    6717.0200195312
GHOSTED
Timer is off
^3playeridx    3    126
target    390914
comparing to player    242690    390914
242690    390914    is same:    false
In same car:    false
^1Not in race
distance    6742.4819335938
GHOSTED
Timer is off
^3playeridx    3    126
target    390914
comparing to player    242690    390914
242690    390914    is same:    false
In same car:    false
^1Not in race
distance    6769.2895507812
GHOSTED
Timer is off
^3playeridx    3    126
target    390914
comparing to player    242690    390914
242690    390914    is same:    false
In same car:    false
^1Not in race
distance    6773.0927734375
GHOSTED
Timer is off
^3playeridx    3    126
target    390914
comparing to player    242690    390914
242690    390914    is same:    false
In same car:    false
^1Not in race
distance    6784.4907226562
GHOSTED
Timer is off
^3playeridx    3    126
target    390914
comparing to player    242690    390914
242690    390914    is same:    false
In same car:    false
^1Not in race
distance    6780.880859375
GHOSTED
Health|Stress|Armor Buff
Timer is off
^3playeridx    3    126
target    390914
comparing to player    242690    390914
242690    390914    is same:    false
In same car:    false
^1Not in race
distance    6778.828125
GHOSTED
Timer is off
^3playeridx    3    126
target    390914
comparing to player    242690    390914
242690    390914    is same:    false
In same car:    false
^1Not in race
distance    6778.1137695312
GHOSTED
olive elm
#
DE GHOSTED
Timer is off
^3playeridx    3    126
target    205570
comparing to player    232450    205570
232450    205570    is same:    false
In same car:    false
^1Not in race
distance    1715.3758544922
^3playeridx    4    125
target    205314
comparing to player    232450    205314
232450    205314    is same:    false
In same car:    false
^1Not in race
distance    1.7588189840317
DE GHOSTED
Timer is off
^3playeridx    3    126
target    205570
comparing to player    232450    205570
232450    205570    is same:    false
In same car:    false
^1Not in race
distance    1755.5515136719
^3playeridx    4    125
target    205314
comparing to player    232450    205314
232450    205314    is same:    false
In same car:    false
^1Not in race
distance    2.1765379905701
DE GHOSTED
Timer is off
^3playeridx    3    126
target    205570
comparing to player    232450    205570
232450    205570    is same:    false
In same car:    false
^1Not in race
distance    1798.3208007812
^3playeridx    4    125
target    205314
comparing to player    232450    205314
232450    205314    is same:    false
In same car:    false
^1Not in race
distance    2.4861795902252
DE GHOSTED
Timer is off
^3playeridx    3    126
target    205570
comparing to player    232450    205570
232450    205570    is same:    false
In same car:    false
^1Not in race
distance    1869.9545898438
^3playeridx    4    125
target    205314
comparing to player    232450    205314
232450    205314    is same:    false
In same car:    false
^1Not in race
distance    2.4861655235291
DE GHOSTED

The prints I am getting and the player was ID 3 at the time

The player side was not finding me??

So far can tell that there are 2 racers this happens with and no one can phase through them at the time

olive elm
#
Starting ghost loop. All player:    { [1] = 121,[2] = 122,[3] = 123,[4] = 124,[5] = 125,[6] = 126,[7] = 127,[8] = 128,} 

Not sure if that's needed for debugging purposes

strange blade
#

Are there players that are not in the race close to the race? Or in the vehicles of other racers?

strange blade
#

So in that example, a non-race player is 2.48 meters away from them

#

It still de-ghosts if there's a passenger in a race car that's not in the race.
The ghosting check is already a bit intensive so I don't wanna bog it down to much with more logic, so the only way I can think of to make that work would be to skip checks on players who aren't driving.

You'd still ghost rhough a parked car with a passenger tho

olive elm
olive elm
#

I'm not sure how I can explain it ..

#

Player 1 and player 2 and player 3 in the race.

Player 1 and player 3 ghost perfectly fine, as soon as player 1 and 3 get close to 2, they get de ghosted

#

Tried using all local cars, spawned in by admin, tried bought local cars with no customizations .. tried new aliases for the racer .. but still de ghosts

strange blade
#

It only checks players.

According to your logs the players it checked against weren't in the race 🤔

strange blade
#

I pushed an update to the phasing yesterday, you might wanna test it

olive elm
#

Will take a look

olive elm
#

Tested it and well doesn't seem to be working, there are many racers in the race at the moment so I can't be too sure as to which racer might be the issue

strange blade
#

Did you update the config also? SkipPedestrians being set to true like the new version?

olive elm
#

yes I did sorry for late reply .. Wondering if its a OneSync Error? I was using Legacy but switched to Infinity recently. Would that be the reason?

strange blade
#

Could be

#

Doubt it's onesync tho

#

But if it's an issue with statebags maybe, then you could try removing all inSameRace checks in playerIswithinDistance function

#

It works fine for me so I can't test this

#

Could you describe exactly what is happening when you say that it does not work?

  • How many are in the race?
  • Are there other non racers close by?
  • Are there non racers in the cars?
  • Are there others on the server?
  • Are other races being run at the same time?
  • Does phasing work when there's less racers in the race?
  • Does phasing work any time?

Also kinda need logs, and a description of the exact scenario that happens when the logs are taken (or a video) to have anything to even guess what could be causing it.

#

it COULD be that statebags are just trash and the approach needs a rework

strange blade
#

@olive elm could you try this code, see if it fixes it?

#

It's only the client and server files so should be easy to test out

#

I've moved the statebag sets to server side

strange blade
olive elm
# strange blade Could you describe exactly what is happening when you say that it does not work?...

I do appreciate you taking your time to understand the issue I am having.

So 5-6 racers in a race. It's always the same 2 racers when getting close to that the collision goes off.
No non-racers in any of the racing.
There are other players in the server but at the time when we tested the racing with the distance check set at 20 to disable the ghost all players that were in the server, were racing.
So I jiust made distance check to 0 and well now its a constant ghosting and the cop chases are getting a bit tedious

The phasing works perfectly for all but 2 racers. When getting close to the 2 racers, it disables for some reason. Only found it with the 2 racers. Other racers still have their phasing enabled when they close to each other

#

Will test this shortly

olive elm
#

Also not sure if you want to take a look at this

local function markWithUglyWaypoint()
    if UseUglyWaypoint then
        StartGpsMultiRoute(49, true, false)

        if CurrentRaceData.CurrentCheckpoint == #CurrentRaceData.Checkpoints then
            AddPointToGpsRoute(CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint].coords.x, CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint].coords.y, CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint].offset)
            SetGpsMultiRouteRender(true, 16, 16)
        elseif CurrentRaceData.CurrentCheckpoint + 1 <= #CurrentRaceData.Checkpoints then
            AddPointToGpsRoute(CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint + 1].coords.x, CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint + 1].coords.y, CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint + 1].offset)
            if CurrentRaceData.CurrentCheckpoint + 2 <= #CurrentRaceData.Checkpoints then
                AddPointToGpsRoute(CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint + 2].coords.x, CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint + 2].coords.y, CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint + 2].offset)
            end
            if CurrentRaceData.CurrentCheckpoint + 3 <= #CurrentRaceData.Checkpoints then
                AddPointToGpsRoute(CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint + 3].coords.x, CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint + 3].coords.y, CurrentRaceData.Checkpoints[CurrentRaceData.CurrentCheckpoint + 3].offset)
            end
            SetGpsMultiRouteRender(true, 16, 16)
        end
    end
end

The GPS from nopixel racing always facinated me, so I tried to do something similar with the help from ChatGPT.

So the waypoints are made through every 3 checkpoints until getting to the last or 2nd last checkpoint of the race.

#

it works perfectly with some races but with other waypoint placements, it doesn't work out well at all for that 2 - 3 checkpoints. Wondering if there is a better way of doing it or do I have to edit the checkpoints themselves. Probably will have to place checkpopints better for the races

#

That's how it looks

strange blade
#

If it can't path from A->B in a legal manner it fucks up

#

Same issue with the track drawing thing

#

Putting the checkpoints in the correct lane tend's to "fix" it

strange blade
#

Any luck with the phasing? @olive elm

olive elm
#

Unfortunately, got messages last night from the people that did the racing and they said there was no phasing for 2/3rds of the racers didn't have phasing

olive elm
# strange blade Any luck with the phasing? <@906215776204251156>

The message I received from the player

also weird one but I also come across people complaining I had phasing some times but the rest 

So I was on has law enforcement and saw all the racers had phasing as their cars were translucent at a distance but when got close the phasing went off (as it should, I made the distance check to 20 gta units). But for them, only 1 of the racers had phasing and the other 3 did not have phasing at all

strange blade
#

Man I'm about to just give up on this shit LuL

#

So it didn't work at any time for the racers?

If you get close and they get de-phased they'd still be able to bump each other

olive elm
#

So I wasn't close by the time they couldn't phase through each other .. but when I (non racer) was close, I saw the phasing disable. So I'm not 100% sure, but by the way they saying it is coming out as, from the start of the race, those 3 racers couldn't phase through anyone, but the one racer could phase through all 3 of them.

#

and it was only the 4 of them in the area at the time and no spectators

strange blade
#

Hmm

#

maybe it's SetLocalPlayerAsGhost that's just not syncing correctly

#

If you could run the script with debug on and provide logs that'd be amazing

#

the logs should say why the de-ghosting happens

olive elm
#

will be client correct?

#

Oraginising a race now, people might only start racing in about 45 minutes .. should send you the logs of all racers by the end of the night

strange blade
#

Yeah client

strange blade
#

I also tried a rework using SetEntityNoCollisionEntity instead.

Only gotta replace the client/main.lua for this

#

if you can please try that also

#

Do note: the ghost look wont show with this method. Also there's some funky camera going on when ghosting inside each other LuL

strange blade
strange blade
#

@olive elm Did you have any success? 👀

olive elm
strange blade
#

Did you try the new one I sent?

strange blade
#

It won't have much logs at all tho cause it won't ever de-phase a player. It just phases racers against each other but not against anything else

#

Gonna look through the logs. Super thanks 🙏

olive elm
olive elm
#

will try now

strange blade
#

Also note on what I wrote earlier about it:
You won't SEE the phased cars being phased any more.

#

The new method might work better tho nodders

olive elm
#

so everyone in the race now is angry at me for asking them again xDDD

strange blade
#

nearest distance limit shouldn't make a difference with new method

olive elm
#

This the new phasing?

local function validateTime()
if CurrentRaceData.Ghosting and CurrentRaceData.GhostingTime then
return actuallyValidateTime(CurrentRaceData.GhostingTime)
else
debugLog('Ghosting | Defaulting time validation. Ghosting:', CurrentRaceData.Ghosting, 'Ghosting Time:', CurrentRaceData.GhostingTime )
return actuallyValidateTime(0)
end
end

#
local function actuallyValidateTime(Timer)
    if Timer == 0 then
        debugLog('Timer is off')
        return true
    else
        if GetTimeDifference(GetGameTimer(), ghostLoopStart) < Timer then
            if useDebug then
               print('Timer has NOT been reached', GetTimeDifference(GetGameTimer(), ghostLoopStart) )
            end
            return true
        end
        debugLog('Timer has been reached')
        return false
    end
end
#

That the new?

strange blade
#

No that's the time validation. If a time is set it de-ghosts everyone after that

#

new ghosting method is in ghostThread()

olive elm
#

trying to see what debug message I should look out got

strange blade
#

It has none, cept for the de-ghosting when finishing

#

I can't debug log in the new one cause it has to run EVERY tick LuL

#

I'd flod the console with 60+ messages per second

#

I don't need the logs for the new method. Just a verification if it works with multiple people

#

I've only tested it with 2

olive elm
#

Ah I see

#

Testing now

strange blade
#

The new method just disables collision on a client level between the player and all other racers.
It won't disable collisions between racers when a cop gets close for example. But cop should still be able to ram em

olive elm
#

It works 100%

#

jsut the camera was aids

strange blade
#

Yeah doubt that's fixable sadly

#

A good way to make people still try to avoid each other I guess LuL

olive elm
#

6+ racers

#
while start do
        Wait(5)
        local playerVehicle = GetVehiclePedIsIn(PlayerPedId())
        for _, v in pairs(GetGamePool('CVehicle')) do
            for _, j in pairs(phasePlates) do
                if GetVehicleNumberPlateText(v) == j then
                    if DoesEntityExist(v) then
                        local vehCoords = GetEntityCoords(v)
                        local pos = GetEntityCoords(PlayerPedId())
                        local close = #(pos - vehCoords) <= 20.0
                        if close then
                            SetEntityNoCollisionEntity(v, playerVehicle, false)
                            DisableCamCollisionForEntity(v)
                            DisableCamCollisionForObject(v)
                        end
                        if (#phasePlates) >= 5 then
                            Wait(250)
                        end
                    end
                end
            end
        end
    end

I attempted this in a other rac ing I used that was on phone and seem to work?

strange blade
#

Ah shit maybe it's that easy

#

Crazy that the GTA Online racing phasing Native don't even work lmao

#

shit ass Fivem LuL

olive elm
#

xDDDD

strange blade
#

I'll clean some stuff up (old phasing is still left rotting in the code now) and make a release tomorrow 👍

Super thanks for the help

olive elm
#

thank you for trying to understand my messed up explainations xDD

#

This racing is amazing .. might be intergrating it into av_laptop that I have

#

okay not might .. will be .. once I get the resources I need

strange blade
#

Good luck mixing UIs haha

olive elm
#

I'll try my best .. I am not very familiar with js, html, typescript or whatever language that UI language is xD

zinc agate
#

Hey guys sorry for reopening this thread after a year but i was wondering if is there a fix for the camera being affected by the "collision" when racers are phased.

I tried and with ghosting enabled when racers go through each other the camera is just a complete mess and we see the other racers colliding even if they do not collide (if that makes sense). @olive elm

zinc agate
#

@strange blade any suggestions? I find that if I am only with another racers it works perfectly but as soon as there are 3+ racers tha camera bugs out when you got through other racers

strange blade
#

No idea

#

It might be that it has to remove collisions for the player entity also, not just the vehicle