Hi, thanks for your suggestions.
But I'm looking that in a more objet-oriented manner: ok, I agree with you on the point that this should be a unique node (like the TerrainScenenNode) for the complete terrain. BUT (and this is the big problem), it should then inherits from CSceneNode and in that case, the maximum number of textures per node is 2 which is highly problematic. In best case, I would like to be unlimited (only by hardware

), because your map could be made of a lot of different tiles.
Then, another option would have been to have one Node for the terrain in general but that has a list of children nodes, each of them for a particular node. In that case, that's a little bit tricky also because then I will need to split the complete terrain mesh into fractions (one for each sub-node). And I won't even imagine the degradations in performance. A better approach is to keep a single terrain mesh in the node and just play with children 'texture' but then, I will need to look a little bit better in the code to see if this is feasible (sounds tricky but perhaps feasible).
This will allow you to have the hexagonal tiles you want and rotate, raise and lower them on demand through one node.
No, I don't want to use hexagonal tiles for the terrain rendering because it is too difficult to manage: firstly for the 'artistic' point of vue, this is much more difficult to design hexagonal tiles than rectangular or square ones. Second, you increase the number of transitions between the tiles and thus more resources used (and also it is more difficult to manage).
Tiles could have their obstacles already attached.
I don't think this is good idea: the "CTiledTerrainSceneNode" (let's call it like that) is responsible for rendering the terrain, and the terrain only. I thing this is a bad programming practice to mix everything in that class. Obstacles should still be used like standard Meshes (or AnimatedMeshes).
Code: Select all
You'd likely want to implement A+ (isometric only?) or similar path finding directly into the scene node.
The same, PathFinding must be done elsewhere but certainly not in the terrain rendering class.
Also, for the visibility of the cells, I would prefer a system like using a mask that will be used by the CTiledTerrainSceneNode to make parts of the map visible (this will also allow a smooth transition between visible and non-visible parts of the map).