Problems with importing masks

Started by JohnnyDanger, Thu 06/01/2005 12:52:04

Previous topic - Next topic

JohnnyDanger

Hi

As the subject suggests I am having problems importing masks for walkable areas and I was hoping that you guys could help me out.
Soooo, I am using photoshop cs to create the masks and I am doing it as follows:
First I open the background image (which is in 640x480 16bit rgb color) and select the area that is going to be walkable and paint it in a different color on a new layer and fill the rest of the image with black.
Now, I reduce the resolution of the image to 320x240 and set the color mode to indexed.
After this I get the first blue color from this palette file http://www.agsforums.com/stdpal256.pcx and fill the walkable area with it (antialiasing and contiguos turned off) and save the image as an .pcx. Now when I try to import it ags tells me that it contains invalid colors. I also tried making a screenshot from the blue color in ags in case there is something wrong with the blue in the palette file but it didn't work either.
What am I doing wrong?

strazer

I'm not certain but I think you don't have to use the colors from the AGS editor. AGS just maps the mask's palette slots to the different walkable areas, i.e. color slot 1 is used for walkable area 1 (blue), slot 2 for walkable area 2 and so on.
Maybe your blue is in a color slot higher than 16?

Ashen

#2
Just to add to what strazer said:
It doesn't matter what colour you actually use, AGS just takes the first 16 (or 30, or however many of whatever area you're mapping (walkable, hotspot, etc) the version you're using allows) pallete slots and maps the area onto them. If you can (depends on the program you use), try decreasing the colour depth of your map to the absolute minimum of colours you need, then re-save it at 256 and see if that helps. (I find this usefull for getting the colours I've used into the first few slots). Also, keep in mind that slot 0 will be the empty space on screen, not Hotspot 1.

EDIT: Sorry, I have no idea why I was talking about hotspots, when the question was about walkable areas, except maybe that I work on hotspots more than walkable areas.
I know what you're thinking ... Don't think that.

TerranRich

Pallette Slot 0 (usually black): This is the entire room that is not walkable
Palette Slots 1-16: Walkable Areas 1-16. All other slots must not be used.

I will add this to the BFAQ...as soon as I get access to my damn server. :( It seems to be down.

EDIT: Oh...there it is.
Status: Trying to come up with some ideas...

JohnnyDanger

Ok so when it really doesn't matter what colors I am using why doesn't it work then?
Funny thing is that when I want to import the mask for a hotspot and not for a walkable area it gives me the same error message, but the importing works and I have the mask in ags in grey color instead of the blue it was supposed to be.
Is there maybe someone here who uses photoshop to draw his masks and would be so kind to explain to me how he does it? Sadly, I am rather unfamiliar with how to work with palettes in photoshop.

Gilbert

Well most windows programmes are crap in handling 256 coloured images (that includes Photoshop, obviously), the problem is that it's usually hard (if possible at all) to make or convert something into 256 colours (the order of the slots are usualloy undesired or messed up).

The editor finds an invalid colour because there're some pixels in the image which used colour index > the maximum area # of that kind of mask (29 for hotspots, 15 for walkable areas, so that's why sometimes a mask works for hotspots not walkable areas), which usually happens when you convert something to 256 colours in a windows programme.

As for the different colour thingie, it's just that the crappy graphics programme maps the colours to different slots than expected, for example colour 1 in the editor was dark blue, but your graphics apps happened to map a gray colour to slot 1, so all areas with that gray colour in your mask will become area 1 in your game (which is displayed as blue in the editor).

Other tips is that you must make sure the mask consists of absolute flat colours (no anti-alias, etc.) otherwise it'll end up in using more colour slots after conversion. AND, don't EVER save the mask in JPEG or any other lossy formats during any steps of its creation, as lossy compressions would add noise to the pictures which can add unwanted colours.

I think you may also try uploading the mask file here so we can investigate on its problems.

JohnnyDanger

hi guys

I've been away for a while but now I am back and sadly I am still having the same problem with the walkable area masks. This time I uploaded the mask file for you to check out. It is available here http://stud4.tuwien.ac.at/~e0027153/adventurium/walkmask.pcx
I even made a palette file in photoshop with the colors from the ags palette. You can download it here http://stud4.tuwien.ac.at/~e0027153/adventurium/ags.act
Any help would be highly appreciated! It's driving me insane :(

Ashen

Unless it's just the program I'm using, all your colours are in the last 16 pallete slots (240 - 255), which makes them out-of-bounds for map imports (as TerranRich and Gilbot have said). The palette in this version should be about right (again, with the program I'm using - an old version of Paint Shop Pro):
http://www.2dadventure.com/ags/walkmask2.pcx
I know what you're thinking ... Don't think that.

JohnnyDanger

hey, seems like you're right! who would have guessed that photoshop saves the colors the other way around...
thanks a lot!

Radiant

What I find usually works, is copy/pasting the walkbehind (etc) graphic into MS Paint, then saving as a 16-color bitmap.

Ashen

#10
Radiant:
But doesn't a map have to be 256 colour to import, even though it only uses the 16? I tried that (saving as 16 colour) a while ago, and it said there was a problem with the colour depths. Mind you, that was with an earlier version, so it might've changed now.

EDIT: It does, in fact, work. Sorry, just ignore this post.
I know what you're thinking ... Don't think that.

Radiant

I'm pretty sure that it works, given that I used it yesterday. But maybe you have to save as 256 color rather than 16,  try them both. The point is that copy/pasting in windows always uses 16-bit mode or up, so whatever palette your other graphics program uses is irrelevant to MS paint.

SMF spam blocked by CleanTalk