In a side-project that I’m working on, the world is much like those in certain old first-person RPGs: a grid of simple flat tiles, with the floor and ceiling each lying on a single plane.
Thus far I’ve been constructing my floors and ceilings from quads, generated by CardMaker and positioned as appropriate. The game flattens this assemblage for the sake of performance, while the associated tile-editor does not, for the sake of allowing changes to tiles.
For the most part, this works. There are occasional glimmers between tiles, but it otherwise looks as intended and performs reasonably well.
With a small tile-map, that is.
When the tile-map is, say, 20x20, all is well, on my system at least. However, if the tile-map becomes too much larger, then performance in the editor drops–I think that I had a situation in which a ~500x500 tile-map resulted in a frame-rate of ~2-4fps.
I daresay that the problem here is simply the number of nodes: 50 000 nodes is probably a bit much to ask of the poor computer. ^^;
So, I’m looking into a new way of constructing my environment.
What I have in mind at the moment is to build my tiles procedurally within one or a few GeomNodes (perhaps one per floor-tile texture), and then add and remove primitives as called for. In addition to dramatically reducing the node-count, I think that this should also allow me to alter tiles during gameplay, an action that isn’t available under the current method.
However, before I dive into building my geometry from scratch, I want to check: is there an easier way that I’ve missed?