Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Joseph on Thu 15/10/2009 23:02:54

Title: Possibly the dumbest question ever
Post by: Joseph on Thu 15/10/2009 23:02:54
Hi fellow SmurfMunchers,

This could possibly be the stupidest question ever posted on the AGS forums:

What would be "better" for displaying a cutscene, an actual movie file (like avi, for example) or creating a View with the individual frames of the movie inside a loop and putting that View into a GUI...?

Im guessing the view with sprites looping could be heavier than just playing the movie, right?

Why would one use one of those methods versus the other?

Title: Re: Possibly the dumbest question ever
Post by: Virgil on Thu 15/10/2009 23:12:19
No, there have been dumber questions, and in the past day or two as well. I would think you would have more control with a movie with timing and pauses, instead of just plain frames. It'll also be easier just to make the movie than going in with sprites and doing trial and error.. I would think anyway.
Title: Re: Possibly the dumbest question ever
Post by: Khris on Thu 15/10/2009 23:21:47
I guess using an avi will take up much less space than individual sprites.
The only advantages of the sprite method I can see is you could pause the movie at any moment, play it backwards, twice as fast, etc. and prevent people from watching it without playing the game.

It depends on the length; I guess you'd need 20 sprites per second, so five seconds equals one hundred sprites.

You don't need to put them in a view by the way, just change the GUI background to the next frame, then Wait(2).
Title: Re: Possibly the dumbest question ever
Post by: Joseph on Fri 16/10/2009 17:08:30
Ah didnt know we could do it by changing the GUI background instead of a view...

...whats faster, using a View with a loop of sprites and animating that on the GUI, or changing the GUI background's image over and over and putting a Wait(2) in between each change?

Im guessing both methods would be just as fast?

Title: Re: Possibly the dumbest question ever
Post by: monkey0506 on Fri 16/10/2009 17:11:20
GUI's don't have an animation function directly. GUI Buttons do.

Both methods should be completely comparable given the same sprites.
Title: Re: Possibly the dumbest question ever
Post by: Gord10 on Fri 16/10/2009 17:58:19
Another solution for individual GIFs is to use


int i = StartFrame;
while(i<LastFrame)
{
object[2].Graphic = i;
i++;
}


for a certain room object that's going to be used as the video displayer. StartFrame and LastFrame are the numbers in the Sprite Manager, so you don't need to prepare them as views.

For sounds, you can add the
if(i==CertainFrame) PlaySound(2);
conditions into the loop.

Another advantage of using this system could be the quality of the video, as it's not going to be compressed (I'm not sure of this, making the frames GIF's may decrease it more than AVI's), but I guess the main advantage is frames being controllable.
Title: Re: Possibly the dumbest question ever
Post by: Joseph on Fri 16/10/2009 18:00:55
Ah I see...this is all very very cool stuff, people. Ill use your suggestions and see what I can do.

HOWEVER, well Ive got the 2nd dumbest question then, and it goes a little somthing like this:

**How in the "h-e double-hockey sticks" can I make "Display" function non-blocking?**

I wish there was a flag in the Display function that says "non-blocking"...that way animations can continue running, etc...

Ive got an animated GUI and when I click on something that I want to display text, the GUI's animation stops until I click the message away. Its pretty caca.

I am aware of making a gui for  that text message, and displaying it as a button or something, but if I have lots of display messages to do while that GUI is animating...thats a lot of work creating all those messages as sprites...

Is there a way to do this, or perhaps some module Im unaware of ?

Ill continue searching though, not wanting to piss anyone off :P
Title: Re: Possibly the dumbest question ever
Post by: NsMn on Fri 16/10/2009 18:19:46
Simply make your own GUI and Label and set its text to the speech that should be displayed. It would be hard if the text window GUI should change its size, but that's the only way to do it.
Title: Re: Possibly the dumbest question ever
Post by: monkey0506 on Fri 16/10/2009 18:27:03
Quote from: NsMn on Fri 16/10/2009 18:19:46It would be hard if the text window GUI should change its size

You mean something like:

function CustomDisplay(String text) {
  gDisplay.Visible = false;
  if (String.IsNullOrEmpty(text)) return;
  lblDisplay.Width = MAX_WIDTH;
  int width = GetTextWidth(text, lblDisplay.Font);
  if (width > lblDisplay.Width) width = lblDisplay.Width;
  else lblDisplay.Width = width;
  int height = GetTextHeight(text, lblDisplay.Font, width);
  lblDisplay.Height = height;
  lblDisplay.X = 5;
  lblDisplay.Y = 5;
  lblDisplay.Text = text;
  gDisplay.Width = lblDisplay.Width + 10; // 5px padding on each side
  gDisplay.Height = lblDisplay.Height + 10;
  gDisplay.Centre();
  gDisplay.Visible = true;
}


Doesn't seem too difficult to me. ::)
Title: Re: Possibly the dumbest question ever
Post by: NsMn on Fri 16/10/2009 18:49:54
Sure, but a text window has Border graphics, don't forget about that  ;)
Of course, it's possible, but that would end up in a huge code with DynamicSprites, Drawingsurfaces and other stuff. Beastly.
Title: Re: Possibly the dumbest question ever
Post by: Joseph on Fri 16/10/2009 19:30:49
Well is it possible for a CustomDisplay module?

It will behave exactly like a normal display, but it doesnt block...

We could even have the border sprites (like top left, top middle, top right, etc) and it resizes depending on the size of the message...

Is it possible?

I would certainly post nasty nude pics of myself in return :) **
Title: Re: Possibly the dumbest question ever
Post by: NsMn on Fri 16/10/2009 19:51:25
Of course it is possible... Give me time til tomorrow, I'll see what I can come up with  ;)
Title: Re: Possibly the dumbest question ever
Post by: Joseph on Fri 16/10/2009 22:21:23
QuoteOf course it is possible... Give me time til tomorrow, I'll see what I can come up with

Wow! :o

You are one cool sumovabeetch!!

Thanks NsMn
Title: Re: Possibly the dumbest question ever
Post by: NsMn on Sat 17/10/2009 11:17:53
Okay, could  take longer. Getting the GUI's dimensions is going to be a bit complex...
Title: Re: Possibly the dumbest question ever
Post by: Scarab on Sat 17/10/2009 13:02:06
Quote from: Joseph on Fri 16/10/2009 22:21:23
Wow! :o

You are one cool sumovabeetch!!

Thanks NsMn

Nah, He just wants to see you naked, the randy dog :P
Title: Re: Possibly the dumbest question ever
Post by: Joseph on Mon 19/10/2009 03:29:46
Hehe. Nice.
Title: Re: Possibly the dumbest question ever
Post by: Joseph on Wed 28/10/2009 19:57:59
Any news on this super-fantastic-happy-candy-is-sweet-BlueSunshine-rainbow-glitter module?

ps: It would be great if the actual module could be named as above  ;)