Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Gregjazz on Tue 03/08/2004 23:45:21

Title: Suggestions for AGS...
Post by: Gregjazz on Tue 03/08/2004 23:45:21
Well, maybe that's a bad title. I wouldn't have wanted to say "requests for AGS", because that sounds a bit pushy. Anyways, here are some additions to AGS that would be (for me) extremely cool:

1. Embed AVI files used in a game into the .exe or a separate bundled file.

2. Transparency of objects and characters while using alpha blending. (this would be very useful)

And finally (this has been mentioned before):

3. Alpha blended walk-behinds. That way you could have anti-aliased edges in a walk-behind, so when your character walks behind a desk, it would shade it smoothly, rather than looking kinda choppy.

Thanks!

Greg
Title: Re: Suggestions for AGS...
Post by: Gilbert on Wed 04/08/2004 02:28:58
Hmmm I think 1 had been discussed about long long time ago. The problem was it's probably difficult to tell the system to play a movie file embedded in a data file. Actually even many commercial games (at least in my era) didn't made special treatments to their movie clips, they just lie around in the folders, so most of the time you can just drop them in M$ Media Player and play them, sometimes they just rename them as a disguise (you can do that in AGS games).

/me actually hates adding FMVs to AGS games, it's not utilizing the engine and furthermore they can't be played under DOS.

For 2 and 3, I think they can be useful (though they're useless to me as I probably won't go beyond 256 colours).
Title: Re: Suggestions for AGS...
Post by: Kweepa on Wed 04/08/2004 02:54:03
2. You can't do that already? That's a shame. Sounds useful.

3. The concensus on alpha-ed walk behinds was that it would blend to the wrong colour, and that you should just use an alpha blended sprite in front instead. You can keep the non-alpha portion of the walk behind, and just separate out the alpha-ed border as a sprite.

Steve
Title: Re: Suggestions for AGS...
Post by: Darth Mandarb on Wed 04/08/2004 05:10:37
2) Couldn't you just create the transparency within the alpha channel?Ã,  Instead of the alpha channel being black for the main parts of the sprite/character just use a shade of grey (depending on what level of transparency you want.)Ã,  Shouldn't that work?

I haven't played around with the alpha blending in AGS much.
Title: Re: Suggestions for AGS...
Post by: Kweepa on Wed 04/08/2004 06:00:01
You could, but I think Geoff wants to change the transparency on the fly.
Title: Re: Suggestions for AGS...
Post by: Gregjazz on Wed 04/08/2004 20:43:15
Yes, change it "on the fly" using the SetCharacterTransparency function.

Steve, why would it blend to the wrong color? The way alpha blending works is that there are two images involved: one which contains the colors, and the other determines the mix between the background color channel and the sprite color channel. Experiment with Photoshop and you'll know what I mean.

Using a sprite as a walk-behind would be no different than using a walk-behind with an alpha channel. It would simply make it much easier and logical to use alpha-blended walk-behinds.
Title: Re: Suggestions for AGS...
Post by: Pumaman on Wed 04/08/2004 21:04:27
1. this has been discussed before and is technically impossible as far as I am aware

2. this is a possibility but would slow things down as each pixel would then require a two-stage alpha calculation; I'm not sure how viable it is.

3. interesting suggestion - I guess you'd have to be able to import an alpha channel to the mask as well as the main mask. I'll consider it.
Title: Re: Suggestions for AGS...
Post by: Gregjazz on Wed 04/08/2004 22:43:08
Is there any other way I can mask the AVI files? If I simply rename them to something other than an AVI, will AGS still be able to play them?

As for my second suggestion (transparent characters), the reason I was suggesting it, is because I use it to hide a character completely. Maybe instead you could implement a "HideCharacter" and "ShowCharacter"? But I could probably accomplish that by making a function that would change the character's view to a blank image. The "HideCharacter" and "ShowCharacter" idea would make sense, because you already have that "Hide player character" checkbox when editing rooms.

The reason I'm making all these suggestions is because we're beginning work on The Find, which will use AGS to it's fullest extent (hi-res, alpha blending, etc.).

EDIT: By the way, thank you so much! :)
Title: Re: Suggestions for AGS...
Post by: Kweepa on Thu 05/08/2004 01:14:11
Why alpha-ed walk behinds won't work...

Let's consider a pixel on the border of an alpha-ed walk behind - it's 50% transparent.

Let's call the background BG, the foreground FG, and the object walking between them OBJ.

Now, without the object, the border is FG/2 + BG/2. This is the colour in the image, IM.
With the object, the border should be FG/2 + OBJ/2.
BUT, using a walk behind technique, the border will be IM/2 + OBJ/2 = FG/4 + BG/4 + OBJ/2.

Hence there will be a bit of the background visible through the object. Not pretty!

Steve
Title: Re: Suggestions for AGS...
Post by: Radiant on Thu 05/08/2004 14:29:04
Quote from: Geoffkhan on Wed 04/08/2004 22:43:08
Is there any other way I can mask the AVI files? If I simply rename them to something other than an AVI, will AGS still be able to play them?
I'm reasonably sure KQ2+ does this. Try it!

Quote
As for my second suggestion (transparent characters), the reason I was suggesting it, is because I use it to hide a character completely. Maybe instead you could implement a "HideCharacter" and "ShowCharacter"? But I could probably accomplish that by making a function that would change the character's view to a blank image. The "HideCharacter" and
yes, that is easiest, or simply move the character to coordinates that are way off-screen.


function ToggleCharacter (int ch) {
  character[ch].x = character[ch].x ^ 1024;
}



Title: Re: Suggestions for AGS...
Post by: on Thu 05/08/2004 18:22:18
Quote from: Geoffkhan on Wed 04/08/2004 22:43:08
If I simply rename them to something other than an AVI, will AGS still be able to play them?
I'm not completely sure this would work, you may have to download a msuic converter...

Quote from: Geoffkhan on Wed 04/08/2004 22:43:08
Maybe instead you could implement a "HideCharacter" and "ShowCharacter"?
Do you mean like the Hide Spell in QFG 4? I'm not sure how to do this, perhaps this helps others...
Title: Re: Suggestions for AGS...
Post by: Gregjazz on Thu 05/08/2004 21:01:13
Quote from: SteveMcCrea on Thu 05/08/2004 01:14:11
Why alpha-ed walk behinds won't work...

Let's consider a pixel on the border of an alpha-ed walk behind - it's 50% transparent.

Let's call the background BG, the foreground FG, and the object walking between them OBJ.

Now, without the object, the border is FG/2 + BG/2. This is the colour in the image, IM.
With the object, the border should be FG/2 + OBJ/2.
BUT, using a walk behind technique, the border will be IM/2 + OBJ/2 = FG/4 + BG/4 + OBJ/2.

Hence there will be a bit of the background visible through the object. Not pretty!

Steve

What you described (IM/2 + OBJ/2 = FG/4 + BG/4 + OBJ/2) would indeed work. Yes, a small percentage of the background would show, but that's the way it should be!

I still don't understand why you think alpha blended walk-behinds wouldn't work.
Title: Re: Suggestions for AGS...
Post by: Kweepa on Thu 05/08/2004 21:27:48
No, it should be FG/2 + OBJ/2.
And that's why this technique doesn't work.

It's tricky to do in photoshop, but eventually I managed it...

(http://www.mccrea.demon.co.uk/step/ags/badalpha.png)
Left: what you want, Right: what you get

Subtle but ugly.
Title: Re: Suggestions for AGS...
Post by: Pumaman on Thu 05/08/2004 23:00:52
Quote from: Geoffkhan on Wed 04/08/2004 22:43:08
As for my second suggestion (transparent characters), the reason I was suggesting it, is because I use it to hide a character completely. Maybe instead you could implement a "HideCharacter" and "ShowCharacter"? But I could probably accomplish that by making a function that would change the character's view to a blank image. The "HideCharacter" and "ShowCharacter" idea would make sense, because you already have that "Hide player character" checkbox when editing rooms.

Ah well, if this is all you need, it's certainly viable yes. If transparency is 100, making it simply not render the sprite would be easy enough.
Title: Re: Suggestions for AGS...
Post by: on Fri 06/08/2004 02:37:16
Nope, in that instance, it should be a half-and-half mix of both objects. You would not see any background in it.
Title: Re: Suggestions for AGS...
Post by: Kweepa on Fri 06/08/2004 06:24:05
Yes. You would. Look at the picture.
Case bloody closed.

Now if they were both OBJECTS, then obviously you wouldn't see any background.
But because the walkbehind uses a single image + alpha, you can't avoid mixing in some background.

What about that Apprentice II? Hell of a game. *Whistles tune*
Title: Re: Suggestions for AGS...
Post by: Gregjazz on Fri 06/08/2004 07:47:36
Okay, I see what you're talking about. The deal with the walk-behinds is that you wouldn't have to take a background layer into account. It's just an object and a foreground, like a character standing behind a desk.

Anyways, how does Photoshop account for this problem?

Well, I suppose I could just use objects as walkbehinds for the time being. :)
Title: Re: Suggestions for AGS...
Post by: on Tue 10/08/2004 14:01:13
Display the relative mouse coordinates in a status bar of some kind when viewing a background (with or without hotspots or walkable areas... visible)

this would make it easier to quickly get correct coordinates for characters.

It would also be great if there are two kind of coordinates displayed - the actual pixel coordinates and the game cooridnates...

just my 0.02
Title: Re: Suggestions for AGS...
Post by: Pumaman on Tue 10/08/2004 20:28:38
The mouse co-ordinates are already displayed in the hotspot/walk-behind editor, I'm not sure what you're asking for.
Title: Re: Suggestions for AGS...
Post by: on Wed 11/08/2004 23:54:19
 :o i'm blind!

I just expected a statusline at the bottom... hmm... seems i was tricked by my habits.

Thanks for reading and thumbs up for AGS! i really like it.