How "costly" is this GUI Animation?

Started by Knox, Tue 08/09/2009 22:01:08

Previous topic - Next topic

Knox

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?
--All that is necessary for evil to triumph is for good men to do nothing.

DoorKnobHandle

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.

Matti

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.

Knox

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!
--All that is necessary for evil to triumph is for good men to do nothing.

RickJ

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.

TerranRich

Ooh, this could be the beginning of a set of benchmark tests for AGS. :)
Status: Trying to come up with some ideas...

monkey0506

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.

Knox

#7
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)
--All that is necessary for evil to triumph is for good men to do nothing.

TerranRich

Yeah, it's been "Awaiting Fix" for over 7 years now... LOL
Status: Trying to come up with some ideas...

Dualnames

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

monkey0506

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. ;)

Knox

Holy crap Monkey....good news :) :)

Let me know when/if that comes out!
--All that is necessary for evil to triumph is for good men to do nothing.

monkey0506

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+ (c. 2002)
Graphics: Sapphire Radeon 9200 Atlantis (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:

  • It'd be best to not use this method at all. If there's a way around it, it's probably faster (in most general cases).
  • You will not be able to expect extravagant animations with this. Approximately 7-8 FPS of animation are the most you can reliably expect without impacting the game (i.e. without the game FPS dropping).
  • The higher the animation delay (the fewer FPS of animation) the less impacting overall, therefore the better.

    Now for lower resolutions these restrictions would be slightly more lax, but it's still important to realize that despite what I said in my last post after only some primitive testing, this is a heavy operation. Essentially the lower the resolution the less the game would actually have to redraw each time, so that would definitely make a difference.

    Also as noted I'm not running on a very high-end system. So if you really wanted to push it a better system would likely get better results. But keep guys like me in mind who don't have a better system to work with would ya? ;)

    I'll most likely go ahead with developing this, but I just wanted to set some expectations about what you'll actually be receiving.

SMF spam blocked by CleanTalk