city radius in hex topology

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Wahazar
Veteran
Posts: 131
Joined: Mon Jul 02, 2018 1:49 pm

city radius in hex topology

Postby Wahazar » Wed Dec 05, 2018 9:17 pm

How works city radius in hex topology? In square topology there is usually few squares for each radius increment, whereas hex topology (version 2.6) require higher steps - which values guarantee real increment of city radius?

Ignatus
Veteran
Posts: 62
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: city radius in hex topology

Postby Ignatus » Thu Dec 06, 2018 5:38 pm

City radius is just a maximal distance to a city map tile from the city center. For tetragonal topologies, there are diagonal tiles that are farther from the center then their straight-positioned neighbours, so you get 5 tiles at squared radius 1, 9 tiles at 2, 13 at 4 etc. At hex topology, there is all the same, just the hexagones are situated in more circle-like structures. For this reason, sq.radius 1 means 7 tiles and sq.radius 2 brings nothing more, you need 4 to advance to six more tiles, but this looks not good and ruleset authors use 5 for the full ring of 2 tiles away. And to inscribe into a circle tiles 3 steps away, you need 10 (see experimental/effects.ruleset). You use the hexagonal values for playing on both hexagonal and rectangular maps; within the maximum allowed sq.radius 25, this shows pretty circles on rectangular maps too. Rulesets for now can't adjust effects like City_Radius_Sq in accordance with non-binary game options, but they AFAIK can force a specific topology.

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

Re: city radius in hex topology

Postby cazfi » Thu Dec 06, 2018 7:25 pm

Ignatus wrote:Rulesets for now can't adjust effects like City_Radius_Sq in accordance with non-binary game options
There is requirement type "Topology" just for adjusting ruleset to work optimally with both hex and square topologies.

Wahazar
Veteran
Posts: 131
Joined: Mon Jul 02, 2018 1:49 pm

Re: city radius in hex topology

Postby Wahazar » Sat Dec 08, 2018 1:43 pm

Ignatus wrote:At hex topology, there is all the same, just the hexagones are situated in more circle-like structures. For this reason, sq.radius 1 means 7 tiles and sq.radius 2 brings nothing more, you need 4 to advance to six more tiles, but this looks not good and ruleset authors use 5 for the full ring of 2 tiles away.
Radius 4 give full ring of tiles around:
size_4.png
size_4.png (48.63 KiB) Viewed 67 times
- at least for 2.6 version. Radius 5 doesn't change anything, unless 9. Numbers of tile layers surrounding city center is just a sqrt(city_radius) rounded down to int.
In case of square topology, things are more complicated, you got 4 tiles for size 1, 8 tiles for size 2 or 3, etc.

Ignatus
Veteran
Posts: 62
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: city radius in hex topology

Postby Ignatus » Sat Dec 08, 2018 8:53 pm

Hhmph... well, I've never tried to change radii's settings myself. Then I don't understand what is 1 for the radius and what coordinates it is applied to.

Wahazar
Veteran
Posts: 131
Joined: Mon Jul 02, 2018 1:49 pm

Re: city radius in hex topology

Postby Wahazar » Sat Dec 08, 2018 10:08 pm

Ignatus wrote:Then I don't understand what is 1 for the radius and what coordinates it is applied to.

city_radius_sq and city_vision_radius_sq are a squared distance from city tile to the most far tile under city influence.
Thus city tile itself have 0 radius_sq, radius_sq = 1 give 1 additional tile "circle" around center, radius_sq = 4 gives 2 additional circles (because 2^2=4) etc.
Which hex coordinate system is used in freeciv? Cube? Offset? Axial?

madmax
Posts: 39
Joined: Sun Mar 26, 2017 5:34 pm

Re: city radius in hex topology

Postby madmax » Sat Dec 08, 2018 11:52 pm


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

Re: city radius in hex topology

Postby Corbeau » Sun Dec 09, 2018 2:38 pm

Maybe this instead? :)

Code: Select all

*        0    1    2    3    4    5    6    7    8    9   10
   *
   *  0                25   25   25   25   25   25                -5
   *  1              25   16   16   16   16   16   25             -4
   *  2           25   16    9    9    9    9   16   25           -3
   *  3         25   16    9    4    4    4    9   16   25        -2
   *  4      25   16    9    4    1    1    4    9   16   25      -1
   *  5    25   16    9    4    1    0    1    4    9   16   25   +0
   *  6      25   16    9    4    1    1    4    9   16   25      +1
   *  7         25   16    9    4    4    4    9   16   25        +2
   *  8           25   16    9    9    9    9   16   25           +3
   *  9              25   16   16   16   16   16   25             +4
   * 10                25   25   25   25   25   25                +5
   *
   *       -5   -4   -3   -2   -1   +0   +1   +2   +3   +4   +5