Cybertruck bug

I’ve found a small bug in the way hitting the cybertruck works. It isn’t something that is triggered often, but it can cause quite weird behaviour - might be worth fixing before the next round.

The hitCyberTruck() function here sets the speed to SPEED_STATE_1 (3), but it doesn’t use the reduceSpeedToLevel function, which automatically cancels the boosting state and the boost counter. So, when hitting a cybertruck while boosting, the speed is reduced to 3 but the boosting state remains and the boosting counter keeps counting down. Hitting any other obstacle or using another boost resets the boost state and doesn’t do anything strange. But if you don’t hit an obstacle or use a boost, the boost counter keeps decreasing (tickBoost is still called because boosting is still set). When the boost counter hits 0, tickBoost sets the speed to MAXIMUM_SPEED (9), as it normally would when a boost runs out. So you could be carrying on at a lower speed after hitting the cybertruck while boosting, not hitting anything, when suddenly your speed jumps to 9!

Here are some relevant rounds so you can see it in action (ignore the opponent giving invalid commands!). See that the speed jumps to 9 in round 43 despite the speed being 3 in round 42, and a DO_NOTHING command being issued.

=======================================
Starting round: 37 
=======================================

======================================================================================================
round:37
player: id:1 position: y:4 x:250 speed:6 state:USED_TWEET boosting:false boost-counter:0 powerups: OIL:3, BOOST:1, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:140 speed:3

[░░▓░▓░░▓░░░░░░░▓░░░»░▓░░░░]
[░░░░░▓░░░░░░░░░░░░░░░░░░░░]
[T░▓░░░░░░░░░░░░░░░░░░▓░░░░]
[░Φ░░░1░░░░C░░░░░▓░░░T░░∱░▓]
======================================================================================================
======================================================================================================
round:37
player: id:1 position: y:4 x:250 speed:6 state:USED_TWEET boosting:false boost-counter:0 powerups: OIL:3, BOOST:1, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:140 speed:3

[░░▓░▓░░▓░░░░░░░▓░░░»░▓░░░░]
[░░░░░▓░░░░░░░░░░░░░░░░░░░░]
[T░▓░░░░░░░░░░░░░░░░░░▓░░░░]
[░Φ░░░1░░░░C░░░░░▓░░░T░░∱░▓]
======================================================================================================
===============================================================================================================
Please enter your command of choice:
Instructions are presented in the following format: {command} : description of the effect
DO_NOTHING    : move forward at current speed
TURN_LEFT     : move to the lane above you and forward at (speed-1)
TURN_RIGHT    : move to the lane below you and forward at (speed-1)
ACCELERATE    : increase speed and move forward at new speed
DECELERATE    : decrease speed and move forward at new speed
USE_BOOST     : use boost powerup if you have one in your possession
USE_OIL       : drop oil barrel if you have one in your possession
USE_LIZARD    : use lizard powerup to jump for this round avoiding all obstacles, pickups and players until you land
USE_TWEET X Y : spawn a cyber at lane X and blocknumber 
=====================================================================================================================
USE_BOOST
C;37;USE_TWEET 261 4
=======================================
Completed round: 37 
=======================================

=======================================
Starting round: 38 
=======================================

======================================================================================================
round:38
player: id:1 position: y:4 x:254 speed:3 state:HIT_CYBER_TRUCK boosting:true boost-counter:5 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:143 speed:3

[▓░░▓░░░░░░░▓░░░»░▓░░░░░░░░]
[░▓░░░░░░░░░░░░░░░░░░░░░░░░]
[░░░░░░░░░░░░░░░░░▓░░░░░░░░]
[░░░░░1░░░░░░▓░░░T░░∱░▓░░░░]
======================================================================================================
======================================================================================================
round:38
player: id:1 position: y:4 x:254 speed:3 state:HIT_CYBER_TRUCK boosting:true boost-counter:5 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:143 speed:3

[▓░░▓░░░░░░░▓░░░»░▓░░░░░░░░]
[░▓░░░░░░░░░░░░░░░░░░░░░░░░]
[░░░░░░░░░░░░░░░░░▓░░░░░░░░]
[░░░░░1░░░░░░▓░░░T░░∱░▓░░░░]
======================================================================================================
===============================================================================================================
Please enter your command of choice:
Instructions are presented in the following format: {command} : description of the effect
DO_NOTHING    : move forward at current speed
TURN_LEFT     : move to the lane above you and forward at (speed-1)
TURN_RIGHT    : move to the lane below you and forward at (speed-1)
ACCELERATE    : increase speed and move forward at new speed
DECELERATE    : decrease speed and move forward at new speed
USE_BOOST     : use boost powerup if you have one in your possession
USE_OIL       : drop oil barrel if you have one in your possession
USE_LIZARD    : use lizard powerup to jump for this round avoiding all obstacles, pickups and players until you land
USE_TWEET X Y : spawn a cyber at lane X and blocknumber 
=====================================================================================================================
TURN_LEFT
C;38;USE_TWEET 262 4
=======================================
Completed round: 38 
=======================================

=======================================
Starting round: 39 
=======================================

======================================================================================================
round:39
player: id:1 position: y:3 x:256 speed:3 state:TURNING_LEFT boosting:true boost-counter:4 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:146 speed:3

[░▓░░░░░░░▓░░░»░▓░░░░░░░░░░]
[░░░░░░░░░░░░░░░░░░░░░░░░░▓]
[░░░░░1░░░░░░░░░▓░░░░░░░░░░]
[░░░░░░░░░░▓░░░T░░∱░▓░░░░░░]
======================================================================================================
======================================================================================================
round:39
player: id:1 position: y:3 x:256 speed:3 state:TURNING_LEFT boosting:true boost-counter:4 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:146 speed:3

[░▓░░░░░░░▓░░░»░▓░░░░░░░░░░]
[░░░░░░░░░░░░░░░░░░░░░░░░░▓]
[░░░░░1░░░░░░░░░▓░░░░░░░░░░]
[░░░░░░░░░░▓░░░T░░∱░▓░░░░░░]
======================================================================================================
===============================================================================================================
Please enter your command of choice:
Instructions are presented in the following format: {command} : description of the effect
DO_NOTHING    : move forward at current speed
TURN_LEFT     : move to the lane above you and forward at (speed-1)
TURN_RIGHT    : move to the lane below you and forward at (speed-1)
ACCELERATE    : increase speed and move forward at new speed
DECELERATE    : decrease speed and move forward at new speed
USE_BOOST     : use boost powerup if you have one in your possession
USE_OIL       : drop oil barrel if you have one in your possession
USE_LIZARD    : use lizard powerup to jump for this round avoiding all obstacles, pickups and players until you land
USE_TWEET X Y : spawn a cyber at lane X and blocknumber 
=====================================================================================================================
DO_NOTHING
C;39;USE_TWEET 264 3
=======================================
Completed round: 39 
=======================================

=======================================
Starting round: 40 
=======================================

======================================================================================================
round:40
player: id:1 position: y:3 x:259 speed:3 state:NOTHING boosting:true boost-counter:3 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:149 speed:3

[░░░░░░▓░░░»░▓░░░░░░░░░░░░░]
[░░░░░░░░░░░░░░░░░░░░░░▓░░▓]
[░░░░░1░░░░░░▓░░░░░░░░░░░░░]
[░░░░░░░▓░░░T░░∱░▓░░░░░░░░░]
======================================================================================================
======================================================================================================
round:40
player: id:1 position: y:3 x:259 speed:3 state:NOTHING boosting:true boost-counter:3 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:149 speed:3

[░░░░░░▓░░░»░▓░░░░░░░░░░░░░]
[░░░░░░░░░░░░░░░░░░░░░░▓░░▓]
[░░░░░1░░░░░░▓░░░░░░░░░░░░░]
[░░░░░░░▓░░░T░░∱░▓░░░░░░░░░]
======================================================================================================
===============================================================================================================
Please enter your command of choice:
Instructions are presented in the following format: {command} : description of the effect
DO_NOTHING    : move forward at current speed
TURN_LEFT     : move to the lane above you and forward at (speed-1)
TURN_RIGHT    : move to the lane below you and forward at (speed-1)
ACCELERATE    : increase speed and move forward at new speed
DECELERATE    : decrease speed and move forward at new speed
USE_BOOST     : use boost powerup if you have one in your possession
USE_OIL       : drop oil barrel if you have one in your possession
USE_LIZARD    : use lizard powerup to jump for this round avoiding all obstacles, pickups and players until you land
USE_TWEET X Y : spawn a cyber at lane X and blocknumber 
=====================================================================================================================
DO_NOTHING
C;40;USE_TWEET 267 3
=======================================
Completed round: 40 
=======================================

=======================================
Starting round: 41 
=======================================

======================================================================================================
round:41
player: id:1 position: y:3 x:262 speed:3 state:NOTHING boosting:true boost-counter:2 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:152 speed:3

[░░░▓░░░»░▓░░░░░░░░░░░░░░░░]
[░░░░░░░░░░░░░░░░░░░▓░░▓T░░]
[░░░░░1░░░▓░░░░░░░░░░░░░░Φ∱]
[░░░░▓░░░T░░∱░▓░░░░░░░░░░░░]
======================================================================================================
======================================================================================================
round:41
player: id:1 position: y:3 x:262 speed:3 state:NOTHING boosting:true boost-counter:2 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:152 speed:3

[░░░▓░░░»░▓░░░░░░░░░░░░░░░░]
[░░░░░░░░░░░░░░░░░░░▓░░▓T░░]
[░░░░░1░░░▓░░░░░░░░░░░░░░Φ∱]
[░░░░▓░░░T░░∱░▓░░░░░░░░░░░░]
======================================================================================================
===============================================================================================================
Please enter your command of choice:
Instructions are presented in the following format: {command} : description of the effect
DO_NOTHING    : move forward at current speed
TURN_LEFT     : move to the lane above you and forward at (speed-1)
TURN_RIGHT    : move to the lane below you and forward at (speed-1)
ACCELERATE    : increase speed and move forward at new speed
DECELERATE    : decrease speed and move forward at new speed
USE_BOOST     : use boost powerup if you have one in your possession
USE_OIL       : drop oil barrel if you have one in your possession
USE_LIZARD    : use lizard powerup to jump for this round avoiding all obstacles, pickups and players until you land
USE_TWEET X Y : spawn a cyber at lane X and blocknumber 
=====================================================================================================================
TURN_LEFT
C;41;USE_TWEET 270 3
=======================================
Completed round: 41 
=======================================

=======================================
Starting round: 42 
=======================================

======================================================================================================
round:42
player: id:1 position: y:2 x:264 speed:3 state:TURNING_LEFT boosting:true boost-counter:1 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:155 speed:3

[░▓░░░»░▓░░░░░░░░░░░░░░░░░░]
[░░░░░1░░░░░░░░░░░▓░░▓T░░░░]
[░░░░░░░▓░░░░░░░░░░░░░░Φ∱░░]
[░░▓░░░T░░∱░▓░░░░░░░░░░░░░░]
======================================================================================================
======================================================================================================
round:42
player: id:1 position: y:2 x:264 speed:3 state:TURNING_LEFT boosting:true boost-counter:1 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:155 speed:3

[░▓░░░»░▓░░░░░░░░░░░░░░░░░░]
[░░░░░1░░░░░░░░░░░▓░░▓T░░░░]
[░░░░░░░▓░░░░░░░░░░░░░░Φ∱░░]
[░░▓░░░T░░∱░▓░░░░░░░░░░░░░░]
======================================================================================================
===============================================================================================================
Please enter your command of choice:
Instructions are presented in the following format: {command} : description of the effect
DO_NOTHING    : move forward at current speed
TURN_LEFT     : move to the lane above you and forward at (speed-1)
TURN_RIGHT    : move to the lane below you and forward at (speed-1)
ACCELERATE    : increase speed and move forward at new speed
DECELERATE    : decrease speed and move forward at new speed
USE_BOOST     : use boost powerup if you have one in your possession
USE_OIL       : drop oil barrel if you have one in your possession
USE_LIZARD    : use lizard powerup to jump for this round avoiding all obstacles, pickups and players until you land
USE_TWEET X Y : spawn a cyber at lane X and blocknumber 
=====================================================================================================================
DO_NOTHING
C;42;USE_TWEET 272 2
=======================================
Completed round: 42 
=======================================

=======================================
Starting round: 43 
=======================================

======================================================================================================
round:43
player: id:1 position: y:2 x:273 speed:9 state:NOTHING boosting:false boost-counter:0 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:158 speed:3

[░░░░░░░░░░░░░░░░░░░░∱░░░░░]
[░░░░░1░░▓░░▓T░░░░░░░░░░░░▓]
[░░░░░░░░░░░░░Φ∱░░░▓░▓░░░░░]
[∱░▓░░░░░░░░░░░░░░░░░░░░░░░]
======================================================================================================
======================================================================================================
round:43
player: id:1 position: y:2 x:273 speed:9 state:NOTHING boosting:false boost-counter:0 powerups: OIL:3, LIZARD:2, TWEET:2
opponent: id:2 position: y:4 x:158 speed:3

[░░░░░░░░░░░░░░░░░░░░∱░░░░░]
[░░░░░1░░▓░░▓T░░░░░░░░░░░░▓]
[░░░░░░░░░░░░░Φ∱░░░▓░▓░░░░░]
[∱░▓░░░░░░░░░░░░░░░░░░░░░░░]
======================================================================================================
===============================================================================================================
Please enter your command of choice:
Instructions are presented in the following format: {command} : description of the effect
DO_NOTHING    : move forward at current speed
TURN_LEFT     : move to the lane above you and forward at (speed-1)
TURN_RIGHT    : move to the lane below you and forward at (speed-1)
ACCELERATE    : increase speed and move forward at new speed
DECELERATE    : decrease speed and move forward at new speed
USE_BOOST     : use boost powerup if you have one in your possession
USE_OIL       : drop oil barrel if you have one in your possession
USE_LIZARD    : use lizard powerup to jump for this round avoiding all obstacles, pickups and players until you land
USE_TWEET X Y : spawn a cyber at lane X and blocknumber 
=====================================================================================================================
DO_NOTHING
C;43;USE_TWEET 287 2
=======================================
Completed round: 43 
=======================================

=======================================
Starting round: 44 
=======================================

======================================================================================================
round:44
player: id:1 position: y:2 x:282 speed:6 state:HIT_MUD boosting:false boost-counter:0 powerups: OIL:3, LIZARD:2, TWEET:3
opponent: id:2 position: y:4 x:161 speed:3

[░░░░░░░░░░░∱░░░░░░▓░░░░░░░]
[░░▓T░1░░░░░░░░░░▓░░»░▓▓░░░]
[░░░░Φ∱░░░▓░▓░░░░░▓░▓░░░░░▓]
[░░░░░░░░░░░░░░░░░░#░░░░░░░]
======================================================================================================
======================================================================================================
round:44
player: id:1 position: y:2 x:282 speed:6 state:HIT_MUD boosting:false boost-counter:0 powerups: OIL:3, LIZARD:2, TWEET:3
opponent: id:2 position: y:4 x:161 speed:3

[░░░░░░░░░░░∱░░░░░░▓░░░░░░░]
[░░▓T░1░░░░░░░░░░▓░░»░▓▓░░░]
[░░░░Φ∱░░░▓░▓░░░░░▓░▓░░░░░▓]
[░░░░░░░░░░░░░░░░░░#░░░░░░░]
======================================================================================================
===============================================================================================================
Please enter your command of choice:
Instructions are presented in the following format: {command} : description of the effect
DO_NOTHING    : move forward at current speed
TURN_LEFT     : move to the lane above you and forward at (speed-1)
TURN_RIGHT    : move to the lane below you and forward at (speed-1)
ACCELERATE    : increase speed and move forward at new speed
DECELERATE    : decrease speed and move forward at new speed
USE_BOOST     : use boost powerup if you have one in your possession
USE_OIL       : drop oil barrel if you have one in your possession
USE_LIZARD    : use lizard powerup to jump for this round avoiding all obstacles, pickups and players until you land
USE_TWEET X Y : spawn a cyber at lane X and blocknumber 
=====================================================================================================================

I have raised this with the team.

Hello @Malman. Thank you for picking this up. Given that this bug affects both players equally we will not be updating the engine prior to the 2nd tournament, to respect the code freeze. We will however have it fixed after the fact.

3 Likes

Hello @Malman this bug has been fixed and will be available in the next release