Ocean of Code - Bugs

Hi,

If I am not mistaken there is an issue in the input format in C, in the map, to check this I did reset my code to the basic one, then used fprintf stderr the lines of the map, and it only read every other line. I put two screenshots there : https://imgur.com/a/D2xNTWr https://imgur.com/a/m1Nyity

Thanks :slight_smile:

@AlWerewolf
You have to start your timer after reading your first line of input and stop it before printing your action. Otherwise you stop all kind of other things (referee, opponent bot).

@JBM
Thank you very much for your efforts.
It would be much easier if you do a real pull request on github or at least share your final statement instead of the diffs. There’s a probably a tool or a feature of a tool that I don’t know but to me it looks like a lot copy-pasting of single lines.
I can’t promise how fast we will update the statement, as only CodinGame can update the contest.

@MiniWolskys
You are right, the lines aren’t fully parsed in the first run, so the second run gets the linebreak. Try to read one more character with char line[width + 2] and fgets(line, width + 2, stdin).
I’m not sure if I should see this as a bug in the game or the code generator.

They’re git format-patch diffs. You just git am them. :slight_smile:
Sharing the final state is easy enough, but it wastes the rest of the commit history information :angry:

Out of the git world, the standard tools for this kind of work are simply diff and patch.

(and you’re making me notice I deleted the first character in the first one. sigh updating patches now.)

1 Like

Hello.
There is one performance issue. It may be connected to the framework/site itself, not this particular contest.
Here is a replay (open with caution): https://www.codingame.com/replay/443561978
It puts heavy load on a cpu. It plays at 6 fps on x10. But even on x1 it lags significantly every turn, though it tells me about 40 fps. Other replays don’t behave like that, I have 60 fps on x10 in every other.

My guess is that it struggles to render the result of “MSG …” command of another player.

2 Likes

And here’s the second patchset and resulting template.

  • Factor an Explosions paragraph
  • Clarify win/loss/SURFACE conditions
  • Fix some invalid HTML

/cc @eulerscheZahl @Illedan @G-Rom

Sorry, what games are we saying?

Hello!

Commands like:
MOVE N | SILENCE W 3
or
MOVE S | SILENCE N 0
are valid?

Yes, you can do any action at the same turn as long as it’s separated by a ‘|’

The question is, rather, how honest are these actions?
For example, the option (“MOVE N | SILENCE W 3”) to go 1 up and to the 3 left (in one move) I can still understand.
But the second ( “ MOVE S | SILENCE N 0 ”), when you go down, and then give the command to move in the opposite direction(up) at 0 cells, I no longer understand

But I can do this and it will not be considered cheating? I apologize for my “English”

Why would this be cheating? It’s part of the game and would be easy to catch in the referee if it wasn’t allowed.

Makes it easier for you to eliminate that move. I call it shooting oneself in the foot.

@Illedan, @eulerscheZahl I am facing the same problem here, 40ms when reading the first line, so the timeout becames only 10~20ms with this kind of input, are you guys fixing this?
I am using c++ and already tried fastIO

I found out the problem was on my side, not the games. There was a bug in my code that was crashing it but didnt report an error.

was it crashing and you receive timeout?

I found too the error that crash my code, thanks

Are there some missing error tooltips?

I had a timeout bug, but it wasn’t due to taking too long to respond, it was caused by trying to access an index larger than the array.

So your bot crashed? The referee can’t know what happened. Just that you didn’t respond anything within 50ms.

that`s exactly what happened to me, the message did not help at all

If it’s just timeout then it tells you it’s due to timeout in the bottom left of the IDE.

But here it gave me no error message and the tooltip was just a basic timeout.

Also I remember it a bit differently from other CG games, it used to be more detailed from what i remember. Weren’t some of the errors supposed to caught by the referee and then printed as text in the bottom left? Maybe CG staff know something about this?

Not sure it my problem is a bug in Ocean of Code or just timeout errors in general. Currently, I’m having my AI play against itself on this challenge. The two AI codes are identical. Why would the first player be allowed to move the the second player be punished with a time out error if both are making the exact same moves? (You can watch it here Coding Games and Programming Challenges to Code Better) I’ve tried using python3’s time.time() and I understand that the timeout error is caused by my poor coding somewhere. Is it a bug that the timeout error is almost always given the the second player more often than the first?

edit: when checking the time I’m see discrepancies of up to 20ms between one player and the other. If the game are only give 50ms to complete a turn how can those tolerances be managed?