Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Knox on Tue 08/09/2009 22:01:08

Title: How "costly" is this GUI Animation?
Post by: Knox on Tue 08/09/2009 22:01:08
Hi,

I would simply like to know what is considered "heavy" in terms of GUI Animation? What would be considered "overkill", "insane", etc...

Here is what I am using with the module GUIAnimation:

It is my IconBar GUI...
60 png files (1024x115) for the animation (around 85kb each, so a total of 5100kb)

I tried with lower frames (like 20), but the animation wasnt as smooth...

Is this considered "too much"...? Im not too sure how the engine processeses this.

PS: Is there a "frames per second" kind of debug mode where I can see when/where the game slows down?
Title: Re: How "costly" is this GUI Animation?
Post by: DoorKnobHandle on Tue 08/09/2009 22:24:12
Call "SetDebugMode ( 4, 1 );" in game_start and you'll see your fps. If you don't change your game speed in your game, it should be 40fps. Disable your potential bottleneck (the GUI animation) and check whether or not you get 40fps (you should). Then enable it and check whether the numbers decreased.
Title: Re: How "costly" is this GUI Animation?
Post by: Matti on Tue 08/09/2009 22:24:57
I don't know how costly GUI animations are, but here are some notes:

Quote from: general_knox on Tue 08/09/2009 22:01:08
It is my IconBar GUI...
60 png files (1024x115) for the animation (around 85kb each, so a total of 5100kb)

As far as I know images aren't stored in their original format (thus not in their original size) within AGS.

Quote from: general_knox on Tue 08/09/2009 22:01:08
PS: Is there a "frames per second" kind of debug mode where I can see when/where the game slows down?

Yes. The debug mode can be turned on/off in the general settings and the "debug" function lets you see the framerate. Look it up in the manual. Edit: Beaten by dkh.
Title: Re: How "costly" is this GUI Animation?
Post by: Knox on Tue 08/09/2009 23:06:30
I got it now. I have a default of 56 frames per second...before, during and after the animated GUI!

Man, I never thought 60 frames in a loop wouldnt cause the FPS to go down one bit!

Very interesting...and encouraging!
Title: Re: How "costly" is this GUI Animation?
Post by: RickJ on Tue 08/09/2009 23:54:53
If you are interested in digging a little deeper tyou could always increase the game speed to something higher than your computer can manage.  Then turn on the GUI animation and see what;s the effect and let us know the results.
Title: Re: How "costly" is this GUI Animation?
Post by: TerranRich on Wed 09/09/2009 00:15:54
Ooh, this could be the beginning of a set of benchmark tests for AGS. :)
Title: Re: How "costly" is this GUI Animation?
Post by: monkey0506 on Wed 09/09/2009 00:51:12
Seeing as you mentioned you're using the GUIAnimation module I'd be interested as well to see if there's any negative impact from using the module that I could potentially optimize.

Basically all it's doing at this point is every frame it checks a timer (NOTE: a basic int timer not one of the built-in ones) for that GUI's animation delay. If the timer has expired then it changes the background frame and resets the timer.
Title: Re: How "costly" is this GUI Animation?
Post by: Knox on Wed 09/09/2009 13:37:01
Hi,

Ok, Ill see if I can set something up...so far though, 60 frames of animation in my iconbar with Moneky_05_06's module...its really fast! (Surprised!)

Ill put in like bigger pictures (1024x768), and try different amounts, like 60, 120...240!!!

See what happens!

EDIT:

By the way, I was thinking...we have a great module by Monkey_05_06 for animating GUI's...right now we can only animate the background with 5 images, am I right?

Is there a way to modify the GUIAnimation so we can have a BackgroundAnimation module?

So far doesnt seem to be that costly...

I am aware this is awaiting a fix**...but in the meantime!!
**(http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=17)
Title: Re: How "costly" is this GUI Animation?
Post by: TerranRich on Fri 11/09/2009 03:09:12
Yeah, it's been "Awaiting Fix" for over 7 years now... LOL
Title: Re: How "costly" is this GUI Animation?
Post by: Dualnames on Fri 11/09/2009 07:39:52
I think being able to set a view as a background animation could be perfect, in the meantime, you can use draw surface for that. And by the way, it will end up really slow loading a room with  more than 5 bgs, my frame rate falls from 40 to 12 when a room is loading.
Title: Re: How "costly" is this GUI Animation?
Post by: monkey0506 on Sat 12/09/2009 04:58:41
I've been doing some preliminary testing of this room backgrounds from views idea and it seems very plausible. I don't have much to work with right now (not on my own computer) but my preliminary test shows a steady 40 FPS even while calling DrawingSurface.Clear, DrawingSurface.DrawImage every game loop replacing the room background. As an additional test I compared the values of two DateTime objects and the only time lapse was of course the delay I added between loops so it seems like there's very little overhead to doing this.

Depending how things go I may release this as a module. ;)
Title: Re: How "costly" is this GUI Animation?
Post by: Knox on Wed 30/09/2009 03:45:59
Holy crap Monkey....good news :) :)

Let me know when/if that comes out!
Title: Re: How "costly" is this GUI Animation?
Post by: monkey0506 on Thu 01/10/2009 04:06:07
Just as an update on this. First let me give you a couple of specs for cross-referencing purposes:

OS: Windows XP SP3
CPU: AMD Athlon XP 2000+ (http://en.wikipedia.org/wiki/List_of_AMD_Athlon_XP_microprocessors#Desktop_CPU) (c. 2002)
Graphics: Sapphire Radeon 9200 Atlantis (http://en.wikipedia.org/wiki/Radeon_R200) (c. 2003)
RAM: 512 MB

So as far as computers/electronics go my system is getting somewhat dated. But it was given to me for free by my friend and it's my first system so don't knock it. :P

I started up a project in AGS at 1024x768x32 and imported a couple of wallpapers to use as background frames. The only thing I didn't do (yet) is actually do a lot of other things while all this was going on.

That being said, I think that as long as the total animation delay (delay parameter + frame speed) is at least 5 it shouldn't be an issue. Though I am going to recommend setting it higher.

Basically some things to note: