Radius

This page depicts the radius_sq† effects contained in rulesets. The white "zero-tile" is the locus of the effect. If cell value ≤ radius_sq, then, the tile is actively inside the effect's radius_sq. Values ≥ 64 are in a total area of effect that exceeds the grid size. A larger grid is available here. 
Freeciv elements which regulate distance through radius_sq values: 
element 	in
City_Vision_Radius_Sq 	effects.ruleset
City_Radius_Sq 	effects.ruleset
Unit_Vision_Radius_Sq 	effects.ruleset
vision_radius_sq 	units.ruleset
init_city_radius_sq 	game.ruleset
init_vis_radius_sq 	game.ruleset
radius_sq_city 	game.ruleset
radius_sq_city_permanent	game.ruleset
border_sq 	terrain.ruleset
vision_main_sq 	terrain.ruleset
vision_invis_sq 	terrain.ruleset
vision_subs_sq 	terrain.ruleset
== Further Information ==
===== Reading the charts =====
Below, any (x,y) pair represents all 8 combinations for +x, -x, +y, -y and reversed (y,x) pairs, as they all have the same radius_sq result. 
 radius_sq Tiles Area of Notes, examples
 x2+y2 (x,y) Effect 
 
 0 (0,0) 1 ■ Effects the locus tile only
 □
 1 (1,0) 5 □■□ Cardinally adjacent
 □
 □□□
 2 (1,1) 9 □■□ Adjacent. Classic vision_radius_sq 
 □□□
 □
 □□□
 4 (2,0) 13 □□■□□ MP2 vision_radius_sq for early units
 □□□
 □
 □□□
 □□□□□
 5 (2,1) 21 □□■□□ Classic city radius
 □□□□□
 □□□
 □□□□□
 □□□□□
 8 (2,2) 25 □□■□□ MP2 pop21 city; Classic Bomber
 □□□□□
 □□□□□
 □
 □□□□□
 □□□□□
 9 (3,0) 29 □□□■□□□ AEGIS Cruiser, MP+
 □□□□□
 □□□□□
 □
 □□□
 □□□□□
 □□□□□□□
 10 (3,1) 37 □□□■□□□ pop30 city, MP2D onward
 □□□□□□□
 □□□□□
 □□□
 □□□□□
 □□□□□□□
 □□□□□□□
 13 (3,2) 45 □□□■□□□ Cruiser, MP2
 □□□□□□□
 □□□□□□□
 □□□□□
 □
 □□□□□
 □□□□□□□
 □□□□□□□
 16 (4,0) 49 □□□□■□□□□ MP2D Missile Destroyer 
 □□□□□□□
 □□□□□□□
 □□□□□
 □
 □□□
 □□□□□
 □□□□□□□
 □□□□□□□□□
 17 (4,1) 57 □□□□■□□□□ Huge city, Experimental rules
 □□□□□□□□□
 □□□□□□□
 □□□□□
 □□□
 Caveat: If you want city radius to work with city vision radius, remember that invisible tiles are unworkable. Use same values for City_Radius_Sq and City_Vision_Radius_Sq to avoid issues.
 □□□
 □□□□□□□
 □□□□□□□
 □□□□□□□□□
 18 (3,3) 61 □□□□■□□□□
 □□□□□□□□□
 □□□□□□□
 □□□□□□□
 □□□ 
 □□□□□
 □□□□□□□
 □□□□□□□□□
 □□□□□□□□□
 20 (4,2) 69 □□□□■□□□□ Classic AWACS vision radius
 □□□□□□□□□
 □□□□□□□□□
 □□□□□□□
 □□□□□
 □
 □□□□□□□
 □□□□□□□□□
 □□□□□□□□□
 □□□□□□□□□
 25 (4,3) 81 □□□□□■□□□□□
 □□□□□□□□□
 □□□□□□□□□
 □□□□□□□□□
 □□□□□□□ 
 □
==Limit ==
A City_Radius_Sq of 26 is the maximum permitted radius in , which also lists the corresponding values for hex. topologies:
 /* The city's valid positions are in a circle around the city center.
 * Depending on the value for the squared city radius the circle will be:
 *
 * - rectangular (max radius = 5; max squared radius = 26)
 *
 * 0 1 2 3 4 5 6 7 8 9 10
 *
 * 0 26 25 26 -5
 * 1 25 20 17 16 17 20 25 -4
 * 2 25 18 13 10 9 10 13 18 25 -3
 * 3 20 13 8 5 4 5 8 13 20 -2
 * 4 26 17 10 5 2 1 2 5 10 17 26 -1
 * 5 25 16 9 4 1 0 1 4 9 16 25 +0
 * 6 26 17 10 5 2 1 2 5 10 17 26 +1
 * 7 20 13 8 5 4 5 8 13 20 +2
 * 8 25 18 13 10 9 10 13 18 25 +3
 * 9 25 20 17 16 17 20 25 +4
 * 10 26 25 26 +5
 *
 * -5 -4 -3 -2 -1 +0 +1 +2 +3 +4 +5
 *
 * - hexagonal (max radius = 5; max squared radius = 26)
 *
 * 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
 *
 * The following tables show the tiles per city radii / squared city radii.
 * '-' indicates no change compared to the previous value
 *
 * radius | 0 | 1 | | | 2 | | | | | 3
 * radius_sq | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
 * ------------------+----+----+----+----+----+----+----+----+----+----
 * tiles rectangular | 5 | 9 | - | 13 | 21 | - | - | 25 | 29 | 37
 * tiles hexagonal | 7 | - | - | 19 | - | - | - | - | 37 | -
 *
 * radius | | | | | | | 4 | | |
 * radius_sq | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20
 * ------------------+----+----+----+----+----+----+----+----+----+----
 * tiles rectangular | - | - | 45 | - | - | 49 | 57 | 61 | - | 69
 * tiles hexagonal | - | - | - | - | - | 61 | - | - | - | -
 *
 * radius | | | | | | 5
 * radius_sq | 21 | 22 | 23 | 24 | 25 | 26
 * ------------------+----+----+----+----+----+----
 * tiles rectangular | - | - | - | - | 81 | 89
 * tiles hexagonal | - | - | - | - | 91 | -
 *
 * So radius_sq == 5 (radius == 2) corresponds to the "traditional"
 * used city map.
 */
== Notes ==
Category:Technical docs
† Freeciv radius_sq values represent the C2 value from the A2 + B2 = C2 distance formula, without taking the square root. (That means, in the main reference grid at the top of the page, the real distance is the square root of the value in t
Category:Design
Category:Development
he cell.)