HadiCya / DemoRacingJS

2 stars 1 forks source link

Buggy Detection of Race Winner #40

Open MatsoA opened 1 year ago

MatsoA commented 1 year ago

Completing a race takes more laps than it should and is overall unpredictable. I suspect it's due to incorrect behavior of state variables on the server and in game.js which handle the race detection.

MatsoA commented 1 year ago

i did some local testing and on the website by myself but i haven't been able to replicate the issue. After completing the required number of laps the race has been ended correctly

going to test it tomorrow with some real players

MatsoA commented 1 year ago

After doing further testing on the live version with a friend i was able to replicate the bug. Looking at it, I'm fairly confident the issue is not actually with the state management but instead is simply due to buggy checkpoint detection. It's pretty easy to skip checkpoints, in fact the fast car misses checkpoints very often. When this happens, in order to make progress requires going back to that checkpoint, which for players racing usually happens next lap. This means that it can take many go arounds to get to 4 actual laps.

TL;DR: I'm pretty sure if we make the checkpoints twice as thick and add a display for what lap/checkpoint your on, the behavior should be fixed