Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTA3 car path links bug #128

Open
firedihm opened this issue Nov 30, 2024 · 0 comments
Open

GTA3 car path links bug #128

firedihm opened this issue Nov 30, 2024 · 0 comments
Labels
gta iii Issue concerns GTA III original bug An original issue not introduced by SilentPatch

Comments

@firedihm
Copy link

firedihm commented Nov 30, 2024

There's a famous bug in GTA3 that involves car pathfinding: AI often ignores vertical distance between path nodes. This was fixed in earlier versions of SP, but only for aggressive drivers—those that follow player—specifically in “Bait” mission. This issue persists for regular drivers, or “cars on rails.”

Video demonstration of the bug. In the video cars driving on underpass can connect to path nodes above the tunnel.

This loop needs to have a pos.z check added for proper path node linking.

// find closest unconnected node
nearestId = -1;
nearestDist = maxdist;
for(k = 0; k < TempListLength; k++){
    dx = tempnodes[k].pos.x - CoorsXFormed.x;
    if(Abs(dx) < nearestDist){
        dy = tempnodes[k].pos.y - CoorsXFormed.y;
        if(Abs(dy) < nearestDist){
            /* ideally, add z pos checking here */
            nearestDist = Max(Abs(dx), Abs(dy));
            nearestId = k;
        }
    }
}
@CookiePLMonster CookiePLMonster added original bug An original issue not introduced by SilentPatch gta iii Issue concerns GTA III labels Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gta iii Issue concerns GTA III original bug An original issue not introduced by SilentPatch
Projects
None yet
Development

No branches or pull requests

2 participants