When creating for the DS, there are a number of considerations to bear in mind. This page outlines some of these restrictions.
Graphics#
Different restrictions are imposed by the 2D and 3D engines.2D Graphics#
Mario Kart DS solely uses text mode backgrounds and character based objects. In 4-bit and 8-bit graphics, each 8x8 tile may use 15 or 255 colors at most respectively. With text mode backgrounds, a hard limit of 1024 characters is imposed by the 2D engine background screen format. It is due to this that local maps must have their tile count reduced. For smaller menu backgrounds and such, which are typically 4 bits in depth, the limit is smaller, and exceeding it will cause graphics data to overflow into graphics used by other things (such as the screen data itself).With 2D objects, there can be a maximum of 128 on-screen at a time. The maximum number on a single scanline depends on the size of the objects and where they are. The 2D engine allots 2124 or 1530 cycles for object rendering depending on whether OBJ processing during H-blank is enabled or not. Each pixel of a normal OBJ takes 1 cycle, and each pixel of an affine OBJ takes 2 cycles. Affine OBJ have an overhead of 10 cycles, and OBJ that exist partially off the screen have an overhead of 2 cycles.
3D Graphics#
The most prominent of the 3D hardware limitations is the maximum polygon count. The maximum number of polygons that can be rendered on-screen on any frame is 2048. Different factors may reduce this number, however. Using exclusively quads, for example, affords a maximum of 1536 on-screen. This is due to the maximum vertex count being 6144 vertices. It is important to note, though, that the rendering engine runs independently of the main CPU, and as such, does not cause it to lag.In addition to restrictions on the number of polygons in a single frame, there are also restrictions imposed on the number of polygons in a single scanline. When too many exist on a scanline, the rendering engine will just stop rendering polygons on that line, leaving tearing artifacts. The number of polygons that can be drawn on a single line will vary between 8 and 132, depending on how many pixels that polygons takes up horizontally on that scanline. Of a total of 2126 cycles afforded to rendering one line of 3D graphics, where each pixel of a polygon takes one cycle, and each polygon itself takes 8 cycles of overhead. Since the rendering engine uses a 48-line buffer, however, these may not end up being exact.
Texture sizes can be any power of 2 between 8 and 1024. In the case of 4x4 compressed textures, though, the maximum size is either 1024x512 or 512x1024 due to VRAM layout.
Translucent polygons can pose a problem when it comes to rendering priority. When a translucent polygon is being drawn, its pixels will not be written over pixels of another translucent polygon unless it has a different polygon ID than the existing one. Accommodating this in Mario Kart DS will require some special code changes.