Troubles importing a walk-behind mask

Started by fratello Manu, Wed 18/11/2020 08:44:30

Previous topic - Next topic

fratello Manu

Hi everyone,

since I'm wasting a lot of  time on this, I try asking here.
I tried every way but I couldn't figure out how to import a working walk-behind mask. Without this mask I can't define the walk-behind areas, which would be too complicated to be hand-painted of AGS room editor.

So, from my external map editor I create a pic with just the areas which has to become a walk-behind: I just keep visible the layer containing these areas and save the pic. The result is a pic with too many colors.



According to AGS message, I have to upload a .bpm 8 bit and 256 colors image, and the first 16 colors will be used to define the walk-behind areas.

So with GIMP or PINTA as well I try to obtain a 2 colors image: a background color and a color for shapes.
I de-saturate the image and then I increase brightness and contrast to maximum and I get an image with white shapes and black backround.
Then, I didn't catch how to properly save as a 256 color image (I tried to select indexed-mode with maximum of 255 or 256 colors as well, but AGS keeps telling me it's not the proper format).

So, I load the image in MSPaint and save as 256 colors. Before saving I replace the white shape color with a color between the first 16 in palette, e.g.



Now  AGS seems to be happy with my image format, but... nothing happens.
The color I chose seems not to feed any walk-behind area.

I tried every possible way but I can't get it to work.

Any suggestion?

Thanks!
bye

Manu


Crimson Wizard

If I remember correctly, the colour should match or be as close as possible to your game palette slots. For instance, slot 1 is RGB (0,0,168), but simply full blue (0,0,255) will work too. You may check game palette on "Colours" pane, "palette" tab.

Khris

#2
Did you save the image as 256-color bitmap (*.bmp)? If I do that, it works on the spot. I used PaintShopPro 7 and first cranked up the contrast until I had bright red on black. Then I reduced the colors to 256 and picked the reduction method that PSP suggested. The palette turned to 256 swatches instead of the regular color gradient thingy. The first slot was now black, the second was red.  Saving that as 256 color bmp and importing it put all red areas as walkbehind #1, exactly as desired.

Anyway, it won't work with a single color / area. Walkbehinds have a baseline that AGS uses to determine whether to draw them in front of or behind objects / characters. Which means you need to decide on a Y coordinate for each of these areas (typically the vertical center of the "footprint"), then group them so you can use a single walkbehind color for multiple objects that are roughly on the same y coordinate (you can't have more than 15 walkbehinds in a room).

You can also use non-clickable objects instead.

Depending on how many of these rooms there are going to be in your game, its probably less work to implement reading the map editor's files and creating your own "graphics engine" inside AGS...  :-D

eri0o

#3
If you create an image with indexed colormode and the palette has EXACTLY 256 colors, then you can import it as walkable area or other type of room mask. The size has to match the room background exactly too.

If you are going this route, on the indexed palette, the FIRST color will be the 0 (ERASER) in walkable area, the second color in the indexed palette will be the 1 (Walkable 1, the blue one), the third will be the 2 (Walkable area 2, the green one), and so on.

This is an example of a valid mask from my game.

If you can, use Aseprite since it's easier to deal with pallettes in it. People also say good things of Graphics Gale.

fratello Manu

Quote from: eri0o on Wed 18/11/2020 09:40:47

If you are going this route, on the indexed palette, the FIRST color will be the 0 (ERASER) in walkable area, the second color in the indexed palette will be the 1 (Walkable 1, the blue one), the third will be the 2 (Walkable area 2, the green one), and so on.

If you can, use Aseprite since it's easier to deal with pallettes in it. People also say good things of Graphics Gale.

Hey, thanks a lot! Thanks everyone for helping.

Actually, I already set up *almost* everything as you guys wrote. But, I didn't realize that none of the image editors I was using, was showing me the real palette with the colors in the proper index. (I don't know why, I'm more experienced in programming than drawing...)

So, using GraphicsGale i finally understood which color I had to use!


SMF spam blocked by CleanTalk