Large Tilemap areas - some advice please
by Colin Richardson · in Torque Game Builder · 03/22/2010 (8:35 am) · 1 replies
Hello,
As things progress on my end i have many questions that pop-up.
Basically i need a bit of advice on this.
I am doing an over-the-head 2d shooter and i have some lovely designed maps that i need to build once all the gameplay is tested on my demo level setup.
What is the maximum tilemap area that it's advisable to keep to, ie if we had a map of 200x200 (using tiles of 10x10) would that eat too much memory, or would it be better to have each room as a smaller tilemap of it's own, or maybe display just one room and once a portal was crossed 'load' the next room.
I'd like to keep to displaying as much as possible as i have a basic fog of war happening (a trigger deletes the large dark image over the unseen rooms) and so it helps with the atmosphere i feel.
The game levels are split into sections, and so i was hoping to fit each section into a TGB level and then layout the entire section in one go and add triggers to spawn enemies (ie keep sprites to a minimum).
I've had a look around the forums and documentation and i can't see any fixed limitations, so i'm hoping someone has some advice. As i'm thinking about porting this to the iPhone once finished on the PC/Xbox what else should i think about?
Many thanks
Colin
As things progress on my end i have many questions that pop-up.
Basically i need a bit of advice on this.
I am doing an over-the-head 2d shooter and i have some lovely designed maps that i need to build once all the gameplay is tested on my demo level setup.
What is the maximum tilemap area that it's advisable to keep to, ie if we had a map of 200x200 (using tiles of 10x10) would that eat too much memory, or would it be better to have each room as a smaller tilemap of it's own, or maybe display just one room and once a portal was crossed 'load' the next room.
I'd like to keep to displaying as much as possible as i have a basic fog of war happening (a trigger deletes the large dark image over the unseen rooms) and so it helps with the atmosphere i feel.
The game levels are split into sections, and so i was hoping to fit each section into a TGB level and then layout the entire section in one go and add triggers to spawn enemies (ie keep sprites to a minimum).
I've had a look around the forums and documentation and i can't see any fixed limitations, so i'm hoping someone has some advice. As i'm thinking about porting this to the iPhone once finished on the PC/Xbox what else should i think about?
Many thanks
Colin
Torque 3D Owner Aaron Miller
For the space game I'm working on I've used massive tile maps (50k world units, 64 pixels per tile) without any real penalty, but this was a map set to repeat and I'm not sure if TGB optimizes for that.
I *DID* experience some severe performance hits relying too much on triggers, though. Part of the game has 2D solar systems where the planets have gravity, a situation that might be analogous to your rooms of enemies waiting for the player to enter. I can't say exactly what the trigger threshold was, but in simple systems with a few planets I had no problems; but in complex ones with dozens upon dozens of triggers my game would crawl.
I replaced triggers with distance tests and pickrect calls and had no further problems. The lesson I took away was that triggers are expensive and having them basically sit and poll empty space your player is nowhere near may not be a luxury you can afford.
Hope that helps a bit.