Recent changes Random page
GAMING
Gaming
 
WoWWiki
Diablo Wiki
Fallout-The Vault
Grand Theft Wiki
Halopedia
StarCraft Wiki
FFXIclopedia
Resident Evil Wiki
See more...

Sphere

From Freeciv

Jump to: navigation, search

This page is for discussions about true spherical maps, and the possibility of implementing something like this for Freeciv. True sphere means that the map is a sphere (you can pass over the poles), and that it is rendered as a three-dimensional sphere that is zoomed in sufficiently to present an almost flat surface. The solution discussed here assumes that the best way to implement this is a buckyball, a geodesic sphere with 12 pentagons and a variable number of hexagons. The smallest possible variant is a dodecahedron, with 12 pentagons and zero hexagons.

Contents

[edit] Problems

  • An algorithm to draw buckyballs with different numbers of tiles.
  • The best coordinate system to uniquely identify tiles.
  • An algorithm to identify a tile's neighbours.
  • Distance between two tiles (in real and square distance)

[edit] Drawing

You can draw buckyballs by constructing an icosahedron, then subdividing the triangles until you have a sufficient number, then by turning it into its dual, you have a buckyball.

A big challenge may be that aside from the dodecahedron, buckyballs created this way do not have regular polygons, that is, the tiles are not all the same size and shape. OpenGL can be used to stretch textures to fit, but this may not look good. Remains to be tested. Of course, since the buckyball consists of both pentagons and hexagons, we either have to have twice as many tiles, or we need to go over to some kind tile system that uses triangles (both pentagons and hexagons can be drawn as triangle fans).

[edit] Possible Tile Numbers

The buckyball sphere tiling is very adjustable. The number of tiles can be calculated by a simple equation: n = (x^2-1) * 10 + 12

In this equation x is the number of times the height of a hexagonal times can be fitted on one side of the original triangle. For example, if x is 1, the bucky-sphere has 12 tiles - it is a dodecahedron. If x is 2, the resulting bucky-sphere has 30+12 tiles - 30 hexagons and 12 pentagons. A bucky-sphere with x=16 has a total of 2562 tiles, roughly the number of tiles of a standard size map in Civilization III. If you take into account that in a spherical map with an earth-like appearance you will actually have polar ice-caps, you will of course "lose" some tiles to that. --Moriarty 12:49, 21 Jun 2006 (PDT)

[edit] Coordinate system

The crucial problem for a coordinate system on a sphere, as well as for finding distances between two tiles, is that while on a square map you know some things about the relationship between two tiles on any point on the map that you do not know for a sphere. For example, if you go N tiles north, N tiles east and N tiles south on a square map, the origin and the destination tiles are at N tiles distance to each other. This may not hold on a sphere, because the layout of tiles is not uniform the same way. At least this is my current working assumption. (Per 11:03, 20 Jun 2006 (PDT))

The coordinate system can be a spherical coordinates, which will give unique positions, but which does not guarantee to have tiles at each position. So (1,1,1) may be a tile but (2,1,1) may not be a tile. An alternative is to simply assign each tile a unique number. In either case we would probably have to keep a record of neighbours for each tile.

[edit] The buckyball project

See buckyball project on gna.org and our draft wiki page: Buckyball.

[edit] Useful links

[edit] Previous Discussion Threads

Rate this article:
Share this article: