gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > triangle guidelines for game artists?

#145741 - dadako - Wed Nov 21, 2007 8:52 am

Hi

I'm looking for a little bit of advice, guessing this would be the place to find it!

Basically I would like to spec out the graphics of a DS game, but I'm unsure of what triangle counts to use. I've heard that the DS can push 2000 triangles per screen but can't find any documentation to back this up.

The game's genre is racing, so I was thinking about the following rough guide (think mariocart):

car and player selection screen: 900 tris for the car and 900 tris for the character

cars and players in race: 200 tris car and 200 tris character, with 3 or 4 players on screen.

Track: 4000 tris, built in such a way so as not to show more than 500 or so tris onscreen at any one time.

Does this sound reasonable?
Am I right about the 2000 tris limit?
What would be a reasonable texture limit in kb?
what happens if more than 2000 tris are onscreen?

Well, I thank you for any replies in advance. I'm very keen to get started on this and would like to start on the right foot.

#145745 - melw - Wed Nov 21, 2007 12:14 pm

dadako wrote:
cars and players in race: 200 tris car and 200 tris character, with 3 or 4 players on screen.

Track: 4000 tris, built in such a way so as not to show more than 500 or so tris onscreen at any one time.

Does this sound reasonable?

Pretty much, yes. Best to experiment with the values a bit, though and you'll see how it'll end up on screen. DS screen size is after all physically so small that even lowpoly models can look good.

dadako wrote:
Am I right about the 2000 tris limit?

Yes. The limit is subject to change depending on how many triangles are clipping, but you can normally render at least close to 2000 triangles on screen.

dadako wrote:
What would be a reasonable texture limit in kb?

If you're using all the main vram banks for textures, you have 512kb in use. So that would be at least a reasonable top limit in most of the cases. However keep in mind that if you wish view HUD, etc. that needs some memory.

dadako wrote:
what happens if more than 2000 tris are onscreen?

They're simply omitted and not rendered.

Furthermore, you should check out Tassu's Whee ! DS 2 - another homebrew racing game (although not with cars). Perhaps ask him the amount of polys and textures he's using in the game?

#145759 - M3d10n - Wed Nov 21, 2007 6:16 pm

Racing game? You should seriously consider using multiple level-of-detail models. You'll hardly have multiple cars all too close to the camera at the same time, and when they are viewed at a distance you wouldn't see the extra polygons anyway.

When you have backface culling on, for objects like people and cars you get ~40% of the triangles culled. As example, I have a 550 triangles character and the maximum triangle count reported by the DS is 290 (less in some camera angles).

The best way to get a good idea of how many polygons the DS is really drawing is to write a stub nds that loads your models and allows you to see the polygon counter as you move the camera.

#145780 - dadako - Thu Nov 22, 2007 1:54 am

Thanks for the replies.

If I were to go for a set of LOD models, I'm guessing high / med / low would be OK.

I've noticed that mariokart doesn't use LOD models (if it does there must be many) - is there any sort of camera draw distance auto LODing code out there?

Thanks for confirming the 2000 polygon thing. I take it that the textures are in an uncompressed format like PNG or BMP?

The end goal is to see models on the DS however this is just an exercise in budgeting for now, hopefully one day I can see everything flying about for real, coder I am not.

#145785 - M3d10n - Thu Nov 22, 2007 11:29 am

Since the DS screen resolution is so low, it is very hard to notice the switch to LOD models if they're done well enough.

When modeling for DS, I suggest you keep a viewport window which has the same size as the DS screen (256x192), with bilinear filtering and mipmapping turned off. It's much easier to keep the models low-polygon that way, because you can see which polygons you can get rid of without compromising the model shape too much.

As for textures, the DS doesn't take file formats like PNG or JPEG directly, if you want those your game code must support that. Also, whatever compression you use in your file format (JPEG, as example) will only affect storage space usage: for the image to be displayed on the screen it must be converted into one of the DS's supported image formats. LibNDS comes with a small PCX file loader which works well. The DS can use 4-bits and 8-bits palleted textures (16 and 256 colors, respectively) and direct 16-bits textures (15-bit color and 1-bit transparency). You can get those from PCX files.

Additionally, there are other 3 image formats: 3-bits palleted (8 colors) with 5-bits alpha (32 levels of translucency), 5-bits palleted (32 colors) with 3-bits alpha (8 levels of translucency) and the compressed format (which is similar to S3TC/DXT1 compressed DDS files). To create those you need custom-made image converters. There is a couple of them on this forum, I think.

#145819 - nce - Fri Nov 23, 2007 1:11 am

M3d10n wrote:
The DS can use 4-bits and 8-bits palleted textures (16 and 256 colors, respectively) and direct 16-bits textures (15-bit color and 1-bit transparency).


It support also the 2-bits paletted ( 4 colors ). I use that a lot for environment. :)
And the color keying, meaning that you can say that your first color in the palette will be transparent.
_________________
-jerome-

#145840 - NeX - Fri Nov 23, 2007 5:39 pm

Won't 2-bit look a bit... rubbish? It's not exactly next-gen. I suppose it would be good enough for plain cartoony scenes.
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.

#145846 - Mighty Max - Fri Nov 23, 2007 8:31 pm

Well it's just a texture. It's not the amount of colors in the rendered scene.

For some grass in the distance (actually not that far away) more then 4 colors would be a waste. Don't foget that lighting, AA and such are adding to the colors too.
_________________
GBAMP Multiboot

#145865 - dadako - Sat Nov 24, 2007 3:23 am

Thanks for the palette advice guys.

I used to be a spriter so things should be ok :)