Demo Dropped





This is my first step into 3DS games, I decided to create RingDash Duo as it is already a finished game for the Super Nintendo, except for 2 new players to add. There were quite a few challenges I had creating this game, as information on the 3DS is a bit limited. There are a few nice demos with Devkitpro to get you a taster for the 3DS, but you are pretty much on your own. The game was coded in C, just like my other console games, by keeping to C - I can port between any of them more easily and also C is cross platform friendly. Some issues are finding a good emulator to test the code with. I have been using Lime3DS, but it doesnt support sound and also getting sound to work was a challenge. I had to seek out another library to be able to play sound on the 3DS as the devkitpro code is not good enough. Also although the game is in 2D it is actually all 3d and uses Quads drawn using immediate mode, not Citr2D. As I wanted to be able to use spritesheets as this project is actually twinned with a desktop version, which needs some work still. Once I had the core game running with my custom 2D graphics manager and shader, I then wanted to draw a map for players to be able to see their progress, as this was missing on the SNES and GBA versions of the game. And is something the DS and 3DS can easily provide with the bottom screen. This was when I ran into my next issue of trying to use the bottom screen. The 3DS's bottom screen is a different resolution than the top, which is kind of irritating and as it is treated as a separate thing to the top screen, it needed to have its own transformation matrix and virtual camera as well as a shader for use. As everything is 3D, each map tile is actually 2 polygons and the larger the map got, the slower the game ran. Until it started to crash the system all together! I would have loved it, if the 3DS had a 2D tiled base system for each screen like the DS, as the map would have been a breeze, but no. So I had to try and figure out how I can have that map on the bottom screen, nothing of use was found. Then one idea I had, was what if I don't clear the framebuffer at all, I could just draw a couple of lines of the map, each update/ game step and that way the console could run at full speed still. So I had to use trial and error to find out how many lines of the map i could draw each update without crashing or slowing down the core game. I think the result is good and allows me to give the player a map to see what is going on, without experiencing any slow down on the larger level maps. I should be able to use this method in the future now also, as most 3D/2D games can benefit from a level view on the bottom screen. So if you code on the 3DS, the method I used was to have a simple shader, just using Citra3D for everything. To draw each character from a spritesheet, meant having to first work out what 1% of the width and height was as a float - i.e 1.0f/imageWidth, 1.0f/imageHeight and then to draw each tile, you need to convert its rectangle in to a kind of rectanglefloat type. As you will be working in texels to draw its image from the spritesheet. And then you need to actually flip the image upside down when drawing it! as is the norm with opengl when drawing images. As I always want the top left to be 0,0 and the bottom right of the display to be 400x240 in this case or 320x240 for the bottom screen. Anyway I hope there was something of interest in there. Let me know if you have any questions?
Bri G
Leave a comment
Log in with itch.io to leave a comment.