Spring Challenge 2022 - Bugs & questions

Thank you!

Hello, just a few words to tell you that Scala default code doesn’t compile : line 32 :

            val Array(id, type, x, y, shieldLife, isControlled, health, vx, vy, nearBase, threatFor) = (readLine split " ").filter(_ != "").map (_.toInt)

has to be replaced by this one for instance :

            val Array(id, type_, x, y, shieldLife, isControlled, health, vx, vy, nearBase, threatFor) = (readLine split " ").filter(_ != "").map (_.toInt)

The reason is that type is a keyword of the langage.
Regards.

Why is Clojure not recommended? Do you have some “weird” way of executing it? Should be fine with java -jar on a uberjar. Another way would be GraalVMs native image - not sure about the performance implications of native image.

so yes, that’s a bug in the input : vx and vy should be updated too. We’ll see if we fix it tomorrow or decide to let it as it is.

@Martus that issue has been fixed last week. I guess you’re looking at an old code version. Thanks though

@MarvinTheMartian it’s been several challenges that we’re having timeout issues with Clojure and we’ve not been able to fix it. As this is not a popular language, we didn’t make it a priority.

1 Like

Coding Games and Programming Challenges to Code Better it is possible to damage the opponent’s base using an out-of-bounds spider; please make wind not work on spiders outside the game zone

6 Likes

:wave: Hi to all :slight_smile: ! My friends and i (and maybe others ?) are looking for informations to understand, if available, about scoring algorithm during the contest, and the Team points calculation, please ?
(maybe there’s already something about it in the forum, but i couldn’t find it using some keywords)
+:hugs: Thanks to the CodinGame’ Team to provide us this motivating challenge :+1: !

Sad to hear. Is the code that launches the bots open source? Launching Clojure independently of the game JVM as you probably do with C++ or Rust could be a solution.

Is someone willing to put a JS starterAIs for the noobs like me?

I faced the same symmetry issue
 Replay link turn 189
 not sure why there is an asymmetry suddenly


We’ve released a few fixes:

  • symmetry issue reported by @burnpanck
  • wrong input after control reported by @struct
  • prevent interactions with out-of-bounds spiders reported by @blasterpoard
  • threatFor issue reported by @aropan
6 Likes

Hi using Python3 here and I think there’s a small bug, but it’s really preventing me from advancing further.

I’m on wood1 league and when I try to print the mana (already in the initial code given from input) it shows the opponent’s mana instead of mine
 I see no way of going around this since my own mana is nowhere in the input


It’s inside a loop you are given the health and mana for both players, first iteration of the loop you will get your health and mana, on the second iteration you will get opponent health and mana.

2 Likes

Thanks for the super quick reply! I just figured it out as well, it was written in such a way that it’s overriding the same variable twice so that kinda threw me off


Could someone explain me the off-by-one position error I have on the mob #18 (the one my top blue hero is chasing)? The given x velocity remains constant for the three turns, i.e. 398, while the actual velocity is 399. Since velocities are normalized then truncated, the position at next turn should be the position at previous turn + the velocity at previous turn when there is no wind nor control. Am I missing something?



You have not specified in the description that a hero cannot cast a spell (for instance a shield) on himself.

But it can cast spell on himself, unless shielded

These need truncate(). It may be the cause of this comment.

3 Likes

hum, you are right. That mob just got pushed out of my base, its speed has been randomized but not correctly truncated. So the referee sends me the double values downcasted as integer while it uses the real values to move the mobs.
I guess I’ll allow a ±1 offset in my validation tests ^^.
Thanks :-}

1 Like

C’étĂ© 100ms au dĂ©but puis 50 en Argent, je venais parlĂ© de ça c’est juste n’importe quoi, ont passe son temps a essayĂ© de grattĂ© 2 ms au lieu de codĂ© de la stratĂ©gie et vrai IA :confused: C’est completement dĂ©bile.

Surtout que l’époque d’optimisation de code c’étĂ© en 1970, j’ai fais un DUT & License et il doit y avoir a peine 1% de mĂ©tier de dĂ©v qui nĂ©cessite des optimisations aussi Ă©norme. (Coding Hardware gĂ©nĂ©ralement).

SĂ©rieux faut arrĂȘtĂ© :confused: En + vous avez pris en compte le temps de travail de vos serveurs avec tous les scripts combinĂ© ?? Sans comptĂ© que certains langage sont censĂ© ĂȘtre multi-threadĂ© (comme le C#que j’utilise). Et du coup ont peut mĂȘme pas utilisĂ© un try-catch ou des fonctions de Math / List :confused:

C’est plus du coding d’IA là mais du pinaillage de milisecondes
 Et des code d’IA de gaming qui mettent - de 50ms j’aimerai voir si ca existe seulement :smiley:

It’s always been 50ms in the code of the referee for every leagues but was mistakenly written as 100ms in the :fr: subject and was only fixed recently.

Most gaming AIs share the 33ms for 30fps or 16ms for 60fps along with input, rendering and the myriad of things a game have to do every frame :sweat_smile:

2 Likes