How much time does an algo have per turn?

Currently I use a very time consuming algo, it spends about 5 seconds per turn and is mostly not punished for that.

Sometime when it reach above 6 seconds to submit it’s turn, it’s health is slightly decreased.

Is this how it is supposed to work? I didn’t find the rules about time constraints in the doc.

Currently we guarantee around 3 seconds of compute time. However, our servers give some lee-way for now until we fine-tune the exact timings. After 5 seconds you take 1 health damage for every second over 5 per turn.

This may be subject to change though. Also ranked matches and playground matches run on different server architectures so check your algo’s timings in ranked matches especially. You can check if you click the little triangle under your algo’s name during a match near “details” to see how long it took per turn.

2 Likes

If you are doing some kind of search, threading.Timer is useful to interrupt the loop just before the time limit (https://docs.python.org/3/library/threading.html#timer-objects).

2 Likes

Thank you both for your answer, those were exactly what I was looking for.
@RJTK that indeed can be very useful, even if I think I should also first optimize my code and navigation.py

@C1Junaid is this still the case? That we will take extra damage iff our turn takes more than 5 seconds?

Edit: Looks like this is the case, as shown in https://raw.githubusercontent.com/correlation-one/C1GamesStarterKit/master/game-configs.json (described in Much time do algorithms have before timeout?)

Yes it’s still exactly the same

1 Like

To expand on that, it’s exactly the same in that each player gets 5 seconds, with 1 HP penalty per 1 second over (with 5.999 seconds being no penalty). The other player is not rewarded cores for timeout damage, though, which is something that has changed since the referenced thread.

3 Likes

Check with…Python Threading