Skip to content

J35P1N/Codingame-Challenge-Summer-2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Challenge Overview

This is a league based challenge. For this challenge, multiple leagues for the same game are available. Once you have proven your skills against the first Boss, you will access a higher league and extra rules will be available.

NEW: In wooden leagues, your submission will only fight the boss in the arena. Complete the objective specified in each league at least 3 times out 5 to advance to the next league. Goal Win the water fight by controlling the most territory, or out-soak your opponent! Rules

The game is played on a grid.

Each player controls a team of agents.

Each turn, every agent can perform one move action and/or one combat action.

Agents🔥

Agents are the player-controlled units on the field. They possess attributes and actions.

Each agent has a wetness meter, which goes up when getting attacked by enemy agents. Once an agent’s wetness reaches 100, they are eliminated and removed from play.

Agents also have a set soaking_power and optimal_range. The power indicates how much wetness they normally deal, while the range is used to apply a penalty if the target is too far.

Up to the optimal_range, shooting deals 100% of their soaking_power.
Beyond that, and up to twice the optimal_range, shooting only deals 50% of their soaking_power.
Beyond that, the shot fails.

Note: All distances are calculated with the Manhattan formula.

Each agent also has a shoot_cooldown, which is the amount of turns they must wait after shooting to be able to SHOOT again. They can still use other actions in the meantime.

In addition to shooting, each agent has a set amount of splash bombs that they can throw. The amount is determined at the start of the game and can differ between agents.

Actions🎬

On each turn, you must output one command for each agent that you control. Each command can contain several actions; at most one move action and one combat action.

You can instruct the actions in any order you want, but the execution order will depend on each action’s priority; see the Action order per turn section for more details.

Moving is done with the MOVE x y command. With it, the agent will attempt to move to the location x, y. If the target location is not orthogonally adjacent to the agent, then they will attempt to move towards it using the shortest valid path possible. If the action results in a movement on a tile with a cover or another agent on it, the movement will be cancelled. If agents collide while attempting to MOVE, their movement will be cancelled.

There are several combat actions available:

SHOOT id: Attempt to shoot agent agentId. This will deal wetness according to the optimalRange and soakingPower of the agent, and is reduced by any damage reduction gained by the target agent (see the HUNKER_DOWNaction and the Cover section).
THROW x y: Attempt to throw a splash bomb at the location x, y. Splash bombs can only be thrown at a maximum distance of 4 tiles away from the agent. They deal 30 wetness to agents on the tile it lands on and to all adjacent tiles (orthogonally and diagonally). This action ignores damage reduction from covers & hunkering.
HUNKER_DOWN: Hunker down to gain 25% damage reduction against enemy shots this turn. This can be stacked with cover bonuses (see the Cover section below).

See the Game Protocol section for more information on sending commands to your agents.

Cover🛡️

Each tile of the grid is given to your program through the standard input. For each column of each row you are given a tileType. It can now have one of three possible values:

0 an empty tile.

1 a tile containing low cover.

2 a tile containing high cover.

Tiles with cover are impassable, and agents will automatically path around them when perform a MOVE action.

An agent that benefits from a cover will gain damage reduction against enemy shots. Low Covers provide 50% protection, and High Covers provide 75% protection.

For instance, an agent within optimal range and a soaking power of 24 will only deal 6 wetness to an enemy behind High Cover.

To benefit from a cover, the agent must be orthogonally adjacent to it, and the enemy shot must come from the opposite side of the cover tile. The cover is ignored if both agents are adjacent to the cover.

In the case where multiple covers can be considered, only the highest cover will count.

Examples: An agent orthogonally adjacent to the left side of a low cover. Shooting this agent from a green tile will result in damage reduction. In the case where a shot can be affected by two covers, only the highest one counts. An agent that is not orthogonally adjacent to any cover, thus not benefitting from their damage reduction. The orange agent benefits from a low cover while the purple agent does not benefit from any cover. Neither of these agents benefit from the cover from each other since they are both adjacent to it.

Note: Hunkering down stacks with cover, which means the total protection gained from both taking cover and hunkering down is 75% or 100%, for low and high cover respectively.

Points📈

You gain points by taking control of tiles when you control a larger area than your opponent.

Any tile that is closer to one of your agents than to an enemy agent is considered to be under your control. However, if an agent has wetness greater or equal to 50, the distance to that agent will be doubled during this comparison.

Each turn, if you control more tiles than your opponent, you score as many points as extra tiles that you control compared to your opponent.

Action order for one turn🎬

Game turns are synchronous, for both players and agents (meaning all agents perform their actions at the same time). However, some actions have priority over others:

MOVE actions go first,
Then HUNKER_DOWN actions,
Then SHOOT and THROW,
And finally, the removal of any soaked agent.

Victory Conditions

The winner is the player who fulfills one of the following conditions:

Reach 600 more points than their opponent
Eliminate all opposing agents
Have the most points after 100 turns

Defeat Conditions Your program does not provide a command in the alloted time or one of the commands is invalid.

Disclaimer by the author

This solution requires the Codingame interface to actually run and therefore this Repo is more for preservation of my highest scoring solution rather than aiming to be a runnable solution.

All logic with the solution remains un-altered from my final submitted solution however, as Codingame requires all code to be submitted in a single file, I have since broken the project into seperate folders and files for readability and have added comments.

Please bare in mind, that this code was developed in the context of a competition and is not designed to be production ready. It needed to be iterated on quickly in order to score higher than other players and therefore does not reflect the usual way in which I would develop a production ready .Net application.

Final standings

Final standings at the end of the challenge were as follows: final-standings

About

Codeingame summer 2025 challenge submission

Topics

Resources

Stars

Watchers

Forks

Languages