Engine Bug, Head on Collision

This Does not appear to be reported on github yet,

If two of my bots Collide head on, it appears to favor my first bot,
I am uncertain if this still holds true in the event where its simultaneous trail collisions.

if two bots hit each other, unless they are in their own territory, they should both respawn.

Hi @WillieTheron , this is by design but the rules are nuanced. Let me try to explain.

Bots commands are processed in the order that they were received. So the first bot to issue a command gets priority. One extreme example might be where two bots run side by side and turn towards each other within the same game tick. This results in a head on collision so how do we decide which bot survives and which one gets pruned? The bot for which the turn command was received first, even if by a millisecond.

And another extreme example on the other side of the spectrum would be, perhaps what you’re encountering. Two bots turn directly towards each other right as the game starts setting them on a collision course which would only happen 50 game ticks later. Again, once they collide the victor is decided by whichever issued it’s command first, even if it were 50 game ticks ago but 1 millisecond before the other bot’s command.

I hope that makes sense?

2 Likes

This is awesome,

Since my code is identical,
My first bot will almost always win.

Thank you for this. I set this as closed,
Im okay with the early bird catches the worm, thats fair enough…

1 Like

I do have a follow up question to this.

Can you issue a command, then then replace it with a different command before the next tick occurs?

I.e be first to decide on collision, unless your algorithm later decides that’s unwise.

Not really. I mean, when you issue a command, it is added to your bot’s command queue and will be processed in that order. You can’t cancel a command. All you can do is add another command to come after it, but the first command will have to be processed first before the next one will be processed.

1 Like

Hey, Im not sure if Im just making a mistake or something, but I can’t seem to recreate this behavior reliably. Im testing two dummy bots against each other. First I send them both to the bottom row to line them up, then I make the head-on collide to see who survives. Sometimes the bot with the most recently sent command survives and sometimes the bot with the least recently sent command survives.

Hi @Jesse, are you able perhaps to send me a log of a scenario where the bot with the the least recently sent command survives? That should not happen and if it does, it’s a bug. I’d like to have a look at it but will need something to investigate.

I’m not sure how to use log files, but can I just send you a python script that allows you to easily test the bug? If so, how would I send it to you?

You can send it in DM if you want.