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.

Game Design > need some input regarding message system, backgrounds

#172713 - zelbo - Fri Feb 26, 2010 5:17 am

I've got a small problem, and am looking for some input on my design. I don't want to get too repetitive, and i don't know if it even matters, but this is for a rogue-like.

My original intention was to use bg 3 for my terrain (grass, trees, walls), bg 2 for items (doors, stairs, loot), bg 1 for fog of war, and bg 0 for a status bar. The reason i was wanting to use a background layer for items instead of sprites is that with a limited number of sprites (128, i believe), i didn't want my items affecting how big the horde of monsters swarming the player could be. The terrain, items, and fog of war layers scroll, the text layer does not. (otherwise this would be a much easier problem to solve)

My problem is this: I can't figure out how to make the console opaque, so my other backgrounds are showing up under the text, which i don't like. Am i missing something? is it possible to make the console opaque? custom fonts maybe? (doesn't need to be the whole console, just the text itself)

Otherwise, i need to make some changes, and these are the options i've come up with so far:
1) Build a new console system. doable, but way more work than i was looking to get bogged down in right now. i'd kind of like to make some progress on the game itself before i loose motivation. I was kind of hoping to save this sort of thing for much later, after i get a better handle on the system and am in the 'putting the polish on a finished game' stage.

2) Put the status bar on the bottom screen. probably the easiest fix of them all, but i can't really say i like this one either. after messing with some display options on the actual hardware, i've come to the conclusion that the space between screens is enough that it's too far for a quick glance. not like it's a whole lot of extra work finding your health and mana on the bottom screen, just seems like they should be on the top screen to me.

3) Change the way the backgrounds are set up, thereby making room for one whole layer just to put some black between the other backgrounds and the text layer. Can't say i'm a huge fan of this one, but it's direction i'm currently leaning. This would involve putting items into the terrain layer, and doing some swapping of tiles when things change. A bit more complicated than i was hoping for, but not so bad since i haven really settled on a tile format yet anyways.

4) Use sprites for items. A possibility, but then i've got items and monsters competing for sprite slots, and thats a bit more juggling than i was hoping for, especially if doors and stairs use sprites as well, though there is no reason they would have to. But that would still limit the number of monsters, and this is a rogue-like. Being swarmed by 128 monsters just sounds right to me. So, not my favorite. Maybe my second choice currently.

5) Forget the fog of war layer. Also doable, but then that leaves a lot more work deciding which terrain squares to show, which items to show, what monsters to show... a lot more work and room for error all around. Probably my least favorite right now.

6) Print directly to the map. Not quite as much work as building a whole new console, since i would just need to figure out a limited subset of things to display, but still, see #1.

I guess i have a few more ideas bouncing around in my head, but these are the main ones i've come up with so far. So now i'm looking for some input from people who've been down this road before, or even just a fresh angle from someone who is outside the problem. Or if anyone knows of a magic flag i can set to make the print console opaque, that would make my day.

#172717 - sverx - Fri Feb 26, 2010 12:00 pm

Since you can't make opaque the color 0 of a text layer, I'd just replace the pixels of the chars having a 0 with a 15, let's say, of course giving the 15th color of the palette the right color.

Don't know where exactly they're located, but I bet you can discover it quickly.

#172718 - zelbo - Fri Feb 26, 2010 3:15 pm

Hrm, not a bad idea. Although, it looks like i could aslo just download the latest release of devkitpro, since it looks like it lets you "set background colors in consoleInit functions", which is exactly what i want, assuming it works the way it sounds.

#172721 - sverx - Fri Feb 26, 2010 5:03 pm

zelbo wrote:
it looks like i could aslo just download the latest release of devkitpro, since it looks like it lets you "set background colors in consoleInit functions", which is exactly what i want, assuming it works the way it sounds.


Sounds like that's the first thing to try :)