Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: JLM on Tue 25/05/2004 13:47:09

Title: Shadows for characters
Post by: JLM on Tue 25/05/2004 13:47:09
I'd like to know if it's possible to make some kind of shadows for characters? I don't mean "dynamic shadows", but just darker areas under characters that "follow" them everywhere (like in Quest for glory 4).

Is there some way to do this?
Title: Re: Shadows for characters
Post by: Scorpiorus on Tue 25/05/2004 15:47:00
Yeah, you could have a shadow as a separate character and use a FollowCharacterEx() function to keep the shadow just under the normal character:

FollowCharacterEx (SHADOW, Character, FOLLOW_EXACTLY, 1);

Also use SetCharacterTransparency (SHADOW, 50) to add transparency for the SHADOW "character".

Hope that helps :)
Title: Re: Shadows for characters
Post by: stuh505 on Tue 25/05/2004 16:00:10
or you could make the shadow part of the character and use a 32-bit sprite wher the alpha channel is gray under the shadow so its transparent
Title: Re: Shadows for characters
Post by: Darth Mandarb on Tue 25/05/2004 19:27:30
[yoda] yes ... to Stuh505 you listen ... has it right he does. [/yoda]

That's exactly how I'm doing it in a project I'm working on.

There are some areas where it looks a little off, but on the whole, it's perfect!
Title: Re: Shadows for characters
Post by: Janik on Tue 31/08/2004 18:33:05
How does that look if, say, the character walks to the edge of a cliff (or pier or wall) and the shadow is superposed on a vertical edge, but not following it? (I hope you see what I mean).

Ideally, there would be a way to define a "shadowable"-area, the shadow would only be displayed on this flat surface. Anything vertical, like the cliff or wall, would have no shadow at all (for simplicity, we're not about to start calculating volume shadows in 3D).

I'm only beginning in AGS, but is that something possible? Or is that a feature request?

Thanks,

Janik
Title: Re: Shadows for characters
Post by: Pumaman on Tue 31/08/2004 20:22:14
Something like that would be possible, but it's adding a fairly complex bit of new functionality, for not much gain. Bear in mind also that people would want the sun to be in different locations so the shadows would act differently, and so forth ... really, shadows aren't something that can be done properly in a 2D game.
Title: Re: Shadows for characters
Post by: Janik on Tue 31/08/2004 21:40:15
Yeah, that's what I thought. As a (part-time) programmer myself, I know how easy it is to ask for something, and how much harder it is to actually do it!

By restricting the shadow to a small circlish area under the character, you would avoid most of the trouble. And by setting the walkable area with just a little border around walls/cliffs, big enough so that the shadow doesn't reach the wall, you avoid the rest of the problem.

More fancy scripting would turn the shadow on/off when you step in specific areas (like in the shadow of a building for example). That would be cool.
Title: Re: Shadows for characters
Post by: Gilbert on Wed 01/09/2004 02:31:37
Hmmmm Shadow areas... bring good old memory...

[Ignore this if you didn't understand it, I think not many people would understand it now := ]
Title: Re: Shadows for characters
Post by: Pumaman on Wed 01/09/2004 20:43:01
Hehe yes blimey, even I'd forgotten about those  :=