Code Royale - Puzzle Discussion

By the way, the game seems still unbalanced despite the fix of the knight poping. When I play my own AI against itself, the red player almost always wins with a huge HP difference. Is there any pending issue which could explain that? If so, it would be good to fix it to have stable ranking.

The symetric problem was on 2 things:

  • The units spawn (when a rax create units). The spawn was really asymetric and the 2nd player was clearly behind because most of the time a Knight was created behind the rax. This problem is seems to be fixed.
  • The collisions system is asymetric too. Because the collisions are based on the units order in the referee list. And the order is Queen 1, units for player 1, Queen 2, units for player 2. So for the second queen, she collide with units before her in the list. This is a disadvantage. I don’t know if this problem is fixed.

Is there a way to see or sort your latest battles by biggest outliers? By outliers, I’m referring to instances where you beat someone ranked much higher than you or lose to someone ranked much lower than you.

The first 10 battles or so are those kind of battles as they try to place you in the right range on the ladder.

But the answer is NO

Hello, I get the error : Couldn’t process siteId:

Someone knows why ?

Thanks for your time,


you probably have a space at the end of your output…

1 Like

The map generator sometimes generates map on which some units cannot move. I have an example with a giant in turn 220 :
The solution is to ensure that the distance between the sites is bigger than their radius plus the radius of the biggest unit (i.e. giants).

1 Like

Is it possible to train more than one site in one turn? how?
I have a list of my sites, can I write: “TRAIN”, my_sites_list for train all of them?
Thank you.

print("TRAIN",' '.join(my_sites_list))

this should work

1 Like

I’d prefer this:
print("TRAIN", *my_sites_list)

Did the bots get harder in the post-contest version? I am having a lot of trouble getting out of Bronze with just heuristics and no collision detection.

Multiplayer bosses are almost always stronger than contest bosses.
There are contest legend bots in Ghost in the Cell that are now in silver.

1 Like

Hello all,

I tried to make some code in Bronze League but I wont be able to make defense with barracks knight. Anyone can help me please ? Is there an algorithm or something to make it ?


Knights don’t defend. Only towers and archers do.

And sometimes, the best defense is the attack.

Sorry, I would say the Queen defense (Collision with enemy knight).


I’m facing something strange in Code Royale, but can’t figure if i’m doing something wrong or not.

I’ve been asking to build a mine on the same spot for several turns, but it only work on the few firsts, then don’t do anything more.

Sometimes it stops at the first lvl (Mine lvl 1), sometimes it goes up to 3… even if I keep sending to build a mine on this location, it doesn’t raise anymore.

Did I get something wrong in the mechanics?

The mines have a limited gold rate, named maxMineSize in inputs

The mining rate of a mine can be increased by 1 by issuing the same command as to build it (BUILD {siteId} MINE). However, each mine has a maximum mining rate (between +1 and +5). […]. These numbers will be available for any site whose center is within 300 units from the Queen.

While I’m here, is there any plan to fix the collision asymetry? Or has it been corrected already?

1 Like

I am new to this, and I cant seem to figure out how the siteId works. Because I want to train multiple structures, but I am not able to.

how do i build mines?

you’re in wood leagues so mines are not yet available to you.

I suggest taking some time to carefully read the statement and start from the beginning instead of copy pasting code found on the internet. Might help you to learn C++ :wink: