How are complete ties handled?

Consider two identical deterministic AIs battling each other. They both happen to reduce their opponent’s HP to the same value below zero at the same frame. What is the result?

I’ve tested it with one of my algos playing against itself and found that sometimes blue wins and sometimes red wins.

What determines the winner? Total compute time? Or first one to output their last move? Or random?

Complete ties can happen in ping cannon vs ping cannon games.

Thanks!

The documentation covers this:

if both players have the same remaining Health, then the player whose algo took less time on average per turn to submit its commands is declared the winner.

Keep in mind that negative” health points are just considered as 0 hp. This means that a player who took 8 damage beyond zero will not necessarily lose against someone who took the exact killing blow.

Also, equal computing time practically does not happen. Even identical algos do not take the exact same time executing.

1 Like

Yeah I just realised I misread it and thought that phrase only applied to the 100 turn case

1 Like

Actually, this isn’t the full story…

I’ve played a game by hand. In the screenshot, both games at the same frame reduced their opponent to <0. P1 is on -4 and P2 is on -1. Yet P1 wins. So that means either

At this time, the player with the higher Health is declared the winner; if both players have the same remaining Health, then the player whose algo took less time on average per turn to submit its commands is declared the winner."

Is actually false or there is a bug in tiebreaks.

1 Like

This is expected behavior. There is no such thing as “negative health” in this calculation. Both players have 0 remaining health points, i.e. they are out of health.
Thanks for pointing it out though. I will add it to my original reply.

2 Likes

Ahh yes that seems to make sense

I’ll make this more clear this week

1 Like