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.

Coding > Integrating maps from different sources

#29392 - identitycrisisuk - Fri Nov 19, 2004 3:25 pm

So I've moved onto backgrounds now and I think I'm finally getting my head around the basics of them and how the char and screen base blocks work. So I've got one map already that was fairly simple to create, results in tiling a 64x64 image into a 256x256 bachground and I've worked out how to blend it with things (it's gonna be a fog layer that constantly moves and has no relation to other backgrounds used for level objects and paralax scrolling).

I've been designing my level with MapEd which I really like but the one snag for me is that it uses all of your tiles across different levels and gives you output data that refers to one single 256 colour palette, when I want to keep it as individual 16 colour palettes for each layer tileset. Not too much of a problem to then split up your layers and export them separately though.

Only problem I can then see is how you put all your tiles in memory. If they're separate then you can't just pack em into a char base block as tightly as you can because surely the maps will be refering to the tiles as if they start from the beginning of a block, when you might have put them after another set of tiles. So I guess the answer is to use more than one char base block for all of your tiles. I was thinking of doing something like this.

SBB0 - BG0 tile map
SBB1 - BG1 tile map
SBB2 - BG2 tile map
SBB3 - BG3 tile map (if I use it)
SBB4-7 - free, possibly could be used for something, temp map storage or something?
CBB1 - BG0 tiles
CBB2 - BG1 tiles
CBB3 - BG2 tiles

What's peoples opinion on that? I'm not perfectly happy myself, it seems like there'll be wasted space here and there though I don't know if that matters or not. Plus I've left myself no space for tiles to be used specifically with BG3 so I guess I would have to offset them in one of the other blocks and either make my own map editor that would take that into account when creating the map entries or offset the map entries in the game as needed. I might get away with it if BG3 ends up being an information layer so it won't need as much mapping and I'll just be programming where to place text, energy bars, stuff like that.

#29396 - tepples - Fri Nov 19, 2004 4:23 pm

I'd say if MapEd has such limitations, and you can't find another map editor, then write your own. It's not hard. And you can stick BG3's tiles in that space between BG3's map and BG0's tiles, especially if it's just a HUD, as you suggest later.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#29401 - identitycrisisuk - Fri Nov 19, 2004 6:12 pm

tepples wrote:
I'd say if MapEd has such limitations, and you can't find another map editor, then write your own.

Sigh, I expected that might be the answer ;) Spose it would do me some good to learn about making tools as well since that's likely to be what a games company would throw me on straight away if I manage to get a job. I just know it would take me absolutely ages to write something as nice as MapEd, plus anything I try and do with GL or DX on this computer runs like crap, which is why I really got into the GBA in the first place so I could have a stable platform. Glad you think my organisation isn't necessarily too bad though, will just take some planning of how I'm gonna do everything.

#29402 - yaustar - Fri Nov 19, 2004 6:17 pm

I swear Maped only used 16 x 16 colour palettes as I had to work round that restriction during my project....
_________________
[Blog] [Portfolio]

#29403 - tepples - Fri Nov 19, 2004 6:22 pm

identitycrisisuk wrote:
plus anything I try and do with GL or DX on this computer runs like crap

Which is why I got my start with the Allegro library. It wraps DirectDraw, X11, DOS direct hardware access, etc. in a cross-platform way. (I started on DOS, and unlike Allegro, SDL doesn't do DOS.)

In addition, if you make you own tools, you will be able to add metatiles, collision, compression, and even object-based map design (a la Lunar Magic for SMW) in the best way for your game engine.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#29404 - identitycrisisuk - Fri Nov 19, 2004 6:32 pm

yaustar wrote:
I swear Maped only used 16 x 16 colour palettes as I had to work round that restriction during my project....


Yeah, it only supports 16 colour bitmaps for the tiles that you load in but when you export it crams it all into one palette file... unless there's some option that can change that as there sometimes is.

EDIT: On closer inspection I appear to be an idiot, it does try to output 256 colours but they are arranged in groups of 16 the same as your tiles. That means I have spread my tiles around in char base blocks less, I will still need to differentiate for simple things like my fog map but that ain't a problem.