Spring Challenge 2023: Ant Movement Frustration

Am I the only one that is getting very annoyed at the built-in ant movement in this challenge? This contest seemed like it was going to be a lot of fun, but it is quickly becoming a nightmare with how imprecise and inconsistent movement has to be. This replay is a great example – at the end of turn 3, up to symmetry, my situation and the opponent’s situation are exactly the same, and we give exactly the same commands… but the way my ants and their ants move is completely different. Does anyone have an explanation for this or literally anything I could do to avoid getting screwed by the movement system? I thought that the intent of the challenge was not to struggle over these “simple” details that are supposed to be computed for you, but maybe I was wrong.



I am also frustrated with the phenomenon, as also some other people who posted other instances of the pathfinding big in the forum.
Hopefully some fix or workaround should be made, otherwise the competition would be just reverse engineering of the pathfinding and creating custom, weird input, just to make the ants actually go where you want…


I have a suspicion that even if we parse the provided LINE outputs into their BEACON parts we are still not guaranteed to have our ants move symmetrically depending on how the judge distributes the ants from a hex to a beacon. So don’t waste time on it and rather try focus on improvements in AI logic.

If for example the same algorithm is used for both players (think starting at neigh0 and ending at neigh5), in certain cases with many lines there will be an anti-clockwise weighted distribution for both players on each hex which already breaks the symmetry.

They would need to fix it on this example (one player from 0-5 anti-clockwise and the other from 3-4 clockwise) and on a few other levels before they can get a true symmetry going. Will it happen in the 7 and a half remaining days, who knows?

So I’m not the only one frustrated with this :smile:
At first I was super happy for the challenge to provide a basic pathfinding (since it is a repetitive part present in most coding game challenges). But upon realising how non-flexible it was, and that you could still have substantial gains by reverse-engineering the best beacons to mitigate its slowness, it stroke me as an added complication, not conveniance. Also see:

You are not alone :slight_smile:
Now I agree with you @Terios but it is frustrating anyway … and of course, it seems that most of the time, it is in my disadvantage :slight_smile:

1 Like

what is he waiting to split ? I don’t understand the logic. it say it will find the fastest way, but it is illogic paths.


Has anyone figured out a way to precisely control the ants? Looks like this issue isn’t getting fixed.

It’s not a bug it’s a feature :wink: Part of the challenge is to figure the best way to “control” your :ant:

Yeah, maybe it’s a feature. But for me it seems as if you came to an on-site programming challenge and all the keyboards suddenly have their keys randomly permutated. Of course, you still can write, but it will be much more uncomfortable. Needlessly uncomfortable. It’s a kind of an additional challenge, for sure, but not that kind which I do like about programming challenges.

It’s actually more realistic. You don’t control the ants, you control how many pheromones you put on each cell to attract them. You can’t expect ants to react exactly the way you want. We already had a lot of contests in the past where we could control everything and simulate exactly what will be the impact on the game state. It’s not like only one player is impacted by it. It’s fair for everybody. And, even if it’s difficult and not perfect, you still can implement a logic to have more control on the ants after analysing how they move (SpringChallenge2023/AntAllocater.java at b604cd8c0f58358ebe7b1b00b0f3455a0d311364 · CodinGame/SpringChallenge2023 · GitHub)

1 Like

It’s actually more realistic.

It isn’t. I see sometimes such a situation: two adjacent beacons has equal strength and one of them has 5 ants, but another has 0 for a couple of turns. Totally not realistic.

It’s not like only one player is impacted by it. It’s fair for everybody.

Yeah, I’m not telling it’s unfair. It just leads to a degenerative situations where people win not because their strategy is good, but because they are better on reverse engineering of game engine. Nice contest too, but not in “bot programming” section. I mean, if you can’t get even approximate logic from rules and need to read source codes of the game engine to understand how it works - something is wrong.

I totally agree with zuko3d.
Look at this match: Coding Games and Programming Challenges to Code Better
Turn 79
My logic is still pretty basic… I use a LINE instruction from my base to the crystal cell at bottom right.
But no ant goes to the crystal cell!.
There is an egg cell on the path that seems to stop them or extremely slowing down them
I tried to increase the beacon strength over time, and it seems to improve a little better but it’s still very buggy IMHO. Did I miss something in the rules ?

1 Like

It’s because of the way they implemented the AntAllocator.

Check the turn 58 (sorry I use the opponent as example). You have 4 beacons with the same strength with 24 ants. The allocator will try to put 6 ants per cell. But, the algorithm they decide to use is not the more logic for what we expect.

Here is a summary of how it works (it’s not exactly that, but for explanation purpose I did some shorcuts):

  • It will first check the number of ants on each cells that have a beacons. If the strengh of the beacon is equal or greater then the number of ants on this cell, all the ants already on the cell will stay there and will not be used in any other movement.
  • If some ants are “free” to move because is as more ants then the beacon strength, they will try to go to the nearest cell that still needs some ants until all ants know where to go.

So 6 ants will stay on your base. The 2 others will move. The 8 ants on each cells below will move up because they don’t have any beacon on their cells.

Next turn, 6 will stay on your base, 6 will stay on the cell near your base. The 4 remaining one will move on the cell with the eggs. The 8 ants in the lower cell will move up.

Next turn, you have now 28 ants, so it will try to keep 7 ants on each cell. 7 ants stay on your base, 7 ants stay on the cell near your base, 4 ants stay on the cell with the eggs. Then, the 3 free ants on your base will move to the cell near your base. The 7 free ants on the cell near your base will move on the cell with the eggs. The 4 ants already on the cell with eggs are not free to move so no ant will go on the crystal cell.

Next turn you have now 35 ants. Now it will be 8 or 9 ants per cell to keep. 9 will stay on your base, 8 will stay on the cell near your base, 8 will stay on the egg cell. The 5 free ants on your base will move to the cell near your base. The 2 free ants on the cell near your base will move to the egg cell. The 3 free ants on the egg cell will move on the crystal cell.

By realistic, I mean, in reality you can’t control everything. They decided that if ants are already on a cell with a beacon, they will not move except if the strengh is lower than the number of ants.

So if you have 10 ants and you create two beacons with 5 as strength and 5 ants are on one of those 2 beacons… and the 5 others are at the other side of the map… no ant will move between the 2 cells, because it’s the 5 ants at the other side of the map that will move to go in the other cell.

I must agree that the rules should have been more explicite on the ant movement logic. For me it’s more a problem of rules redaction.

People expect the ants to move in an optimal way, but it’s not the case.

1 Like