Boost speed bug

The speeds of my car after boosting seems completely broken in the current build. This is one example where my car fixed all the damage in the previous two turns and then boosted. No terrain was hit but the final speed is 5 ?? why ?

Starting round: 70
Player A - LCubed: Map View

round:70
player: id:1 position: y:4 x:429 speed:3 state:FIXED_CAR statesThatOccurredThisRound:FIXED_CAR boosting:false boost-counter:0 damage:0 score:24 powerups: BOOST:3, EMP:2
opponent: id:2 position: y:3 x:136 speed:0

[β–‘β–‘β–‘β–‘β–‘β–‘#β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘#β–“β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘]
[β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘#β–“#β–‘#β–“β–“β–‘]
[β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘βˆ±β–‘β–‘#β–“β–“β–“#β–‘]
[β–‘β–‘β–‘β–‘β–‘1░░░░░░░░░░»»░░░░#β–“β–‘#]

Received command C;70;USE_BOOST
Player B - CoffeeRef: Map View

round:70
player: id:2 position: y:3 x:136 speed:0 state:NOTHING statesThatOccurredThisRound:NOTHING boosting:false boost-counter:0 damage:4 score:-28 powerups: OIL:6, BOOST:3, LIZARD:1, TWEET:1
opponent: id:1 position: y:4 x:429 speed:3

[β–“β–‘β–‘β–‘β–‘β–‘β–“#β–‘β–‘β–‘#β–‘β–“β–“β–“β–“β–“β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘]
[#β–“#β–‘β–‘β–“β–‘β–‘β–‘β–‘Tβ–‘#β–“β–“β–“#β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘]
[β–‘β–‘###2β–‘β–‘β–‘β–‘Β»#β–“β–“β–“#β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘]
[β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–“β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘#β–“]

Received command C;70;TURN_LEFT
Completed round: 70


Starting round: 71
Player A - LCubed: Map View

round:71
player: id:1 position: y:4 x:444 speed:5 state:USED_BOOST statesThatOccurredThisRound:USED_BOOST boosting:true boost-counter:5 damage:0 score:36 powerups: BOOST:4, EMP:2
opponent: id:2 position: y:3 x:136 speed:0

[β–‘#β–“β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–“β–“#β–‘]
[β–‘β–‘β–‘#β–“#β–‘#β–“β–“β–‘β–‘β–‘*β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–“β–“β–‘β–‘]
[β–‘β–‘βˆ±β–‘β–‘#β–“β–“β–“#β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘#β–“β–“β–“β–“β–“]
[░»»░░1β–‘#β–“β–‘#░»»░░░░░#β–“β–“β–“β–“β–‘#]

If what I suspect is correct, you will have to look at the previous rounds where max allowed speed was adjusted.
What I know can happen (for example) is:

  • you hit stuff , and max allowed is adjusted downward
  • then you boost
  • you get lucky, and you hit no damage while boosting
  • boost counter reaches zero, and you drop back to speed 9 (constant MAXIMUM_SPEED)
  • now, your MAX allowed speed is still actually whatever it was set to previously, but it will only kick in if you try to accelerate (I think).

You can look at CarGamePlayer - most of the speed/damage related problems are in there (afaik)

FIW, I took a wild stab at POC fix here.

1 Like

As well as this being a weird bug, isn’t the speed of 5 only the initial speed - why is it reachable at all except at the start? Or is it now one of the speed states for round 3?

speed 5 is not reachable by accelerating but it is part of the speed limits:
damage states:
damage: max speed:
0 - 15
1 - 9
2 - 8
3 - 6
4 - 5
5 - 3
6 - 0

damage is capped at 6.
so if you accelerate while having 4 damage you end up at speed 5.

Could also be a bug not sure if it’s intended

1 Like

Hi, also seem to be picking up a similar bug for when my bot accelerates. See below - no damage, but unable to accelerate past a speed of 8 (even though I do move the 9 blocks as one would expect)

Round 018

A - sonic-sloth (id: 1)
pos: (93, 4) -> (102, 4), speed: 8, damage: 0
state: ACCELERATING
cmd: ACCELERATE
powerups: oils: 0, boosts: 0, lizards: 0, tweets: 0, emps: 0
[β–‘#β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘#β–‘Ξ¦]
[β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘*β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘βˆ±β–‘Β»]
[β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘]
[β–‘β–‘β–‘β–‘β–‘1β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘]


Round 019

A - sonic-sloth (id: 1)
pos: (102, 4) -> (111, 4), speed: 8, damage: 0
state: ACCELERATING
cmd: ACCELERATE
powerups: oils: 0, boosts: 0, lizards: 0, tweets: 0, emps: 0
[β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘#β–‘Ξ¦#β–‘β–‘β–‘β–‘β–‘##β–‘]
[β–‘*β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘βˆ±β–‘Β»*β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘]
[β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘βˆ±β–‘]
[β–‘β–‘β–‘β–‘β–‘1β–‘β–‘β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘Β»β–‘β–‘]
1 Like

I’ve found the cause of this bug and I submitted a PR two days ago with a broken test in one commit and a fix in the next.
The problem is that in the current engine the maximum speed isn’t updated after fixing.
It’s only updated when interacting with other things.

So. If you fix and then hit something your maximum speed will be correct, but it wont be correct immediately after fixing.

See: https://github.com/EntelectChallenge/2020-Overdrive/issues/106

2 Likes

I dont think this is accurate anymore

Documentation states damage is capped at 5 and specifically states:

Damage of 5 equals in a max speed of 0
Damage of 4 equals in a max speed of 3
Damage of 3 equals in a max speed of 6
Damage of 2 equals in a max speed of 8
Damage of 1 equals in a max speed of 9
Damage of 0 equals in a max speed of 15

Meaning Speed state 5 should only be the initial state.
We do have a code freeze, so if this is inacurate I will adjust accordingly,

Yeah. This has been fixed. The engine works as you describe now.

3 Likes