HEX ISO vs HEX overhead

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Wahazar
Hardened
Posts: 198
Joined: Mon Jul 02, 2018 1:49 pm

HEX ISO vs HEX overhead

Postby Wahazar » Tue Jan 01, 2019 2:08 pm

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 480 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).

cazfi
Elite
Posts: 1608
Joined: Tue Jan 29, 2013 6:54 pm

Re: HEX ISO vs HEX overhead

Postby cazfi » Tue Jan 01, 2019 4:26 pm

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.

Wahazar
Hardened
Posts: 198
Joined: Mon Jul 02, 2018 1:49 pm

Re: HEX ISO vs HEX overhead

Postby Wahazar » Tue Jan 01, 2019 7:08 pm

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?

User avatar
Corbeau
Elite
Posts: 907
Joined: Mon Jan 13, 2014 11:13 pm

Re: HEX ISO vs HEX overhead

Postby Corbeau » Wed Jan 02, 2019 2:56 pm

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.

cazfi
Elite
Posts: 1608
Joined: Tue Jan 29, 2013 6:54 pm

Re: HEX ISO vs HEX overhead

Postby cazfi » Wed Jan 02, 2019 3:30 pm

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).

cazfi
Elite
Posts: 1608
Joined: Tue Jan 29, 2013 6:54 pm

Re: HEX ISO vs HEX overhead

Postby cazfi » Wed Jan 02, 2019 3:34 pm

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.

Wahazar
Hardened
Posts: 198
Joined: Mon Jul 02, 2018 1:49 pm

Re: HEX ISO vs HEX overhead

Postby Wahazar » Wed Jan 02, 2019 4:43 pm

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 449 times

hexi.png
hexi.png (33.16 KiB) Viewed 449 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

User avatar
Corbeau
Elite
Posts: 907
Joined: Mon Jan 13, 2014 11:13 pm

Re: HEX ISO vs HEX overhead

Postby Corbeau » Thu Jan 03, 2019 1:25 am

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.