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.
Post Reply
Wahazar
Elite
Posts: 362
Joined: Mon Jul 02, 2018 1:49 pm

HEX ISO vs HEX overhead

Post 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 6348 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).
Augmented2 ruleset/modpack for freeciv2.6: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: HEX ISO vs HEX overhead

Post 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.
Wahazar
Elite
Posts: 362
Joined: Mon Jul 02, 2018 1:49 pm

Re: HEX ISO vs HEX overhead

Post 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?
Augmented2 ruleset/modpack for freeciv2.6: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: HEX ISO vs HEX overhead

Post 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.
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: HEX ISO vs HEX overhead

Post 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).
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: HEX ISO vs HEX overhead

Post 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.
Wahazar
Elite
Posts: 362
Joined: Mon Jul 02, 2018 1:49 pm

Re: HEX ISO vs HEX overhead

Post 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 6317 times
hexi.png
hexi.png (33.16 KiB) Viewed 6317 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
Augmented2 ruleset/modpack for freeciv2.6: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: HEX ISO vs HEX overhead

Post 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.
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
Post Reply