Fall Challenge 2020 - Bugs & Questions

You have to start your timer after reading the first line of input. Otherwise you time a lot of other things (opponent, referee and what not) too.

2 Likes

If I start my timer after, it still times out. The time to read the input is still counted against my time limit. Other challenges have not had this problem.

And I’m pretty sure that the bug is in your code. An infinite loop or taking too long in some cases. You won’t see the stopwatch result for the turn taking too long, as the process gets killed before you can print it.

I have my time limit set to 5 ms, verified by error console logging. Code runs fine in Play Code mode (many times). Fails when submitted (most of the time). Not sure what else it could be. I’ll look at it again tomorrow. Thanks.

Heh … the only ones I win are the ones where my opponent fails first. :wink:

Tried limiting to 1 ms (about 100 turn simulations), still fails on Submit. :confused:

I see some Rust bots at the top of the leaderboard which implies that it’s somehow related to your bot.
On the other hand a bot that only crashes in the arena but not the IDE does sound like a bug. The arena code is in release mode while you have debug mode in the IDE.
Sounds like a job for @TwoSteps to have a closer look.

You should measure time AFTER the first input.
Otherwise you count enemy’s turn time as well.

@eulerscheZahl currently you can win using timeouts. So probably those Rust leaders [ab]use it.

@tutubalin I know, see my post from above where I reported the issue and which was repeated by BorisZ. But looking at the replays, there are Rust bots playing just fine.
My own attempted to abuse the bug ranked at the bottom of the league :frowning:

I have the exact same issue with my Scala bot.
When I submit, I get 12 wins (wood 1…), then 90% of my games fail with timeout.
Any lost game I try in IDE mode I win with no timeout.

The logic is still very simple in my bot and does not involve any randomization.

I remember there was the same issue in past contests and something was fixed on CG side.

Well the bonus is available only 4 times, so you kinda need to know when your opponent brewed the first order and decremented that counter. Otherwise you would not know that it is not available anymore.

Small bug in the referee summary outputs: when a potion with an urgency bonus is completed, the price displayed in the message does not include the bonus.
See for instance https://www.codingame.com/replay/500171328, frame #22, potion #60 is first and gets a 3 rupee bonus, so the earning is 18, but the summary says:

Bob learnt spell 24
Default brewed potion 60 and earned 15 rupees
They have now brewed 2 potions. 

Hpwever the scoring appears to be OK, only the summary is wrong.

Maybe something is wrong with the release version of the code? My Submitted code can only manage 3 simulated moves before the timeout, during 50 ms turns. Runs fine in IDE. On the second turn, I output a message after each simulation. What is weird is it simulates ~150,000 easily on the first turn.

Without knowing opponent outputs, How can we keep track of how many potions he already brewed?

Thank you for reporting bugs. I’m keeping track of them in the original post. We’ll deal with them today (for most of them)

1 Like

Keep track of the potions ids available, if the first one changed, you know it has been brewed.

My point was: AI that crashed should lose, doesn’t matter how it got its score.
Otherwise there is easy-to-use hack: track scores, and if my score > opp score and opp can not brew something now then make timeout.

1 Like

Sometimes, player spells disapear from the viewer. It seems to happen after Learn action and to only affect the viewer because a can still see the missing spells in the turn input.
You can see it between turn 11 and 12 in the following replay: https://www.codingame.com/replay/500185601

I can’t reproduce. Unless someone else can confirm a problem with the stub in Python, I think we can remove it from the list of problems to fix.

1 Like

Okay guyz, sorry for being a newb, but I have a huge problem on my hands. I am working with C. I downloaded the github repo for the fall challenge. Maven got all the dependencies with just 1 warning.

Running the server and replacing the BasicAgent with a command line for my C program, just doesn’t work. And it is verbatim the code running in the online IDE, that I compile with GCC locally.

I can interact with my program just fine at the command line. For example I can copy-paste the output of the referee (I think it’s the one giving us input I think…) and my program just goes on and says the BREW 71 (since with this seed we got a full inventory at the start ?).

Anyway it makes no sense to me, why Java would not be able to launch the process (it seems he does in fact) but not receive any output. I even added an output to stderr just after “int main()” to check that something happens but when I start the whole thing, it says my program is silent (and therefore times out).

If I knew the codingame game engine better I might be able to figure something out, but it’s my first time using it… help ? Also I am under Windows, MinGW-w64, GCC 10.2.

public class Fall2020Main

gameRunner.addAgent("C:/dev/codingame.com/fall-challenge-2020/game.exe");
gameRunner.addAgent(BasicAgent.class, "Koume");

I came across an issue where the visual crashes when learning the top tome spell for the second time. This doesn’t happen when I do the same testing with the 5th tome (index 4).
I was trying to figure out whether the tax of learning (e.g. -3) is subtracted before obtaining the tax of the learnt spell (e.g. +2).
The text seems to imply that you first get the tax (+2), with extras discarded, and only after you pay the tax (-3). However, it looks like the excess is temporarily kept outside the inventory to pay for the tax.

Edit:
To elaborate on the visuals crashing; It is stuck in a REST (performed before learning the spell), all spells are gone, as well as all recipes. The tome still shows the tome spells.

Edit 2:
The visual glitch does not appear to be caused by learning the top tome spell. I only get the glitch (repeatedly) with specific conditions. However, I do not know what those conditions are. If requested I can provide all input data for the round where it glitches.