FadeIn & FadeOut

Started by Hobbes, Sat 30/04/2005 12:20:41

Previous topic - Next topic

Hobbes

Hey all,

Perhaps this is a very simple question. I hope it is. :)

Is there any way to change the speed with which the engine fades the rooms in and out?

Upon replaying Fate of Atlantis recently, I noticed the first few screens faded really slow. This, IMO, gave the game a very atmospheric opening.

My own game, however, fades from screen to screen very fast. I know it's also processor dependant to a degree, but can't the speed be set somewhere?

Oh, and I use AGS 2.62.

DoorKnobHandle

This should probably be in the beginner's questions.

The only way I know is to change the frame count by using the SetGameSpeed command right before you are fading and set to the standard 40 fps after.

Example:

Code: ags

SetGameSpeed ( 20 ); //  half of 40 - this will make the fade last twice as long as a normal one!
// FADE HERE!
SetGameSpeed ( 40 ); // now afterwards put the speed back to 40 or whatever fps you use (standard is 40)!


That should do it.

strazer

You can also fade in/out manually using the FadeIn/FadeOut commands.

DoorKnobHandle

Oh. I though he was already using those and even those are to fast for him.

Phemar


But if he is, then he could just set the speed in the variable, eg. FadeOut(5);, is the normal speed of room transition fadeouts. If he wanted it faster he could go FadeOut (10);...

DoorKnobHandle

Yes, but I thought that maybe FadeIn (1) or FadeOut (1) is still too fast for him, although that is really really slow...Ã,  :=

GarageGothic

On a related topic, the fade to/from black on room changes is VERY choppy in 32-bit mode on my computer (2.4 GHz P4, 128MB Geforce 4 Ti4200, 512MB). As soon as I switch to 16 bit mode, it runs smoothly.

The strange thing is that all other room transitions work fine. Crossfades, which logically should be even more demanding of the CPU, actually run much smoother.

Have others experienced this? Is it a bug or just a matter of "not wasting time on optimizing the code"?

Snarky

A workaround for you might be to crossfade to a black room instead of fading to black.

Ghost

another workaround would be to create a fullscreen gui in black, and then use the gGUINAME.Transparent value to fade it in real slow- that can be adjusted with wait(waittime).

Maestro

It's not exactly on topic, but can I make my room to transit to a next room like using viewports and to make the engine recognise that that is a new room with new objects and so on...
To explain: If I make my room in 320 x 240 res and 640 x 240 size, lock viewport to the left half of the background, then wait until the player stands on a region to the right, and then move the viewport to the right half of the background and lock it up again.

That's just one large room with no transition but my own fake one.
I'm wondering can I make my player leve the room by crossing the yellow line in the editor and use a "scroling transition" in the "player leaves room" part of the script?

Sorry about the spelling, english is not my native language.

Ashen

Quotethat is a new room with new objects and so on
what do you mean by this? Do you want to re-use objects (and hotpsots, etc) depending on which part of the room you're in? (e.g. object 1 could be a cooker in one part, and a lamp in the other)
I know what you're thinking ... Don't think that.

Pumaman

Quote from: Maestro on Mon 02/05/2005 13:07:39
That's just one large room with no transition but my own fake one.
I'm wondering can I make my player leve the room by crossing the yellow line in the editor and use a "scroling transition" in the "player leaves room" part of the script?

Yes, you can use the SetViewport command to manually scroll the viewport around the screen.

Maestro

I wan't to make two rooms and save them under names room1 and room2.
If the player leaves the room1 via door or simply walking to the edge of the screen, he goes to room2. Now, in the editor you can make that transition crossfade, block out etc. I'm wondering can I make AGS do that transition by making the room2 background scroll in to room1 background so it looks like the viewport moved to the next room.

Ashen

I think that was discussed a while ago, but search is down so I can't find it. The short answer, AFAIK, is that AGS doesn't include that type of transition.

In your case, the easiest solution might be to have a 'dummy' of the other room (i.e. both rooms would have to be 640x240, with half of the bg that looks like the other room, but without hotspots, etc) that you scroll to using SetViewport(), then do an 'Instant' transition to the actual room.
I know what you're thinking ... Don't think that.

strazer

#14
I've just now started working on a script module for that. With the new DynamicSprite.CreateFromScreenShot it's doable without dummy rooms.
My prototype looks promising, just a few minor things to fix. Watch this space.

Edit: Module now available here.

SMF spam blocked by CleanTalk