Presumed bug with distance tool (V key)

Tech Support forum for War in Spain 1936-39

Moderator: jwilkerson

Post Reply
KtoTam
Posts: 26
Joined: Fri Jan 12, 2024 2:32 pm

Presumed bug with distance tool (V key)

Post by KtoTam »

My understanding is that hexes are 5 NM each. And it holds true when using pressing V key and checking distance between any 2 hexes. However when checking any further distances they tend to not be in multiple of 5.

What follows are the screenshots of distance measured to hexes two hexes away. The distance displayed when V is pressed is variously 8, 10 or 11 NM. Cardinal directions S,N,E,W appear to be always 10 NM. While SE,NE,NW,SW each have a pair of 8 NM and 11 NM.
Zrzut ekranu 2026-01-27 170558.png
Zrzut ekranu 2026-01-27 170558.png (366.09 KiB) Viewed 95 times
Zrzut ekranu 2026-01-27 170608.png
Zrzut ekranu 2026-01-27 170608.png (332.5 KiB) Viewed 95 times
Zrzut ekranu 2026-01-27 170621.png
Zrzut ekranu 2026-01-27 170621.png (340.49 KiB) Viewed 95 times
Alessandro S.
Posts: 191
Joined: Thu Dec 13, 2018 7:28 am

Re: Presumed bug with distance tool (V key)

Post by Alessandro S. »

Actually caused by hex geometry.
The hexes are 42 pixels in width, but each line of hexes is 38 pixels distant from the line below.
Or in other words, hexes are 42 pixels wide, but 38 high.
Changing the hexes height or width does cause a wrongly shaped hex.

The game map and math was aligned along the X and Y axis in a way 2 hexes to north/south equal 2 hexes to west/east.
This kind of projection distortion cannot be avoided due to the math of hexagons.
The only responsible person. (Unless I can frame someone else)
KtoTam
Posts: 26
Joined: Fri Jan 12, 2024 2:32 pm

Re: Presumed bug with distance tool (V key)

Post by KtoTam »

Alessandro S. wrote: Fri Jan 30, 2026 8:51 pm Actually caused by hex geometry.
The hexes are 42 pixels in width, but each line of hexes is 38 pixels distant from the line below.
Or in other words, hexes are 42 pixels wide, but 38 high.
Changing the hexes height or width does cause a wrongly shaped hex.

The game map and math was aligned along the X and Y axis in a way 2 hexes to north/south equal 2 hexes to west/east.
This kind of projection distortion cannot be avoided due to the math of hexagons.
I presume that under the hood there is some reason why you can't just grab the number of hexes (which is calculated correctly) and multiply it by 5, (or a distance between 2 neighboring hexes to avoid hard coding) instead of doing the pixel math?
Alessandro S.
Posts: 191
Joined: Thu Dec 13, 2018 7:28 am

Re: Presumed bug with distance tool (V key)

Post by Alessandro S. »

Yes. The distance in hexes can differ depending on which hexes you use.
See example
Red and yellow are 3 hexes each. But the distance from A to B is different for both.
For many internal math the game thus uses the pixel coordinates for more precision.
Attachments
Hex Math.png
Hex Math.png (4.47 KiB) Viewed 29 times
The only responsible person. (Unless I can frame someone else)
KtoTam
Posts: 26
Joined: Fri Jan 12, 2024 2:32 pm

Re: Presumed bug with distance tool (V key)

Post by KtoTam »

Ah so for movement 'real Pythagorean' distance is used and not the go hex by hex distance. Very good to know.
Post Reply

Return to “Tech Support”