HihiDanni![]() Level: 7 ![]() Posts: 4/11 EXP: 1432 For next: 16 Since: 02-03-18 Since last post: 4.2 years Last activity: 4.1 years |
|
||
|
ldx postContent
jsr DisplayPost
Over the past couple years I had decided to pursue SNES homebrew. The idea came to me after playing Sparkster SNES, a game that clearly showed that the SNES hardware has a ton of potential, but could have performed better. Originally I was going to make a full game featuring Lyn, the dragon you see in my avatar (though the original sprite was somewhat smaller). I ran out of steam pretty early, but later I revisited my work and decided to turn it into a general engine for myself and others to use.
Superfeather is a homebrew game engine for the SNES. It is written in 65816 assembly. The core tenets are Performance, Flexibility, and Convenience. In other words, I'm looking to get a lot out of the relatively humble CPU, but also make it easy to do so, while remaining generalized enough that it can be adapted to a variety of games. It's a work in progress, but right now I have the following: - Gameloop - VBlank handling, and a scene system which lets you cleanly switch between different screens in a game (e.g. levels, title screens, whatever you want). - Game Objects - You can create and destroy objects dynamically and give them behaviors to run every frame. You can move them around with 16.8 fixed point precision. Default maximum of 128 objects. - Sprites - You can draw single sprites as well as metasprites. You can define animations with callbacks to choreograph all kinds of behavior sequences. - Other Stuff - Third party audio driver (SNESGSS), crash handler, Lua-based buildsystem, basic DMA scheduling. - User Manual! I explain how all the stuff in the engine works. There's still a lot of stuff I need to do but so far I'm pretty happy with the core essentials. Some things I hope to implement soon: - VRAM engine and metasprite editor for easy importing of complex graphics and streaming of those graphics to VRAM - Scrolling levels and a level editor - Data structures for optimizing collision checks (for shmups) I do have some binary releases, but given the current progress on 0.6, I'd rather have folks wait until that's released as it fixes a lot of issues with 0.5. Github project page is here! Here are a few examples I've made so far (click on pictures to download): ![]() bounceballs - Spawns 128 bouncing balls. I kind of wish I could have gotten the CPU a bit lower but it's still enjoyable to watch. metaspritebounds - I made a recent optimization that completely avoids drawing metasprites if they are completely outside view. The metasprites are made out of four 16x16 sprites each which is why CPU is high and it hits the sprite limit pretty quickly. It's meant to test an extreme worst case scenario regarding metasprite usage, and seems to handle it okay! ![]() objectpools - Illustrates the object pool system, where you can dedicate different object slots to different kinds of objects. ![]() walker-dynamic - Shows how to make a controllable character with callbacks for footstep sounds and animation via VRAM sprite streaming. Some interesting metrics: - An empty scene takes about 8% CPU. 3% of that is from iterating through an empty object list with 128 slots. 3% of that is from finalizing the in-RAM copy of OAM. 2% is from the VBlank handler which uploads the in-RAM OAM to the PPU and does some other stuff. - Each ball in the bounceballs demo uses about 0.47% CPU. The majority of that time is spent drawing the sprites themselves. Since 128 sprites is the worst case scenario, this should mean that in practice you have quite a bit of headroom to do all the stuff you want in your game and remain at 60 FPS. Right now I'm trying to come up with a good algorithm for allocating sprite slots in VRAM for sprite streaming. Ideally there will be different sizes of slots (thinking 32x32, 64x32, and 128x32) - the varying sizes means I will need to come up with a strategy to defragment the space if I don't want to settle with having totally separate regions for each slot size. ____________________
rts
|











