Coders of the Carribean - Bugs

I observed that sometimes a reward barrel is created when a ship is lost. But this is not mentioned in the statement. Is there something missing?

Missing information in the statement. I will update the statement, sorry.

1 Like

no problem thanks!

I see that two barrels can be placed on same coords. Is it bug or feature?

I’ve fixed a few bugs in the Refere, I’ll will push them on github.

Regarding the rewarding rum barrels: when a ship is destroyed, a barrel is created with the amount of rum it had before the impact of the mines and cannonballs (up to 30 units).

I will update the statement to add this missing piece of information.

1 Like

I’ve fixed it: now you can put “MOVE -1 7”.

When we fire on a place with two barrels one of the barrel doesn’t explode https://www.codingame.com/replay/207014949 frame 74

Dear Codingame team,

Check how the rum amount drops suddenly to zero close to the end of replay:
https://www.codingame.com/replay/207095093

Is this a bug, or I’m missing something?

Since you’re Player 1 we can’t see your output, but it was invalid (or a time-out). I guess it is related with the fact that there is no barrel left on the map. Check your code to see what you output in that case.

Yes, it was a timeout.

Timeout: the program did not provide 1 input lines in due time… sirnornur will no longer be active in this game.

Thanks for the reply and sorry for the question.

It shouldn’t be possible to have two barrels at the same location now. Thank you.

I noticed that it’s possible for two ships to get forever stuck:
Check frame 98 of https://www.codingame.com/replay/207416715
I’ve attached a link to the commands issued just before the stuck situation below (since I can’t upload to here directly)
check http://imgur.com/a/eGNCU (The remaining commands are the same so I didn’t attach the rest)
Let me know if the link dies.

@PED came up with a replay showing a little (but important) bug in the engine :
https://www.codingame.com/replay/207498334

At frame 31->33, ship 4 should take damage from the explosion of the nearby mine triggered by ship 0, but doesn’t. We tracked the bug to be in rotateShips : https://github.com/CodinGame/coders-of-the-caribbean/blob/master/Referee.java#L1050

In this loop, you turn the current ship, then check the collisions with mines. In our case, ship 0 is in the collection before ship 4. So what happens is that, ship 0 is effectively rotated (newOrientation = orientation), then mine collision is checked -> The mine spreads damage around, but since ship 4 has not yet been rotated and that the spread is only tested on the current orientation, the damage is not dealt.

An easy fix would be to : first rotate every ship, then check for collisions.

4 Likes

I think that the angle method of the class Coord in the referee source code is wrong in some cases.
For example:
Coord p = new Coord(0, 1);
Coord t = new Coord(1, 2);
p.angle(t) is 5.5 but it should be 5

Hello, The bug reported by Aveuh on rotateShips also occurs, exactly the same way, in moveShips too.

2 Likes

Hello, I have strange bug - my ship in turn 4 at the position (9, 3) with orentation 2 and speed 0, so I give command “MOVE 9 2” in turn 6, but insted to go forward, I go STARBOARD… at the result I can’t to reach point (9, 2)
https://www.codingame.com/replay/207866310

Please tell me if someone have any ideas.

Just a typo and not a bug but in Referee, the Cannonball constructor refers to row, col, but gets passed x, y. The var names should be either swapped to col, row or renamed to x, y.

public Cannonball(int row, int col, int ownerEntityId, int srcX, int srcY, int remainingTurns)

A tooltip bug in the player:
when you watch a match in the IDE (with a smaller player) and collect a barrel at the bottom of the map, the tooltip without the barrel might fit below the cursor. With the barrel it doesn’t. So tooltip will be shown.

You can reproduce that with frame 16 of this replay:
The tooltip for ship 4 is shown properly. When playing with the zoom, the tooltip will no longer fit below.

Thanks, does this look correct to you https://github.com/CodinGame/coders-of-the-caribbean/commit/045d4cd6cb24aa18b25da538c784dcab7771bf72 ?

2 Likes

Yup ! Should do the trick :slight_smile: