views:

1194

answers:

2

Hi,

I'd like to write a strategy game where it's map will be 3D tiled. I've read some articles on gamedev but most of them are trying to implement 3D in 2D space. I wonder how in nowadays it is implemented using 3D cards. I wonder if using Irrlich will be an overkill (it has a nice heightmap scene node).

Thanks in advance, ternyk

+1  A: 

The 3D card has little to do with the world representation. The '3D in 2D space' observation is right because that is essentially what most of these games are doing. The tiles can still be stored in the same way as they always did (ie. some sort of 2D array, perhaps subdivided into more manageable chunks), and all that needs to change is the graphical representation of each tile. Instead of a bitmap, they may refer to a 3D model, or one or more materials in the case of terrain. Rendering is much the same as it's ever been - for every tile on screen, draw that tile's representation (whatever it is) at the given position. 3D rendering will render the tiles in 3 dimensions rather than 2, and require the whole transformation from model space to world space and to camera space, but that goes for all games, tiled or not.

Irrlicht is certainly not overkill for such a game, especially if you want to be able to render 3D models on top of your tiles. Writing your own simple 3D engine is not terribly hard but it is a lot of effort for little or no benefit over the freely-available ones. It's hard to say whether it matches your requirements exactly, since you've not gone into any detail, but generally speaking free libraries like Irrlicht and OGRE are good choices for making games with if you're set on using C++.

Kylotan
+2  A: 

Most has been answered by Kylotan already and I agree.

Adding to it:

Using an engine like Irrlicht is not overkill, it will make your job easier actually as it frees you from boring and error prone standard tasks regarding direct3d/opengl usage.

It generally is important to distinct between a game's internal world representation and its visualization. Just because a game uses 3d models and 3d terrain doesn't mean it uses the same data for its internal representation of the game world. Most often a simplified model lies beneath. Kylotan lined out one way, but you can also have a heightmap based terrain with a simplier model underneath. A 2d array with each element representing a tile of your scene with its game specific properties (Matrix of which type of unit can enter this tile, movement costs, can build buildings etc.). The visual terrain can be completely detached from this data.

Regarding the terrain feature, OGRE provides a much better terrain implementation than Irrlicht in terms of flexibility, performance and visual quality. Whether or not it is relevant for your game I don't know. See http://www.ogre3d.org/forums/viewtopic.php?f=11&t=50674

haffax