Advertisement

3D Tiled Globe for tbs game

Started by August 03, 2000 03:52 PM
9 comments, last by Possibility 24 years, 5 months ago
I am trying to make a tile based tbs game like civ but to make the world a true globe, but the problem is trying to figure out how to make a globe. From what I have been able to determine using hexagon tiles dont perfectly make a globe, you have to use a combination of hexagons and pentagons (5 sided) like a soccer ball, and that gets to complex, or I can use geodesic (like a geodesic dome) but that would be all trianlges but it can be easily devided into all hexagons except for 7 points, the points at the 2 poles are pentagons and 5 spots on the equator equally spaced around it are also pentagons, and that is just no good. So I was also looking at using pure pentagons for tiles, but I cant find anything for making variable sized Dodecahedrons (sphere made of pentagons). So if there are any geometry wizzes here or anyone who wants to help me make a truely spherical globe tiled game, email me pull0017@tc.umn.edu or icq me 10122251 (icq is perferred). Possibility
Make like nature and take the path of least resistance!!!

As long as it is safe to assume that the total board size will be larger than the size that can fit on your screen, you can just "wrap" square tiles back onto themselves, and create the illusion of a surface that curves back onto itself, without having all those odd-sized tiles, and the pain of rotating pentagons... (jeesh, the pain of rotating pentagons that are attached to hexagons...) Making the tiles squares will make them easy to rotate (if you choose to implement rotating -- hexagons are even easier to rotate, but harder to draw on your square-pixel screen).. squares are VERY easy to draw on your screen, and if you really want to you can angle squares a lot easier than hexagons or pentagons.

Look out your window: flat, right?

Well, yeah it''s a sphere (okay, an ellipsoid)... but you can''t tell that unless you''re very far away... and even though you can''t do the "triangle with 270 degrees not 180" trick using wrapping squares, i don''t think the player will mind much.

Even on top of all this, the generating of the tiles will be INCREDIBLY easy if you stick to squares/rectangles... I tried to do a hexagonal TBS once, and one of the hardest parts was creating the tiles for the landscape so they looked right when they were next to each other.



Monday is an awful way to spend one seventh of your life.
Greenspun's Tenth Rule of Programming: "Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
Advertisement
Hehe, creating a 'flat' hexagon map is so easy, its just as easy as Iso, but I dont want a flat 2D map like in civ2 where you walk around it from left to right and can keep walking around it, but not from top to bottom. I want to make a true Spherical map, where the shortest distance from the US to Russia is over the north pole, which can not be done with a flat 2D map as in civ. Also, you can not construct a sphere with squares (or not equally sized squares).

Here is an example of what I am talking about:




Possibility

Edited by - Possibility on August 3, 2000 7:01:31 PM
Sphere Mappers,

I have good news and bad news. The good news is that it''s ok that you are having trouble mapping a sphere with tiles, cartographers have struggled with this for ages. The bad news is that it can''t be done perfectly! The rules of Euclidean Geometry(triangles, distances, etc.) don''t work in non-planar geometry, e.g. geometry on curves. Here''s an example: If you look at your globe, it is divided into North, South, East, and West Hemispheres. If you divide the East and West hemispheres in half, you end up with a globe divided into eight pieces. Looking at one of these pieces, you can see it has three sides. Now look at the angles of the piece, it''s easier for most people to see this at the poles. The angles are 90 degrees! So what we have are curved triangles that have 270 degrees. And all this means that we cannot perfectly map 2 dimensional tiles onto a curved sphere.

Pentagons, good luck... they don''t tile in two dimensions, they only tile in three as a dodecahedron, and they have five points which sucks.

As far as I know, there aren''t any "curvy" tiles that will map a sphere, either, because tiling, in order to fill all the available space(no "holes" between pieces) inherently involves straight lines, and spheres are curved. The surface of a sphere is an area, and so the tiling shapes are the same as two dimensions, except for the slightly curved sides, and things seem to work ok for a while, but there are always points where some "pinching" must occur.

My recommendations, then, are these: use your present "hexagon w/ 7 pentagons" mapping based on triangles and find a way to deal with the pentagons, or divide the sphere up into longitude and latitude, use squares, and possibly provide a movement bonus when moving across longitudes(east or west) near the poles, which is where the pinching for this method occurs. You have to fudge somewhere, so you have to choose where. The last thing I could recommend is this- abandon the tiling. Build a model that has enough polys to make the sphere look good, and then make the game a tbs game with movement not limited to specific angles, only distances(movement would involve concentric circles of distance, and figuring out which poly you land in for terrain considerations(not for position consideration. You''d have to build a system to track position in spherical coordinates)) That would be really cool, I think.

Well, after a lesson on Non-Euclidean Geometry and some nonsense about spherical coordinates and junk, that''s about all I have to say right now. My apologies for the incomprehensibility. Good luck.

Best Regards,
Torus

"Impressive!!!"
I''ve struggled with this exact same problem in real time 3D for a future game project that I plan to undertake. I want to map "square" tiles onto a 3D sphere so the player can follow the tiles around just as he would on a 2D tile grid.

I''m still not sure if it is possible. But I have an idea that seems like it should work, but I haven''t tested it yet, so it may not.

Basically just do a Volley Ball pattern on the globe. Go find a picture of a volleyball if you don''t know how they work. They are made from pieces of cloth/leather/whatever that begins flat, but is cut in such a way as to go into a sphere. There are 6 main sides that are squares with slightly curved edges all with the same angles. The 6 sides come together just as the sides of a cube. It''s like stretching a wireframe cube down around a sphere. Now I think by dividing the 6 main sides smaller and smaller, there''s a chance that the you can keep the squarish tile shape.

Let me know if this will work or not. I''d also like to hear any comments from others.
Hmmm.... dare I give away my top secret plans for making a real sphere in my iso game.... You guys aren''t going to like post my top secret plans on the internet are you know?? (Doh what am I doing?!? ;-)

Alright I cheated, as it has been said it''s near impossible. So I''m making a completely non linear RTS game. Basically you deploy your units from a mothership in orbit down onto the planet, however you shouldn''t spread your men too thin so you deploy into "sectors", which can be of any size or shape. Basically I got my level and unit deisigner to also design a planet in an open globe view (Like in an atlas) then this was devided up into MANY sectors which you can move through freely to ake over the planet, but you must move your guys together into the next sector.

Each sector fits what it looks like on the map. For example, on Earth I live in British Columbia in Canada. Which is tall and thin and bends towards the bottom and has many small islands on it left hand side. So that''s what it''d look like in the game, then if your crossed the border on the right into alberta the edge of that map would have the same "edge" so that it looks like they fit together, although in reality if you printed them all out and tried to make a globe of it, it doesn''t quite work, but you couldn''t tell in the game, you really can''t!

It works well! The most important thing is that you develop your game so that the speed is independant of the map size. For example I''ve seen some game where as you increase the map size it decreases the speed (Drastically!) in my game weather the level is 40x40 tiles or 1000x1000 tiles, it''s the same speed, it just takes more memory for larger levels, of course.

Does this make any sense?? Well I hope not cause then I''d be giving away my idea... he, he, he... well it works for me, but it may not work for you, but maybe it''ll inspire you some to figure out a new system. If your filemanagement is fast enough you could dynamically load new "sectors" so you could "walk" accross the borders and it''d just pause for a second and show the "loading..." sign like in many 3D game (Half life for example)

Hope this helps some!
See ya,
Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
Advertisement
Your screenshot answered your own question. Do the "tiles" in Direct3D. Just figure out where all the verticies are (simple geometry) you can draw out the tiles.
so is your game going to be like populous?
Actually Buster, if you look closely at my image, you will see it is an example of what I am talking about it be impossible to map only a single tile size around a sphere.

If you look closely at the image, you will note that every vertex has 6 lines going out of it. And thus you can kinda see a pattern of hexes they make, but if you look even closer yet, you will see 3 spots on the image where instead of 6 lines meeting at a point, there are 3 spots where only 5 lines meet, and the 5 triangles about that point make a pentagon. One of these 3 is in the lower left, the other is in the lower right, and the 3rd visible near the top, just right of the center.

Possiblity
Instead of solving this difficult problem you could change the problem. Instead of having a sphere for your world make it a cube.

Eck

EckTech Games - Games and Unity Assets I'm working on
Still Flying - My GameDev journal
The Shilwulf Dynasty - Campaign notes for my Rogue Trader RPG

This topic is closed to new replies.

Advertisement