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.

Graphics > Question about Nessies editor...

#10590 - IAMTHEEVILBEAN - Wed Sep 10, 2003 12:09 am

hmmm ...well i am very confused as to his editor...i goto upsate tiles after I have sometign drawn out ust to experiment and it says this file is 24 bit te editor only accepts 8 bit....How can i make the tiles 8 bit?
_________________
Moose

#10592 - tepples - Wed Sep 10, 2003 12:30 am

You'll need to convert the image to indexed color in your favorite image editor.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#10593 - IAMTHEEVILBEAN - Wed Sep 10, 2003 12:31 am

Well being the friking moron that I am I have no idea what ur talking about lol where can i do that in oh say.....Pant or photoshop
_________________
Moose

#10596 - Nessie - Wed Sep 10, 2003 1:27 am

I would generally recommend drawing the artwork with 256 colors to start with....but since that wasn't what you were asking, heh.

PaintShop Pro 4 -> Colors menu -> Decrease Color Depth -> 256 colors.

Photoshop 5.0 -> Image menu -> Mode -> Indexed Color

Graphics Gale (http://tempest-j.com/gale/e/) -> All Frames -> Color Depth

Other versions of PaintShop and Photoshop might be different, so this may or may not be of use to you.

#10597 - tepples - Wed Sep 10, 2003 1:33 am

GIMP -> Right-click image window -> Image -> Mode -> Indexed...
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#10598 - IAMTHEEVILBEAN - Wed Sep 10, 2003 2:33 am

Ok.....I make a tile put it in and the screen turns vanilla colored.....thats all that happens lol what to do what to do
_________________
Moose

#10605 - Nessie - Wed Sep 10, 2003 2:46 pm

From the mapEd "help" doc....
Quote:
Note! MapEd currently will take the first tile of the first tileset and paste that across all layers. Future versions may provide more flexibility with layer initialization, but the simple way around that with the current version is to ensure that the first tileset loaded has a fully transparent tile in the upper-left corner of the tileset.

Maybe this is what you are seeing?

#10607 - goro - Wed Sep 10, 2003 3:00 pm

Isn't there a way to initialise the value of the first tile in the outputted array to 'transparent'?

An advanced version of the above tip would intelligently re-shuffle the 256 color palette and Since it is designed for 16 color tiles, it would put transparent colors in the right places in the palette output array.
i.e. The GBA hardware expects it at the beginning of each 16-color palette :-
indices 0, 16, 32, ..., 240 for 16-color images.

This would be quite a bit of work though so it's not a request Nessie,
Just one way of eliminating the 'manual re-shuffle' stage of development.

#10613 - col - Wed Sep 10, 2003 4:26 pm

goro wrote:

...it would put transparent colors in the right places in the palette output array.
i.e. The GBA hardware expects it at the beginning of each 16-color palette :-
indices 0, 16, 32, ..., 240 for 16-color images.


This would destroy the '17th' palette !

the first entry in each 16 colour palette is ignored in 4bit mode, however, these lost colours can be used by another layer using 256 colour mode !

cheers

Col

#10615 - goro - Wed Sep 10, 2003 5:24 pm

Quote:
This would destroy the '17th' palette !

the first entry in each 16 colour palette is ignored in 4bit mode, however, these lost colours can be used by another layer using 256 colour mode !


True, but it seems this program is designed primarily for use with mode 0, so in this case it would be perfectly acceptable and would aid productivity. -Personally I like to stick to 16-color palettes.

But maybe it could just detect the amount of (16-color) palettes used and then just replace the (first) indices of those...

Then it would be no different to any other approach when using 16-color palettes, just time-saving.

#10616 - Nessie - Wed Sep 10, 2003 5:35 pm

Maybe it's a bit too early in the morning or something, but I've read both your posts several times goro, and I'm sorry, but I'm not really sure what you are talking about.

I'm not at all trying to be difficult..it's just that if you are on to some useful feature that would help me out on the project I'm working on, well, it would be the kind of feature I'd gladly add.

So, maybe some clarification or something would help me....or maybe a strong pot of coffee.

#10617 - goro - Wed Sep 10, 2003 5:43 pm

I was talking about eliminating the 'phase' where you get your tiles into
graphicsgale and manually re-arrange the palette to fix transparency issues.


I'm a bit of a newbie so I'm probably suggesting something ridiculous again.
Feel free to ignore my nonsense or to mock my stupidity.

#10618 - goro - Wed Sep 10, 2003 5:57 pm

eg. So PalOut.cpp
Code:
//  File generated by: Map Ed v0.94 Lite

const u16 backgroundPalette[256]ALIGN4 = {
0x0000,0x7c00,0x4000,0x7fe0,0x4208,0x03e0,0x0200,0x03ff,0x0210,0x021f,0x0110,0x001f,0x0010,0x7fff,0x6318,0x4210,
0x0000,0x7fff,0x7ff7,0x7fab,0x7f80,0x7f40,0x7ec4,0x7e66,0x7e07,0x7a54,0x7e10,0x7590,0x0000,0x03ff,0x03f6,0x43e0,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
}; // backgroundPalette[]



would be edited by MapEd so :-

backgroundPalette[16] would = 0x0000 (transparent) instead of 0x6318
and 0x6318 would be move to a new location in the array (say, backgroundPalette[18].
(resulting in a palette that has been completely re-shuffled to have transparency in the
right places (ie. in the first index of every 16-color palette).

Now (in TilesOut.cpp) all references to background[16] would have to point to backgroundPalette[18].

Note : Maybe this isn't the best way to fix 16-color transparency issues but it's one way of doing it.

Once again - I might be talking a lot of crap so feel free to ridicule me.

#10631 - FluBBa - Thu Sep 11, 2003 9:19 am

If you use 16color tiles they are 16 colors, you can't remap a color to something like [18]. And color 0 of the 16 is allways transparent no matter what you write to that palette position. If you use 256 colors you only have to worry about color 0 also.
Am I missing something big again?
_________________
I probably suck, my not is a programmer.

#10633 - goro - Thu Sep 11, 2003 9:38 am

Quote:
If you use 16color tiles they are 16 colors


If you use 16 colors, you get 16 x 16-color palettes, but you can only use (16 x) 15 of those colors.

the palettes are stored next to each other in a big array (say palette[255]) an the first palette starts at palette[0] and
ends at palette[15] (and the second palette sits next to it, starting at palette[16].
so palette[0] would be transparent and so would palette[16], palette[32], palette[48], etc.

Now most graphics-editing programs (like photoshop or paint) don't care that you want to reserve these palette entries
for transparent palettes. So we need to move the colors that are at palette[0],[16],[48] etc to new locations in the array (while ensuring that the tile data makes correct references to the appropriate palette entry).

We can do this at the graphics editing stage by loading our bgs into something like graphics gale and manually re-shuffling
the palette but it would be useful if the map editor could eliminate this (small) stage of development, leaving us to
contemplate on more important things like who ate the last donut.

#10650 - Nessie - Thu Sep 11, 2003 3:59 pm

I'm not really sure what you gain from using file formats that support transparent colors, the main formats being .gif and .png. Unless I'm mistaken those formats only allow you to specify one transparent color per 4-bit/8-bit image.

Now we all know that if you are working in 16 color mode, you've got 16 color banks to work with. Now how do you specify the other 15 transparent colors using those formats? As far as I know, you can't.

So, I specifically designed mapEd to allow multiple tilesets loaded at once...and furthermore, I figured that each tileset should be able to use multiple 16 color banks.

From that angle, I decided that .gif and .png really offered no benefit over any other format.

Which leads me to, it seems just as easy to draw the artwork with correctly built palettes in the first place, and then there is no extra work to be done either by you or by me. Of course I'm not much of an artist, and the skyPage.bmp sample in the sample.zip file provided with mapEd isn't much of a sample, but it does roughly show what I mean. (or at least I think it does, heh)

Of course, if I'm still not understanding the problem, I'd really love to figure out where I'm not understanding, heh.

#10656 - goro - Thu Sep 11, 2003 5:48 pm

Hi Nessie, Sorry for being so unclear but I wasn't referring to .png or .gif files.

I'll try to explain again but I don't think that the problem is relative to you if your artist draws with the palettes appropriatly sorted.

so-

supposing someone did their artwork in photoshop or paint (as many people do),

There would be 2 problems with their .bmp files -

1. The transparent color would be in the wrong place (somewhere other than backgroundPalette[0]

2. The other transparent indexes (background[16],[32], etc would contain colors that would be lost.

A solution would be a palette re-shuffle agorithm.

-I was talking about adding that algorithm as a menu-option in MapEd.