Code Royale - Puzzle Discussion

Hi,
Is it possible to play this against friends? So we can write our own bots and get them to fight each other?

You can, in a limited way. You ā€œDELETEā€ the boss and add your friendā€™s bot. There isnā€™t a way on the CG platform to play hundreds of games continuously and automatically against just your friends though.

1 Like

It is kind of hard because It has advandced outputs though

Lost my time writing code, then i find out site_id return even though iā€™m not close to the site never show (-1)
Iā€™m really pissed off.
I only started today (with C language)
I can provide logs.

The number of bugs in this game with C is so damn high:

  • cant dĆ©bug using fprintf(stderr ā€¦ nothing shown)
  • the return -1 on id when iā€™m not near anything is not working
  • cant get queen position ā€¦
    How am I supposed to resolve this if i cant monitor essential data

In wood 2 league how opposite person can built multiple towers and multiple barracks. Please can anyone help me how can I built multiple structure.

Has anyone figured out what param1 and param2 mean on towers?

All inputs are explained in the statement.

So they are! Slapping myself for ā€œnot reading the instructionsā€ but I got pretty far just guessing at the less-obvious inputs.

Where is MSG command or option to append text to a command? :wink:

  • param1:
    • When tower: the remaining HP
  • param2
    • When tower: the attack radius measured from its center

hello i wanted to know where to find the training time of each units

Hi !
Iā€™m having an issue with this game as Iā€™m really having a hard time climbing the ladder.
Everything seems to be working properly and my algorithm looks pretty decent, however, when I send it for testing in the Arena, I keep losing a few matches, that when I look at the replay Iā€™m not supposed to be losing ?

Like when I check the short replay it cuts in the middle and gives me a loss, but when I send the replay to my IDE, it shows in full and I win pretty easily. Because of this my score keeps getting low and I canā€™t seem to get out of Wood 3 as Iā€™m losing way more matches than I should be.

I donā€™t know if thereā€™s something I donā€™t understand or if thereā€™s a problem somewhere ?

Thank you !

Maybe you changed your code after submitting to the arena?

You may also share here the replay links (i.e. 2 links) of an example where you lose in the arena (thatā€™s 1 link) and where you win in the IDE (thatā€™s the other link).

After checking a bit more, I realized I lose because I get timed out apparently.
Is this happening because my code is taking too long to process ? I donā€™t see a reason why it would take longer after x turns and making it timeout but itā€™s the only explanation I see.

There are many possible reasons for a timeout. For example, your code takes too long to output something, or the code where you output your answer is never reached (e.g. because a condition is never satisfied, or a while loop is never broken).

Hi ppl, can somebody explain me how can i get the radius from the sites

i want to make a loop to determine which one is the closest to my queen but i donā€™t understand the syntax i need to compare each sites radius.

Note that i donā€™t want a solution for the loop, just a little help to get radius variable

Am trying code royale, and i know that i want my queen to go on the nearest site to build stuff
but i donā€™t know how to get its location :'/

If I remember well, you get X and Y coordinates of all sites, and of your queen as well. You can calculate distances between queen and sites and based on that see which site is closest. (By the way, sites have radius as well, so you might want to use distance to center minus radius of that site)

really dumb feature idea: new command ā€œMESSAGEā€ makes the queen say something above it in a text bubble