3d tilemaps - a possbility?

Blitz3D Forums/Blitz3D Programming/3d tilemaps - a possbility?

caff_(Posted 2007) [#1]
How feasible would it be, performance-wise, to use Blitz3d to create a 3D tilemap engine (imagine a large 128 x 128 grid comprising of a seperate mesh for each tile)?

By my calculations there could be millions of polyons on screen at any one time...

Just wondering if anyone's tried this?


Neo Genesis10(Posted 2007) [#2]
This was actually something I looked into when I first obtained Blitz3D. The first hurdle is what the landscape is going to be made of. Blitz's own terrains have fantastic LOD (Level of Detail) handling, but unfortunately you will notice "seams" between the tiles where the polygons are approximated leaving ugly voids. The second obvious hurdle is poly count. With a mesh you won't have the problems terrains have, but unless you have a mammoth machine with plenty of memory, your poor renderer might suffer under the strain.

Its not a completely bad idea though, as long as you can create a workable LOD system. This entails cutting down polygon counts for distant objects either by using premade lower-poly models or dynamically altering the model (much like Blitz terrain). But I guess it all depends on what you want each tile to contain. Perhaps if you could give a few more details on what you want to achieve?


caff_(Posted 2007) [#3]
Well, I was thinking back to an old PC game called Jagged Alliance, an isometric tiled turn-based tactical shooter. The thing I liked about the game was the ability to blow holes in walls.

The main idea behind using small tiles in 3d would be the ability to destruct any tile on the board. However given the poly count and problems with LOD as you mentioned, I don't think it would be achievable sadly.

The other option could be to remove tile-based combat altogether, and use CSG to blow holes in stuff, but again that's completely unpredictable and slow.


Dock(Posted 2007) [#4]
Games like Rollercoaster Tycoon 3 pretty much work like this. I think it's pretty feasible. As for the seams, I believe this works fine if you actually overlap the tiles slightly.

Wouldn't the only real problem for Blitz be its 'surface' problem, or would it be possible to combine them to be one surface?


Neo Genesis10(Posted 2007) [#5]
I've had a little play around with this idea, and its not unrealistic at all. Unless you have the full 128x128 map in view at all times, Blitz does a decent enough job of minimising the rendering so it runs at an acceptable pace. To make things interesting, I even threw in multiple heights and joined them together with extra polys, as you would have in a real game without any problems.

If you're going to have a lot of the map on view at a time, I'd suggest using fogging to cut down render costs (using CameraFogMode is the easiest way). That way it doesn't look ugly, but at the same time distant objects are not being rendered so your scene is still moving along at a decent pace.


Dreamora(Posted 2007) [#6]
Another way would be using EntityAutoFade for objects. That way they fade in/out automatically depending on their distance to you. (similar to fog but not this ugly wall in front of you)


Neo Genesis10(Posted 2007) [#7]
Well, I figure I might as well post my source code here for you to take a look at. Its not very pretty since it was a really quick throw-together piece but it should help you somewhat on your way to figuring out how you want to work things.

The system creates tiles (32x32 in my map) and then uses a seperate single-surface mesh to fill the gaps between raised and unraised tiles. I'm sure you can improve upon this simple idea.

Oh, one thing I forgot to add. In my source code, I make the call to RenderGaps during the main loop. In your main code, you only need call this function if you move any of the tiles (for example, destroying a wall would lower the y# coordinate of a tile to the ground level) which speeds things up considerably.