Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: EnterTheStory (aka tolworthy) on Sat 08/12/2007 08:55:05

Title: tinting / light maps (SOLVED more or less)
Post by: EnterTheStory (aka tolworthy) on Sat 08/12/2007 08:55:05
I am converting a game from another engine (Sludge) to AGS. Many of my rooms use subtle light maps - room sized images that are light in some parts and dark in others, with gaussian blurs in between. Is there any way I can make use of these in AGS? The "light levels" option seems very crude in comparison. This is the first essential feature I have found that seems to be missing from AGS, but maybe I'm just not looking hard enough.

Also, the help file says "Light levels only work when the character's graphic is at the same colour depth as the background (ie. a 256-colour character in a hi-colour game won't get lightened)."

Is this still true? I have a high colour game and my sprites are all greyscale FLCs. Converting them to high color would add many megabytes to the file size and add an extra level of inconvenience. But perhaps I'm just being lazy.
Title: Re: tinting / light maps
Post by: scotch on Sat 08/12/2007 09:47:54
Could you explain exactly what they do in SLUDGE? Is it like the AGS region light levels, but allowing for smoother transitions? Does it do coloured lighting, or just brightness?

It's possible you could work out a way to use your light masks but it doesn't sound like there is a built in way.

Don't know about the tinting colour depth issue.
Title: Re: tinting / light maps
Post by: EnterTheStory (aka tolworthy) on Sat 08/12/2007 11:29:24
Sure. In Sludge, a 16 bit imnage can be used as a light map, in two modes. Mode 1 simply adds the pixels together. E.g. if the scene has a red pixel and the light map has a yellow pixel, the result will be an orange pixel. Mode 2 only looks at the pixel where the character is standing, so the whole character is tinted with the same color. These are useful for entering dark areas, walking behind shadows, etc. In my game I have about twenty  underground rooms (which require subtly changing shades of grey), another twenty forest rooms (which require leaf shadows), and most important, I use a pale minimalist art style where the player's feet are not seen (so white ground must make feet white, grey ground make feet grey, etc.). Subtle light maps are quite important!

Quote from: scotch on Sat 08/12/2007 09:47:54Don't know about the tinting colour depth issue.

My initial tests seem to show that it's true (changing the color had no effect on my greyscale sprites) but I'm new at AGS, so hopefully I was just doing something wrong.
Title: Re: tinting / light maps
Post by: Ashen on Sat 08/12/2007 11:49:01
How about something like this suggestion of InCreator's (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=20848.0) use a Room-sized graphic (assigned to an Object or Character) with an alpha channel, to overlay areas of light/dark. That's probably the best way to achieve leaf shadows, etc, as AGS' lighting system is strictly 'Mode 2' from your description (value at character/Object baseline is applied to whole sprite).

However, I think the manual actually means "Light levels only work when the character's graphic was imported as at the same colour depth..." When you import a 256-colour sprite (or a bunch of them from an flc) into a hi-colour game, they're internally 'upgraded' to hi-colour by AGS. That might not be the most acutate description, but I think the effect is the same - if you imported your sprites with the game set as hi-colour, lighting should work. The problem, AFAIK, would be if you imported all your sprites at 256, then changed the games colour depth. (Copying the sprite to clipboard, then re-importing it over itself should clear that up - time consuming, but not as bad as having to re-save and re-import everything.) Obvious thing to check, but have you enabled the 'Use Room area lighting' option (or however it's worded in your version) for Objects? And, is the Character/Object actually standing in the region, not just overlapping it?

Quote
I use a pale minimalist art style where the player's feet are not seen (so white ground must make feet white, grey ground make feet grey, etc.)
Why not jus make the feet transparent on the sprite? That way they're never seen, without having to change their tint repeatedly (which isn't simply done).
Title: Re: tinting / light maps
Post by: EnterTheStory (aka tolworthy) on Sun 09/12/2007 05:12:36
Sorry for taking so long to reply - unexpected long day at work.
Quote from: Ashen on Sat 08/12/2007 11:49:01...with an alpha channel ... Why not just make the feet transparent on the sprite?
Good advice. I suppose that's what I've been avoiding, unconsciously. I want to have all the benefits of a 32 bit game without the 32 bit overhead. :)