Here's my quaint little storefront. It's in 3D. As you can tell, the texture quality applied to my little heroic mesh is very small. It's 32x48 pixels.
So, here's why I'm bringing this up. Unity3D forums suck when it comes to this kind of stuff, and I know AppGameKit is dabbling in 3D pretty soon - and this will be a GREAT way to start discussing texture management in AGK.
Basically, here's the thing: On mobile devices, you're capped moreso by how many different textures are being used in a single render sequence than by polygons. This is why forum users hammer home the concept of using Atlas textures whenever possible - it saves on draw calls and increases FPS
EDIT: To those who don't know, for mobile devices, each different texture rendered on screen = 1 draw call. Have 50 different sprites using 1 texture? 1 draw call. 50 different sprites using 50 different textures? 50 draw calls. For any mobile device released including and after the iPhone 3GS, you want to keep it to about 100-120 drawcalls.
For iPhone 3G and before, 30.
Now, the problem here I'd describe as 'order of magnitude'. Making a 2D game is tough. Making a 3D game is even tougher. There's so much more assets and textures you need to manage over a 2D game. Which I bring up my little storefront up above.
Since 2000, I've always wanted to make a clone of Jet Grind Radio. I even made a semi-functioning version in Dark Basic Pro before real-life hit and I was forced to stop. Now with my legit free copy of Unity3D (multi-platform deployment!) and also with AppGameKit supporting 3D soon (multi-platform deployment if my app development in Unity3D bombs!)
So, the problem with making a 3D game in a city or any populated area is that there's SO MUCH to make. Many different storefronts, different locations, different textures. And it goes to the order of magnitude question. Each building I see around me is different. Different windows, different siding. How can I make a platformer-type game and be smart with texture usage?
Option 1:
Design buildings with repeated textures (e.g., seamless brick texture) and then manually add over simple textured two-poly objects to represent windows and other features. This is how Super Mario 64 did it.
Those little brown windows are actually simple two-poly textured meshes placed just closer to the camera than the wall to give the illusion that's part of the building. They're separate objects.
This works. But on the flipside, you'd have to design the building and then design the windows on the outside (double the work, double the models). You'd use two separate textures to render one building. But you could use the window texture on other buildings, causing a texture savings there.
Option 2:
Bake the windows and other features into the primary texture and just wrap the texture around the building model. Sonic Adventure 2 did this in City Escape:
Look at the windows on the building on the middle-right of the picture. They're the same texture, just repeated.
The problem with this is that buildings tend to look the same, because they all use the same texture. In addition, if you do this, you'll need to make an additional texture for each and every variation that you'd like. This means that if you want 50 different looking buildings, 50 different textures.
Unless you sacrifice texture quality and cram multiple designs into one texture.
Option 3: Paging Terrain (Occlusion culling)
Brought up by another poster, this allows you to seamlessly load in and out of memory portions of the level as they are needed. For instance:
OOOOOOOOOOOOOO
OOOOOOOOOOOOOO
OOOOOONNOOOOOO
OOOOOONNOOOOOO
OOOOOOOOOOOOOO
OOOOOOOOOOOOOO
If the character is in the NNNN area, only objects around the player are loaded into memory. If the person moves into a new area, the O's change to N's (and are loaded and displayed) and areas that are out of reach/view are destroyed and hidden (objects to be destroyed turn to M's, and when memory is freed for other usage turned into O's).
OOOOOOOOOOOOOO
OOOOONNOOOOOOO
OOOOONNMOOOOOO
OOOOOOMMOOOOOO
OOOOOOOOOOOOOO
OOOOOOOOOOOOOO
By doing this, you could load in high-quality textures and reduce the draw count by only allowing what's closest to the player to be rendered onto the screen. This would be a programming solution to the problem I mentioned above.
That being said, as this is done through coding, this could make your project technologically more complex than necessary, and would possibly require multithreading for maximum usage (this would exclude AppGameKit Tier1).
---
So, that's my discussion topic. Perhaps squeezing down one building texture down to 32x48 is a little bit extreme. On the flip side, I could cram 682 different variations of this one building into one 1024x1024 texture and only have one (1)! draw-call to render all variations on-screen.
But then again, I'm a one-man shop and I don't have the novelty to make gorgeous high-res textures (because I'll become anal and give up after wasting a week trying to make one building look perfect).
What do you think, forum members?
This topic will more than likely come up again at some point, and I think this would be a great historical posting for people searching for it. That being said, each programming and development style is different, but having insight about different techniques will help everyone when AppGameKit does go fully 3D.
Hi there. My name is Dug. I have just met you, and I love you.