Command Execution Order

I’m trying to understand what happens over a turn, after a command is submitted. From my understanding of the source code, effectively each car treats the map as fixed during its turn, calculates a final position and if that final position is a collision then they resolve the collision. But otherwise, the cars don’t interact in any way during a turn.

Suppose car 2 is ahead of car 1 by a single space, both have speed 6, and both try to turn into lane 3. Will both cars pick up the powerup or only car 2? I couldn’t get this situation occurring in a real match but my guess would be that both cars gain a powerup.

Also, if a collision occurs and cars are pushed back onto their original lane, will they pick up any powerups which happen to be on the space they get pushed onto?

I hope my diagram and questions are clear

1 Like

Hi @marcin_k

The game engine squad will look into this later today. Thanks for your patience :slight_smile:

1 Like

Hello @marcin_k, with the situation you described, both car 1 and car2 would get the powerup .

If a collision were to occur i.e. the future positions of car1 and car2 would be the same block then instead car1 and car2 would remain in their own lanes (2 and 4) and thus neither of them would get the powerup.

There is currently an active issue indicating a bug in the way collisions are being handled and we are looking to resolve it as soon as we can.

Hope this helps.


Along these lines, it seems like a car can “overtake” another car that is ahead of it in the same lane, just by going at a higher speed and driving straight through it - as long as it ends up in front of the car it “overtakes” and not on the same block (the only time collisions are checked).

Not sure if this is something that needs to be fixed or not, but it’s pretty bizarre behaviour when thinking of real-life cars so I thought I’d point it out.

1 Like

it’s probably just to make the game simpler. it’ll be fine once its a bit clearer about how movement happens and how things interact during a turn :slight_smile:

@Malman while performing the current collision behavior fix we will consider the weird “overtake” logic :slight_smile: , we agree that it is weird.

It could also make for a nice strategy if you could zig-zag in front of an opponent to prevent them from overtaking you.

On that note - with regards to an earlier comment in the thread. Can the same powerup be consumed by both players, even across different rounds?

1 Like

Hello @Malman, @marcin_k and @rfnel, we are in the process of fixing the collision logic and have decided to prevent overtaking by moving through your opponent. :slight_smile: will revert once these changes are released.

@rfnel with regards to power-ups, yes they can be picked up by both players as they are not removed from the track once picked up.

Hello @Malman, @marcin_k and @rfnel we have released a new version of the game with collision logic now working as intended. You also cannot overtake your opponent by driving through them. :slight_smile:


Hi, please confirm

  • if both cars are in the same lane, the car behind cannot overtake the car in front without one of the cars changing lane.

  • Initially the cars are in different lanes, one slightly ahead of the other. The cars make a move causing both cars to be in the same lane. If the car behind has a higher speed then it can end up ahead of the other car.

Follow up on that:

  • what happens if the car behind (B) does try to overtake the car in front (A) by say, boosting?

Possible Options:

  • illegal move , car B is penalized and gets a NOOP move for that round
  • collision, but only on car B . Car B is moved back to round start position, -1
  • car B ends up in the block directly behind A, no other penalty
  • other??

Looks like this still causes the car behind to move through the car in front (as long as they don’t end up on the same block)

I thought the rules made them like ghost cars until they actually landed on the same block.
I wonder how this is handled if my bot looks at a position on the board and sees a car that is on mud, does the JSON file show the spot as mud or a car?

The json has a flag “occupiedByPlayerId” in the blocks.

Where is there is no car, the value is 0, otherwise the relevant player ID is populated.

So the terrain will still be MUD, or OIL, but that flag will tell you if there is a player there or not.

1 Like

My question is exactly as @demaniak’s asked regarding overtaking. In version 1.3 it’s mentioned “side-effect of this is players can no longer overtake by driving through the player in front of them”.

What then happens if two players are in the same lane, then player A uses a boost when they’re behind B, and A should end up ahead after the boost?

Question 2: Also, please include version numbers on the game engines like before. Someone might train their bot accidentally on the wrong version.

The logic for applying movement can be found here
@marvijo As far as I understand it, since player A is behind and they end up in front, they’ll have a collision and get pushed back 1 block

I need it in text so we don’t have to go through the codebase. I need to know if the player colliding from behind is supposed to be taken 1 block behind the collision block or 1 block from its destination block, and the effect of the collision on the player collided into.

1 Like

agreed. I’m sure over time the team will make the documentation better and better :slight_smile:

Make sure you are using the latest version of the starter pack though - bugs were recently fixed related to this.