Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: thiezar on Mon 06/12/2010 18:34:48

Title: Rectangular character baseline? [solved]
Post by: thiezar on Mon 06/12/2010 18:34:48
Hi quys.
I have a "large" character with a problem with walkable areas. I know characters have their base at the bottom middle of the sprite and walkable areas are related to it. My character have a large base and when it come near a wall  it seems he walk on it. I should draw walkable areas a little smaller then the real walkable area but it needs a lot of trials and checking and it's never perfect, i always have to find a compromise, so i guess: is there a way to make the baseline of the character rectangular instead of a single pixel? If so, how?
Title: Re: Rectangular character baseline?
Post by: Khris on Mon 06/12/2010 19:26:57
No, that's not possible.
Since you don't have to draw the walkable areas in AGS but can import them, there's another way though.

-Open the background in a graphics program that supports layers.
-Add a layer and draw the walkable area on that, leaving a bit of space at the upper and lower edges but none at the left and right sides.

(http://i208.photobucket.com/albums/bb259/khrismuc/wa1.png)

-Now fill the rest of the layer with another color.
-Select that using the Magic wand, then paste it two times, first half the character's width to the left, then to the right, and a couple of times in between, if you want:

(http://i208.photobucket.com/albums/bb259/khrismuc/wa2.png)
(I moved the two layers 100px each, i.e. the character's width is 200px. That's a bit extreme but okay for the sake of the example.)

-Final step is to merge the layers and fill up the little holes:

(http://i208.photobucket.com/albums/bb259/khrismuc/wa3.png)

If you save that as 8bit PNG or BMP, you can import it in the room editor.

The same thing would also work with a character that's supposed to extend further to the front and back; in that case you have to cut away at the top and bottom using the same general method.
Title: Re: Rectangular character baseline?
Post by: thiezar on Mon 06/12/2010 19:47:55
This is a really good method. Never thought about it.
There is some work to do but, since a rectangular (or linear) baseline isn't possible, I guess this is the best way to keep a character in the right place. Thanks a lot Khris.