PhonicUK posted on May 25 2009 at 08:58 PM)
How does one bend a square map? I don't massively need any of the sophisticated stuff you mentioned. Also a square grid system for the terrain makes everything massively easier than dealing with the wireframe you end up with for a sphere (Unless its possible to make a sphere entirely out of equally sized squares? said:
OK, there are two ways of doing this, and they are really the same: Either you do it like in Civilzation 4, or you do it like in Populous 3.
Let's start with the easiest one: Populous 3.
What you need is basically a mesh to use for your map "projection". Say that you have a terrain structure like on a normal rectangular map, with heights and whatnot:
(here, only the "visible part" of the map is pictured; there's more to the map that's "out of sight")
What you then want to do, is that you "bend" the map, by having a "grid" of vectors that offset your map, so that it gets a curved shape, like this:
When the camera then moves, for example to the right, you simply move/rotate the whole thing to the left, add map cells to the right onto the grid, and remove cells to the left. This gives you the seamless scrolling motion that you might want.
You have to fix the edges of the map, of course, so that when you reach the right edge of the map, you feed the curved grid with tiles form the left side instead, so that the tiles wrap. It then looks like you have a "sphere" that repeats itself, but the map really is like any other terrain map, just shown differently, and wrapping.
Same principle in Civ4, only that you view the projection grid from above, and the convexness of the grid changes depending on zoom level.