Page 1 of 1

HEX ISO vs HEX overhead

Posted: Tue Jan 01, 2019 2:08 pm
by Wahazar
I do not understand, why these topologies are not compatible, isn't it just a different view of the same topology?
For example, when I have server working on HEX topology, and change client setting to HEX ISO tileset,
tiles are completely different assigned.
Here is example:
hexo.png
hexo.png (43.2 KiB) Viewed 6343 times
and there is 3 tiles distance to the city located south of Capital,
after switching to isometric hex:
hexi.png
there is only one tile with mountain between them - is in't a discrepancy between clients with different tileset playing on same server?
(also note, that it is also not possible to go along road from one rice field to another omitting Capital).

Re: HEX ISO vs HEX overhead

Posted: Tue Jan 01, 2019 4:26 pm
by cazfi
Wahazar wrote:I do not understand, why these topologies are not compatible, isn't it just a different view of the same topology?
No, they have different directions one can move from a tile to another.

Re: HEX ISO vs HEX overhead

Posted: Tue Jan 01, 2019 7:08 pm
by Wahazar
I don't understand it.
In case of square topology, isometric view is just an overhead view rotated by about 45 degrees.
Why it is not a case for hex topology?

Re: HEX ISO vs HEX overhead

Posted: Wed Jan 02, 2019 2:56 pm
by Corbeau
The more I think about it, the more it seems to me that someone simply didn't think it through and messed up.

There are two ways a general hex map can be laid out, but there is absolutely no reason why not consider those two cases as simply rotated by 60 degree compared to each other. However, whoever developed this chose to use different coordinates for each map layout.

Re: HEX ISO vs HEX overhead

Posted: Wed Jan 02, 2019 3:30 pm
by cazfi
Corbeau wrote:there is absolutely no reason why not consider those two cases as simply rotated by 60 degree compared to each other.
The only reason I can quickly think of is that we now support both worlds where poles are on the flat edge (north and south edges are the flat ones) and worlds where poles are on the sawtooth edge (east and west are the flat ones).

Re: HEX ISO vs HEX overhead

Posted: Wed Jan 02, 2019 3:34 pm
by cazfi
Well, rotating world 60 degrees would result in a world map that is a 60 degrees rotated square. Currently we have edges of the world (on screen) going horizontally and vertically, not diagonally.

Re: HEX ISO vs HEX overhead

Posted: Wed Jan 02, 2019 4:43 pm
by Wahazar
First of all, there are two pairs of coordinates: Location and Native Coordinates.
In case of square topology, both pairs are equal, regardless of iso/overhead view, which is obvious - it is the same square grid.
The problems with hexagonal grid arose from the fact, that X-Y matrix is not optimal for storage information about hexagonal grid.
I didn't checked freeciv code, but I can bet, that offset coordinates were used:
Image
which can have two variants, depending on overhead or iso orientation.

Here is explanation of the offset coordinates system:
https://www.redblobgames.com/grids/hexagons/

If you look at above examples, you can see, that same tile can have different neighbors, depending on coordinates calculation method.
The same is, if you look at freeciv map generated for one hex overhead, with tileset forced to isometric hex:
hexo.png
hexo.png (49.53 KiB) Viewed 6312 times
hexi.png
hexi.png (33.16 KiB) Viewed 6312 times
The most natural way of storing hexagonal grid is using cubic coordinates, but you need 3 coordinates/tile - probably not doable with current implementation.

But what about using axial coordinate system?
Image

Re: HEX ISO vs HEX overhead

Posted: Thu Jan 03, 2019 1:25 am
by Corbeau
cazfi wrote:Well, rotating world 60 degrees would result in a world map that is a 60 degrees rotated square. Currently we have edges of the world (on screen) going horizontally and vertically, not diagonally.
If you choose isometric tileset, the edge of the world will be diagonal.