Lots of noob questions
Posted: Sat Mar 07, 2015 10:17 pm
OK, be prepared for a dump of all of the noob questions I've been saving up until my account was activated.
*deep breath in*
Color Palette Management
So, I see that on the Genesis I have four color palettes at my disposal, each with 16 colors. That gives me a maximum of 64 colors I can display at any given time, up to 16 per sprite.
Question is, how exactly do you manage color palettes? Would it make sense to divide color palette by usage? (one for background, one for level, one for player, one for everything else?)
Resource Management
OK, so I've wrapped a lot of SGDK calls in a GameEngine.c file. The game engine currently maintains a list of sprite pointers, and a u32 pointing to the next available sprite index. Then a function call loads a sprite into memory and stores the pointer to it at that index (and returns the index, acting as a sort of "handle" for that sprite instance), and advances the u32 to point to the next one.
Basically, I can load sprites into memory, but the problem is I can't unload them easily. I was thinking about implementing some sort of free list, so that I can essentially request the next available free space to load the sprite into, and then, for instance, if a game entity is destroyed, it frees that slot so that another entity can use it. Does this approach make any sense?
Actually, for that matter, I was thinking of implementing a free-list-like thing for my game entities as well, since GameEngine.c already has an array of entity pointers it runs through and updates every frame, and at the moment when adding a new entity it just iterates through until it finds a NULL pointer (which, obviously, would probably get pretty damn inefficient if there's a lot of entities).
Music XGM issues
Has anybody else had issues when converting VGM over to XGM? Here's how my music *should* sound (exported as a ROM file from DefleMask)
http://www.newgrounds.com/audio/listen/611434
But here's how it *actually* sounds. Close, but something's... I don't know, off? It sounds a little messed up. Actually, I think the percussion's just a little bit off, like maybe it's lagging behind the other instruments a bit.
https://dl.dropboxusercontent.com/u/991 ... ch_XGM.mp3
Also, is there a way to loop XGM music? At the moment, in my game loop I'm manually checking if the music is playing and, if not, restarting it, but there's often a tiny gap if silence when it restarts.
Anyway, sorry to be posting so many questions but I'm just really curious about this stuff.
Any answers appreciated
*deep breath in*
Color Palette Management
So, I see that on the Genesis I have four color palettes at my disposal, each with 16 colors. That gives me a maximum of 64 colors I can display at any given time, up to 16 per sprite.
Question is, how exactly do you manage color palettes? Would it make sense to divide color palette by usage? (one for background, one for level, one for player, one for everything else?)
Resource Management
OK, so I've wrapped a lot of SGDK calls in a GameEngine.c file. The game engine currently maintains a list of sprite pointers, and a u32 pointing to the next available sprite index. Then a function call loads a sprite into memory and stores the pointer to it at that index (and returns the index, acting as a sort of "handle" for that sprite instance), and advances the u32 to point to the next one.
Basically, I can load sprites into memory, but the problem is I can't unload them easily. I was thinking about implementing some sort of free list, so that I can essentially request the next available free space to load the sprite into, and then, for instance, if a game entity is destroyed, it frees that slot so that another entity can use it. Does this approach make any sense?
Actually, for that matter, I was thinking of implementing a free-list-like thing for my game entities as well, since GameEngine.c already has an array of entity pointers it runs through and updates every frame, and at the moment when adding a new entity it just iterates through until it finds a NULL pointer (which, obviously, would probably get pretty damn inefficient if there's a lot of entities).
Music XGM issues
Has anybody else had issues when converting VGM over to XGM? Here's how my music *should* sound (exported as a ROM file from DefleMask)
http://www.newgrounds.com/audio/listen/611434
But here's how it *actually* sounds. Close, but something's... I don't know, off? It sounds a little messed up. Actually, I think the percussion's just a little bit off, like maybe it's lagging behind the other instruments a bit.
https://dl.dropboxusercontent.com/u/991 ... ch_XGM.mp3
Also, is there a way to loop XGM music? At the moment, in my game loop I'm manually checking if the music is playing and, if not, restarting it, but there's often a tiny gap if silence when it restarts.
Anyway, sorry to be posting so many questions but I'm just really curious about this stuff.
Any answers appreciated
