1. ## 2D RTS Games

I'm going to start a RTS or turn-based strategy very soon, and I had several questions:

1. I've never really worked on 2D games (jumped right into 3D, both good and bad) and I hear a lot about isometric maps. I think I get the generic idea, but can anyone explain them a little more?

2. What does Starcraft use? Considering the map editor works in tiles, I'm guessing Starcraft uses isometric maps; is this true?

3. Would I have to create something like squares and place textures on them in OpenGL, or should I use its 2D image support? Which is faster?

Thanks all, this is really appreciated.

2. 1. I've never really worked on 2D games (jumped right into 3D, both good and bad) and I hear a lot about isometric maps. I think I get the generic idea, but can anyone explain them a little more?
Isometric maps are basically 2d maps that are put together to create the illusion of 3D.
Some games that use this (and use it well) include simcity, diablo, and quite a few other games out there.
isometric maps tend to represent a view of the map from a 45 degree angle, looking diagonally down at the units.
http://gamedev.net/reference/list.asp?categoryid=44
there's a bunch of gamedev.net articles relating to isometric games

3. 2. What does Starcraft use? Considering the map editor works in tiles, I'm guessing Starcraft uses isometric maps; is this true?
SC uses "normal" tiles but creates the illusion of them being isometric.

4. If you use a 2D API, isometric tiles are hell to work with, bluntly speaking. The math involved is horrid.

A 3D API might actually work quite nicely with isometric tiles, although I have never tried that before. Because with a 3D API such as OpenGL you can simply use regular tiles and then do a rotation of the view to make it look isometric. Therefore you wouldnt have the same difficulties trying to calculate coordinates as you would with a 2D API.

I have attached a image of a single isometric tile that would be used in the case of a 2D API. The first obstacle you would have to overcome is fitting a whole map of these tiles together so that they look like one whole map. In order to do that you would need to use equations as such:

ScreenX = (GridX * TERRAIN_WIDTH) + (GridY % 2 == 0)? 0 : (TERRAIN_WIDTH / 2);
ScreenY = (GridY * TERRAIN_HEIGHT) / 2;

However, the problem is, you cannot use the same equations to go back. In other words, if you are trying to calculate the grid coordinate of a unit, you cannot just manipulate those equations and get the grid coordinate. Why? Well, Check out the tile I attached below. The magenta transparent sections of the tile stop you from doing that. Even though they arent blitted, they are part of the tile, and factor in to the equation of where the tile gets blitted. Therefore in order to get the real grid coordinate of a unit a 2D isometric map, you would need to do a whole series of equations dealing with right triangles, which I have not even started to figure out. I just gave up and used a square coordinate system instead of an isometric coordinate system.

However, when I think about it, a 3D API like OpenGL would work wonderfully for using an isometric system. You can just use square tiles and then rotate a small amount to make them look isometric. It would not have any difficult math at all.

It all depends on your preference though. Maybe I just make 2d isometric systems more complicated than they actually are. There are lots of tutorials on the net to help out with isometric tile sets, especially at gamedev.

Good luck with your game man.

5. i've heard about some tile systems that use colors to determine which tile they've selected. When the user clicks a position on the map, the map is re-rendered quickly on the backbuffer with certain colors applied to each tile, allowing you to figure which tile was clicked just by a simple color test at the position of the mouse.

However, I'm not sure how well this would work with an isometric game, I just know that the technique has been used before, so it might be worth noting.

6. Originally Posted by Magos
SC uses "normal" tiles but creates the illusion of them being isometric.
Rotated or something? Not quite sure how else they would do that......(easily that is).

7. Originally Posted by Lurker
Rotated or something? Not quite sure how else they would do that......(easily that is).
They use small tiles that put together looks like it would be isometric.
Proof 1 of this is the placement of buildings, where you can see the green marker not being isometric.
Proof 2 is given in the attached screenie, where a special program has modified a map a bit to place induvidual tiles rather than using the normal placer (which actually places several tiles at once).

8. I actually thought of that when I was posting...which is why I added the "easily that is" message .

9. The hard part isn't so much the coding as it will be drawing. Everything is skewed.

10. That's what I meant; hard for the artists.