Some games have tile maps that wrap around. Civilization for example lets you go off the left side of the map and you warp to the right side. You canât go off the top or bottom of the map. In 3D space, this would be a cylinder. Some games also let you go off the top side and warp to the bottom, and vice versa. In 3D space, this would be a torus.
So it looks like it may not be practical to flatten a sphere onto a flat grid, but I wanted to explore it anyway. (Note: the /x/ in the url is where I put my quick, unpolished projects like this one.)
The first problem is: what coordinate system should I use to represent the playerâs position and direction, in a way that makes walking around the pole shorter than walking around the equator? A common way of tesselating a sphere is to subdivide an icosahedron. (Note: if you want to use square tiles instead of hexagon tiles, unwrap a cube.) That icosahedron, when unfolded, can look like this:
The second problem is: what should I do with those leftover pentagons? They wonât work with a flat tile map. Iâm going to try hiding the pentagons by just not letting you walk near them. This would only work in games where youâre walking/driving and not games where you can zoom out or freely control the camera.