Skip to content
#348
Auto-translated
Algorithm for constructing a path for a squad from point A to point B

0.1. Take a screenshot of the battlefield (grid, snow) with a minimum number of obstacles and squads (without war machines).

0.2. Print it, take a pencil and eraser, draw all sorts of obstacles, and also select point A and point B.

First stage.
1. Hex A is assigned the label 0.
2. All adjacent free hexes are assigned the label 1.
3. Continue numbering the hexes until hex B receives its label (the label is the distance of the hex from hex A).

Second stage.
Let's say, for example, that hex B received the label 9.
4. Among the hexes adjacent to hex B (the destination), select those that have the label 8.
5. Among the selected hexes, we will be interested in the hex with the highest priority:

--4--3--
-5----2-
--6--1--

For example, if the upper right and lower right hexes have the label 8, then we choose the lower hex, as it has the higher priority of 1 (and the upper right only 3).

The found hex will be the second to last in the A-B path.

6. Now we are looking for hexes adjacent to the found one and having the label 7, and so on.

7. Repeat the described procedure until you reach the hex with the label 0.

The path is built.

For creatures occupying two hexes, the path is constructed similarly (when constructing, we ignore the fact that the squad can turn). The hex to the left (for the attacker) / to the right (for the defender) of the "head" of the creature receives the label "1". Only hexes that the "head" of the squad cannot reach (because the "tail" does not fit) are marked, for example, with the label "N".

You can find out whether a creature will turn before attacking by the difference between dest and source, where dest is the distance to the destination in hexes from the left edge of the battlefield (right, if you are the defender), and source is the corresponding distance to the starting hex. If this difference is negative, then the squad will turn, otherwise - no.

P. S. If a hex can receive multiple labels, then choose the smallest one:
5 * 7 (Here, hex "*" receives the label "6", and not "8").

Statistics

Welcome our newest member: dodoD0D0

Users Online 2 users 1389 guests