Author Topic: [RESOLVED] Framerate Issue  (Read 25804 times)

Offline Castruccio

  • Sr. Member
  • ****
  • Posts: 323
[RESOLVED] Framerate Issue
« on: March 25, 2012, 10:15:21 pm »
I have been playing AVWW for a while now but with the new feature that shows the framerate in the message window I have been able to confirm a dramatic fluctuation in my framerates that I don't think should be occurring given the demands of the game.  I am running a 2.4Ghz i5 450M with 6GB ram and a Radeon 5650m with 1 GB ram and the latest Catalyst drivers.  I have the game set on 1280X768 resolution.

I am currently fighting a Giant Blue Amoeba and my framerate  when it attacks drops to about 15 fps.  In forest areas I get about 24fps, and in deserts I can push around 35.  In buildings I usually fluctuate between 20-40fps, unless a lot of enemies are attacking in which case it drops to around 15. 

Given the high demands of some of the 3D games I run, it strikes me as odd that I can barely push 30fps on AVWW with the resolution turned down.  Any thoughts as to why it is so choppy sometimes?  Is anyone else having these sorts of dramatic fluctuations?
« Last Edit: April 25, 2012, 09:19:59 am by x4000 »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Framerate Issue
« Reply #1 on: March 25, 2012, 10:49:00 pm »
If you hit F3, what does it say for the number of textures drawn and the number of texture swaps?  I've not been hearing about this sort of dramatic fluctuation as a general rule, no.

In terms of the demands of a high-powered 3D game versus a 2D sprite-based game, don't get me started.  We have way more texture RAM to use than they do, most of the time, and a lot more state changes on the GPU.  That said, my FPS on an 8800 GTS almost never drops below 120.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Framerate Issue
« Reply #2 on: March 25, 2012, 11:01:57 pm »
Yea, don't get Chris started on 2D vs 3D, he's already had to explain to me more than enough times why drawing 100 rectangles on a screen is an expensive operation in 2012 :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Castruccio

  • Sr. Member
  • ****
  • Posts: 323
Re: Framerate Issue
« Reply #3 on: March 26, 2012, 08:09:56 am »
If you hit F3, what does it say for the number of textures drawn and the number of texture swaps?  I've not been hearing about this sort of dramatic fluctuation as a general rule, no.

In terms of the demands of a high-powered 3D game versus a 2D sprite-based game, don't get me started.  We have way more texture RAM to use than they do, most of the time, and a lot more state changes on the GPU.  That said, my FPS on an 8800 GTS almost never drops below 120.

When the framerate falls to 20 fps in a forest area with several enemies on screen, the textures drawn is around 234 and the texture swaps is around 74.

It may also be worth noting that unlike other games I play, the fan on the video card does not spin up when things get intense on AVWW. 
« Last Edit: March 26, 2012, 08:18:10 am by Castruccio »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Framerate Issue
« Reply #4 on: March 26, 2012, 09:03:24 am »
That doesn't sound like a heavy graphics load; that sounds like a CPU drain, then.  Has this been an ongoing thing, or is this new?

Is it just the first time such a new attack is launched, or is it every time during the fight?  It could be a stutter from disk loading (there's a settings option right under the one for the FPS display that lets you see disk loads during gameplay).  Not sure, but that might be it.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Framerate Issue
« Reply #5 on: March 26, 2012, 10:38:38 am »
Okay, I think this may be your issue:

* Put in an absolutely enormous CPU performance improvement for when there are lots of entities in a chunk all at the same time.  Previously, whenever any sort of "is this a valid location" type checks were made, it was taking vastly too long to do these because it was doing a lot of math it didn't need to do for entities that it had no chance of intersecting.
** So now it does a preliminary check to see if the entities have any chance whatsoever of colliding, and then just skips even evaluating them at all if not.
** In a standard mystery puzzle room on a latest-gen i7 quad core with an 8800GTS (in other words, a very high end machine), this single change was good for a jump from 35fps to 132fps.  The results won't be nearly so dramatic in all rooms, since most rooms don't have such high entity counts (all those puzzle pieces), but it should also help enormously in any case where there's a lot of projectiles being fired (aka, big battles).

It's in for the next release, and will certainly help at the very least.  If you don't see a difference in some specific cases, then there's probably some other area that is still doing something stupid with the CPU; please just let me know if you find such a case.  Thanks!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BobTheJanitor

  • Master Member Mark II
  • *****
  • Posts: 1,689
Re: Framerate Issue
« Reply #6 on: March 26, 2012, 11:05:03 am »
I wasn't having trouble with puzzle rooms, that I noticed, but will that impact the huge frame drop when fairies die and drop little clumped piles of shards?

Offline Castruccio

  • Sr. Member
  • ****
  • Posts: 323
Re: Framerate Issue
« Reply #7 on: March 26, 2012, 11:16:54 am »
Is it just the first time such a new attack is launched, or is it every time during the fight?  It could be a stutter from disk loading (there's a settings option right under the one for the FPS display that lets you see disk loads during gameplay).  Not sure, but that might be it.

It happens every time during a fight, but especially when attacks are launched by things like Giant Amoebas or the circular water enemies that shoot the spread attacks.    I believe this has been an ongoing issue, but I have only begun to notice it now that I am fighting more diverse kinds of enemies than skelbots and bats. 

Okay, I think this may be your issue:

* Put in an absolutely enormous CPU performance improvement for when there are lots of entities in a chunk all at the same time.  Previously, whenever any sort of "is this a valid location" type checks were made, it was taking vastly too long to do these because it was doing a lot of math it didn't need to do for entities that it had no chance of intersecting.
** So now it does a preliminary check to see if the entities have any chance whatsoever of colliding, and then just skips even evaluating them at all if not.
** In a standard mystery puzzle room on a latest-gen i7 quad core with an 8800GTS (in other words, a very high end machine), this single change was good for a jump from 35fps to 132fps.  The results won't be nearly so dramatic in all rooms, since most rooms don't have such high entity counts (all those puzzle pieces), but it should also help enormously in any case where there's a lot of projectiles being fired (aka, big battles).

It's in for the next release, and will certainly help at the very least.  If you don't see a difference in some specific cases, then there's probably some other area that is still doing something stupid with the CPU; please just let me know if you find such a case.  Thanks!

Thanks for this!  I will let you know what kind of improvement I see. 
« Last Edit: March 26, 2012, 11:19:23 am by Castruccio »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Framerate Issue
« Reply #8 on: March 26, 2012, 11:19:58 am »
I wasn't having trouble with puzzle rooms, that I noticed, but will that impact the huge frame drop when fairies die and drop little clumped piles of shards?

I'm not sure -- possibly/probably, but I'm not sure to what degree.  I'm looking into new-entity-creation issues at the moment to make sure those are as efficient as can possibly be, too.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Castruccio

  • Sr. Member
  • ****
  • Posts: 323
Re: Framerate Issue
« Reply #9 on: March 26, 2012, 05:01:24 pm »
I think this fix helped the framerate in general, however the blue amoeba attack still brings the framrate to its knees.  I've got one attacking me now and the framerate drops to about 17FPS with 331 draw calls and 66 texture swaps.  This is in a forest area.  When no blue amoebas are around things rocket back up to 30-45 fps in the same area.


Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Framerate Issue
« Reply #10 on: March 26, 2012, 05:04:56 pm »
You might need to turn off additive blending in the graphics options.  If you're getting lower than 60fps in general, then your card is only somewhat keeping up with the game anyhow.  The game is really designed to be played at ideally 60fps or more.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Castruccio

  • Sr. Member
  • ****
  • Posts: 323
Re: Framerate Issue
« Reply #11 on: March 26, 2012, 05:12:45 pm »
Perhaps I'll need to look into getting a new machine.  I just disabled everything I could disable in the graphics menu tab and I am still averaging about 20fps with the blue amoebas.  Thanks for the general cpu fix, though.  It certainly helped some. 

Offline Castruccio

  • Sr. Member
  • ****
  • Posts: 323
Re: Framerate Issue
« Reply #12 on: March 26, 2012, 05:56:16 pm »
Although I am more skeptical that the system is at fault because I just ran a test on Starcraft 2 (which is both CPU and GPU intensive) with medium and high settings and got 50-60fps.  If AVWW is more intensive than SC2 then that's an interesting thing. 

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Framerate Issue
« Reply #13 on: March 26, 2012, 06:41:51 pm »
Here is your card versus my card: http://www.hwcompare.com/1377/geforce-8800-gt-1gb-vs-radeon-hd-5750-1gb/  (That is your card, yes?)

Your card looks like it beats mine across the board, and yet I'm rarely getting lower than 100fps, and even when that happens almost never less than 60fps.  That doesn't make a lot of sense.  I'm playing windowed mode, not even fullscreen; though I don't have Aero on at all.

I will say that Starcraft II and AVWW have different needs; AVWW is more about pixel fill rate, etc, whereas Starcraft II is likely to be about other factors including polygon count, shader support, etc, among many others.

That's extremely odd, anyhow, that your general performance would be that bad; the amoebas are one thing, but even your baseline is just suspiciously low.  Is there anything else in the background that might be impacting it?  Sometimes when I accidentally have two copies of AVWW open rather than one, I wind up with really choppy performance on the second one until I realize what I did.

I have heard from some other developers that the ATI drivers have been enormously buggy lately, but I don't know anything about it directly, not even the validity of that.  Take that for what you will, that's just what I heard, and it was in reference to features that we specifically don't even use.  So I don't know if that would even come into effect here.

Another thought: are you using vsync?  It might be a good idea to try turning that off and see if that helps.  You could also crank up the target FPS and see what happens.  It really makes no sense that your performance would be anywhere near that.  For the record, my mac laptop has a builtin ATI card of some sort and gets more like 60fps, with occasional dips a bit lower.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Framerate Issue
« Reply #14 on: March 26, 2012, 06:47:53 pm »
Chris, is that 100fps in the standalone build?
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!