XMash Rush - Bugs


#1

Use this topic to report bugs or remarks about the Xmas Rush challenge.

=> https://www.codingame.com/contests/xmas-rush

The referee code is publicly available on Github

=> https://github.com/CodinGameCommunity/XmasRush

Special thanks to the creators (Chimney42, Iuliia, rnkey, Tzupy)


XMAS Rush Help
#2

The referee code is publicly available on Github

=> https://github.com/CodinGameCommunity/XmasRush

Is it allowed to use referee code in our solutions? For example, to simulate consequences of actions? E.g., GameBoard.java seems to have some very useful methods…


#3

Hello! I am trying to play the XMAS Rush game. I know a little bit of Python, Java, and JavaScript so I tried it in these languages. I am having trouble getting anything to happen. I am not trying to ask for solutions, but every time I write a short program I get an error message. Is there some sort of starter code I could look at (like to make the AI push a row and move forward 1)? I guess I don’t understand how to format it into a print command, and how to separate my code between the two turns. Any help is appreciated. Thanks!

EDIT: Never mind, I just realized that I had indented improperly and my code was a space to the left of the while True… Now I just have to mess around with it a bit to make stuff work. :wink:


#4

Yes you can


#5

Statement error:

  • Integer itemName: the item’s name.
  • String itemPlayerId: the id of the player the item belongs to.

I do believe these should be the other way around :slight_smile:


#7
Victory Conditions
You complete all your quests before your opponent.

I got my last item before my opponent?

Is this intentional?


#8

it is intentional indeed.
completing quests on the same turn is not before.


#9

Having the first player to reach his/her last quest win would reduce the amount of games with equal scores. :slight_smile:


#10

certainly, but would be unfair to those who have to travel across the map to get their item as opposed to those having it nearby, coz it’s still the same turn.
i got your “path optimisation” argument, but the probability of this rule changing is close to negative infinity.
whereas the probability of specifying what “before” means in the statement is much higher.


#11

I’ve tried building a Xmas Rush bot in Clojure and I’m seeing erratic behavior: a lot of games are lost in the first turn with my player timing out.

I’m relatively certain that it’s not my code (ha… ha… ha…), because in those games I’m not even seeing a debug message that my main function was invoked. Also replaying those games in the IDE shows that the player did not timeout and in fact played for many turns.

I have two suspicions, maybe:
(1) the Clojure compile/build/run is not completing before the 1s turn timeout?
(2) there are issues with flushing stdout/stderr to the runtime?

Perhaps someone could shed some light on how the Clojure version is built or maybe with access to game logs could tell me there is something else going on?

Example replay: https://www.codingame.com/replay/357350715


#12

My Scala code just stopped working. The problem is packages. Below is a minimal (not-) working example (no spoilers, just the bug and a stripped down version of the template). I use packages in my code to break up my code and simulate multiple files. It used to work (and code like this still works on other puzzles. I just tried similar code on Smash the Code.) Was there a recent change to the Scala setup?

package myPackage {
    class MyClass() 
}

object Player extends App {
    import myPackage.MyClass
    
    // throws error: java.lang.ClassNotFoundException: myPackage.MyClass
    val a  = new MyClass() 
    

    // game loop
    while(true) {
        readInt
        for(i <- 0 until 7) {
            readLine
        }
        for(i <- 0 until 2) {
            readLine
        }
        val numitems = readInt
        for(i <- 0 until numitems) {
            readLine
        }
        val numquests = readInt
        for(i <- 0 until numquests) {
            readLine
        }
        
        println("PUSH 3 RIGHT")
    }
}

#13

One work-around seems to be to replace package abc with object abc. This isn’t quite as easy for me since I also use, say, package abc.xyz a lot. This needs to be replaced with something like, say, object abc_xyz (and then import abc.xyz.Foo needs to become import abc_xyz.Foo.


#14

Some replays are broken, for example: https://www.codingame.com/replay/357651021
When you look at the JSON, it’s missing “agents”, “ranks”…


#15

The broken replays should be fixed (as in no new ones should appear anymore).


#16

I get some crashes in submits that I can’t reproduce in the IDE with the same code version. (My code uses some random but with a fixed seed, so that’s not the source of the difference.) Apparently, I don’t get sent all of the input sometimes, causing me to timeout between my prints “start parsing” and “end parsing”. An example match that I lose in the submit but not in the IDE is here. Can some CG staff please help me understand what’s going on, and correct the bug if it’s on your side?


#17

I’m using Javascript for this contest. It appears that something triggers code execution to stop for milliseconds at a time (I’ve seen anywhere from 3 ms to 16ms). This typically happens whenever a new variable is being assigned. E.G:

_subRecords.push((performance.now() - _thisStart).toFixed(2)); // 0.00 ms elapsed
var _FSCvisited = new Int8Array( connectivity.length ); // connectivity.length = 49
_subRecords.push((performance.now() - _thisStart).toFixed(2) + " ("+connectivity.length+")"); //8.33 ms elapsed;

Simple functions will randomly take many orders of magnitude more time than usual due to this issue. This frequently results in a complex function that regularly takes 0.8ms to execute taking instead 30ms and causing a timeout.

Not even telling my code not to start any additional AI code after 25ms of turn-time is enough to prevent timeouts.

I doubt anything can be done about it, but I thought I’d share these details I learned for anyone else who is using javascript. I’m not sure if it’s because the cpu/ram is overworked or if it’s simply how javascript always executes… but it sure is maddening.

P.S. I’ve lowered my threshold to 20ms (e.g. I only try to use 20ms of my 50ms turn) and it seems like I get less timeouts, but they definitely still happen:


#18

Santa Claus (silver boss) got timeout

And seems (i’m not sure) his moves is not determined - when I use “Replay same conditions” button, I have got different results (my bot is not using any random stuff)


#19

The most probable is that the garbage collector is triggered.


#20

Wow gold boss got timeout too