Hi, I'm having trouble getting Alpha channels to work with AGS and photoshop.
I made a crude character in photoshop 7, added an Alpha channel and painted it to make the player opaque, and add a semitransparent gray shadow. Here is the file:
http://www.dmgenie.com/ags/Test%20Alpha.psd
Problem 1: Photoshop won't let me save the Alpha Channel (the checkbox is uncheckable) when I "Save As" a .TGA or .PNG.
So I go to ImageReady and use Export Original to save as a TGA. That seems to work. When I import that into AGS, it asks "Use the alpha channel?". I say yes-Ã, but the shadow is just a black, opaque area. I have transparency only with the BG color in the topleft corner, same as if I had no alpha. >:(
Any hints? Is this an AGS problem or am I doing something wrong in photoshop? I couldn't search the forums because of some database problem, sorry.
Thanks!
Janik
All of my sprites use alpha channels made in photoshop and exported into AGS...haven't had any problems with semitransparency.
I just click the tiny hidden "make new channel" button on the channels window...draw my stuff...save as tga 32 bit (the 8 bits after 24 are for the alpha channel).
when you import into AGS, you select the TGA file for the sprite...sometimes when I am importing into AGS it randomly will not get the alpha channel, in which case I just try loading it in again (havent been doing this in a while so my memory is not so crisp)
Which version of Photoshop are you using?
A famous Adobe cock-up going from 6 to 7 (I believe) was that they changed the way TGA alphas worked. You'll need to go to the Adobe website and download a new TGA file plug-in and the alpha channels will be hunky dory!
As for AGS, sorry - never used alphas in that one yet.
That was it! It was that "feature" in photoshop 7 that was causing the problem. Here's some info I found on the net about it.
QuoteThe Targa file format specification reserves the fourth channel of Targa files for transparency. The Photoshop 6.x Targa plug-in, however, uses the fourth channel for an alpha channel.
The Photoshop 7.0 Targa plug-in conforms to the Targa file format specification, reserving the fourth channel for transparency
After installing the new plugin, it works fine now in AGS. Shadows under the character, yay!Ã, :D
Edit: I see now how there's no anti-aliasing for the alpha sprites - is there a specific reason why that is?
I too am using this method to create shadows under my characters for 2 projects I'm working on. It works great!
I was wondering when somebody else was going to do this too ...
Yes, alpha channel is a blessing. Not only for shadows, but also anti-aliased sprites, effects like glowing, etc... fantastic thing.
Quote from: Darth Mandarb on Mon 18/10/2004 04:48:01
I too am using this method to create shadows under my characters for 2 projects I'm working on.Ã, It works great!
Are you making the shadow a part of the character sprite?
I'm thinking of making the character in one set of sprites; and a second character would be the shadow with his own sprites, for a couple of reasons:
1 - With the character with no alpha, anti-aliased scaling works, and that looks a lot better when scaling cartoonish characters. Especially with continuous scaling.
2 - The shadow can also be turned on and off as nessary (I'd use a property of walkable areas like "NoShadow", and some global script)
Then the problem remains of making 2 sets of sprites, and scripting it such that the animation matches, and the the shadow character follows correctly.
Hmm... Now that I think about it, it isn't even necessary to use alpha for a shadow-only character; you could just set the opacity to 50% or so and have an opaque black sprite.
It's all done in one character.
I'm not scaling characters (my background style makes it unnecessary).
I can see the advantages of turning the shadow on and off, but I figured if it was ever necessary I would use a different character view (without the shadow) rather than having another character following him around. I've had better success with changing the character views than making a character follow exactly.
Either way, as Igor said, it's a blessing!
Can you save Alpha Channels with PaintShop Pro (7 or 8) too?
--Erwin
Hang on we've only loosley solved HALF the issue here.
AGS supports PNG files too. Targas and PNGs both support imbedded alphas. PNG files does not support an alpha channel per say but it rather imbedded transparency in the rgb channels.
If anyone didn't previously know what an imbedded alpha channel is then I beleive I'm wasting my time.
Alphas simply dont bloody work correctly. I use Photoshop CS2 and somehow, AGS can not deliver when it comes time to import my PNG files. I get horrid artifacts around my sprites which are opaque in the game.
If I open my PNG files with MS paint the same artifacts are visible. AGS is going to have to compensate for the newer file format and the way it handles alpha channels because I'm not about to email Adobe and tell them to correct their code to fit my needs.
This is simply rediculous and an absolute disaster for game development.
Somebody please fix the alpha channel problem for good.
I'm sick of it.
All that the artist should be required to do is paint a sprite onto a transparent background in photoshop (shadows or whatever).
None of this 'add and alpha channel and paint i the opaqness manually' buisness. What is that? I can't understand why somebody creating game art would actually go about it this way. Nothing but a tedious and an unessicary waste of time.
If you want a seperate alpha channel that is not imbeded (rather restrictive) then use the calculations feature in Photoshop. Sheesh.
For someone creating shadows and antialiased sprites for use with AGS then I suggest you stick with imbedded alphas. Otherwise your dealing with premultiplied alphas and all that jazz.
Let me give some advice.
If you have a character painted with a shadow and collapsed to a single 'background' layer in photoshop, when you create your alpha channel using calculations, your shadow is going to turn up funny. Can anyone guess why? Because the antialiased edges of your alpha chanel are most likely pickign up some of that white background surrounding the character and it's shadow. To have a shadow with non imbedded alphas it would be wise to have the character on a black background or supply the sprite with an extra bit of body around where the alpha is going to cut through.
It's so much easier to just paint your character and shadow and merge it into a single layer with a transparent background and save it as a png.
I hope all this talk about AGS antialiasing alpha blended sprites is not to do with he fact that most of you, including chris, just don't get the whole alpha thing. Antialiasing in AGS and using alphablended sprites are mutually exclusive ways of having jaggy free graphics. It's futile and rediculous to combine the two approches.
I swear I'm I talking to a bunch of programmers attemting art.
Look, sorry in advance for my frustration and synical remarks but understand, this alpha business needs to be fully understood and applied to AGS correctly.
At the moment, for many, the feature is as good as gone.
Are we all on the same page?
Beers.
Uh, yeah...Anyway, as Darth was saying, Followcharacter does NOT work well under certain conditions. When I made Mind's Eye I wanted a warped transparent version of Noah following him around. This works fine for about 60% of the time, but whenever you call anything that locks game action (such as a Block) the following character will stand where he was until that Block call ends. Obviously that's an impractical thing for a shadow to do, so the only functional way to do it that I know of would be through the alpha channel.
Those posts are from last year, Progz. ;) (Well, two years ago now.)
subspark's wasn't.
Quote from: ProgZmax on Sun 01/01/2006 09:59:55
. Obviously that's an impractical thing for a shadow to do, so the only functional way to do it that I know of would be through the alpha channel.
i have a way that works 100%, without using alpha channel in photoshop or anything like that:
i also use a different character as my shadow for my mordy 2 game. i make this shadow character about 35% transparent, and then when i have to move my main character, i use "eNoBlock" in the "walk" function, and then, just after that i use a little function that Buloght wrote for me, which makes the shadow follow the maincharacter, and also does the "block" function manually. also, ull have to do a little function for the baseline of the shadow, so that the shadow doesnt appear over the character. ill release the code after the game is out, if someone is interested, and buloght doesnt mind.
Mordalles- my point is that if you call a blocking function on the player at any time, such as a walk over to pick something up or change in mid-stride, the followcharacter thing breaks. It's fine if you never need block routines or handle things through wait states but that tends to be messier than just using an alpha channel.
I don't know what's the thingy with alpha channels, i think easiest thing is to draw anything semi-transparent on the "transparent" background and save it as PNG, i do it with Paint Shop Pro 10 and it works normaly...
Quote from: ProgZmax on Sun 01/01/2006 22:13:33
Mordalles- my point is that if you call a blocking function on the player at any time, such as a walk over to pick something up or change in mid-stride, the followcharacter thing breaks. It's fine if you never need block routines or handle things through wait states but that tends to be messier than just using an alpha channel.
So don't use followcharacter and just change the X and Y of the shadow character in the repeatedly_execute_always. Using alpha channels really limit what you can do with the shadow (including turning it off, having dynamic shadows or using separate walkbehinds for it).
progz - i remember doing this for mordalles. I didn't use the followCharacter function. I made a small function that is called in the repeatedly execute and it directly works on the X and Y of the shadow character.
Then for blocking i made a manual blocking function that is used in cutscenes and whatever. The character moves eNoBlock but the game waits for the character to arrive in a loop.
Right, I can see it working that way.
Quote from: ProgZmax on Mon 02/01/2006 10:14:40
Right, I can see it working that way.
good for you, mate.
This was an issue for me for a while, but I sorted it out to my own satisfaction...I use PaintShop Pro 7, and save all my sprites as PNGs before I import them into AGS. When I draw my stuff (using vector graphics) I check off Anti-Alias, then select Export, PNG Optimizer off the File Menu, and make sure it's got Alpha Channel Transparency: Existing Image or Layer Transparency selected, then save it as a PNG. When I upload it to AGS, I click yes for use alpha channel, and it's never given me any problems.