Hide and seek

Hide and seek

> Programming

The purpose of this algorithm is to find the cells where the opponent will have no line of sight on you, even after moving.

You will usually hear this algorithm called "Hide and seek", or "Cache-cache" among French-speaking players.

Usage

Hide and seek is one of the first methods that will let you manage your moves more effectively.

If your leek hides behind an obstacle so that the opponent cannot reach it, the opponent has no choice but to use a roundabout method, such as Spark, which hits through obstacles, or AoE attacks.

Principle

The method usually used to find the cells where you will be hidden relies on the accessible cells algorithm.

So the first step is to get your accessible cells, to know which cells you can move to, and therefore potentially hide on. But also to get those of your opponent (or opponents), to know where your opponent can go, and so find a cell where they won't be able to reach you, even after moving.

Then you need to determine which of the cells your leek can reach are "safe". To do this, test each of these cells and check the lines of sight with the opponent's accessible cells. If there is no line of sight between a cell and those of the opponent, then the opponent won't be able to target that cell, even after moving.

So the idea is to start from the assumption that a cell is "safe", and try to prove otherwise. You then test each of the opponent's cells as long as there is no line of sight. As soon as a line of sight exists, it means the opponent will be able to reach that cell. You can of course refine this and compute a "danger" score for each candidate hiding spot in order to pick the least bad one, for example by not leaving the opponent the chance of a straight-line shot with the M-Laser.

Green cell: your leek / Red cell: opponent / Blue cells: the opponent's accessible cells Green line: no line of sight / Red line: line of sight