Computer FPS problem
Computer FPS problem
Computer FPS problem
Computer FPS problem
Computer FPS problem
Computer FPS problem Computer FPS problem Computer FPS problem Computer FPS problem Computer FPS problem Computer FPS problem Computer FPS problem Computer FPS problem
Computer FPS problem Computer FPS problem
Computer FPS problem
Go Back  Xtreme Visual Basic Talk > > > Computer FPS problem


Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2013, 07:34 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default Computer FPS problem


i wondering if there are any soultion to this,

i've been building a game for several weeks.

since the graphics are light, and since i never really picked up DirectX, i'm making the game using BitBlt.

my game gets 80 FPS normally, but now it's dropping down to 12.
the game runs on 12 but it feels a little sluggish.

i noticed that if i don't scroll the map for about a minute, it will stay at 80FPS, but if i start palying immediately, it will drop to 12.

i figure that mabe if i make it an EXE and give it better "windows prority" it might help, but i don't know if that will work.

does anyone know a way to make a program pull more CPU?
__________________
The Pho·net·ic Programmer
Reply With Quote
  #2  
Old 03-22-2013, 11:11 AM
Cerian Knight's Avatar
Cerian KnightComputer FPS problem Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,193
Default

To 'pull more CPU' sometimes means to 'pull less CPU' in code sections where it is detracting from where it is actually needed. I suspect that you will need to profile (using QueryPerformanceCounter) the actual performance of any code sections where you think extra time is being spent.

Under Windows Vista/7, understanding how Desktop Composition impacts the performance might be relevant, as well.
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
  #3  
Old 03-23-2013, 02:17 AM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

i've isolated parts of the program and i monitored hits in the subs by simply placing counters in them.

it starts off at 80 FPS.
if the program makes calculations or fuctions that tax the CPU, and if it causess the FPS to temporarly drop below around 30 FPS, the program runs slower and drops the FPS to 12.
it won't go back up to 80 even though there is nothing new leeching.

this blows.


i guess when i get a new compouter i'll have a faster CPU
__________________
The Pho·net·ic Programmer
Reply With Quote
  #4  
Old 03-25-2013, 08:10 AM
Cerian Knight's Avatar
Cerian KnightComputer FPS problem Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,193
Default

I recommend going a step further and grabbing the cumulative time each sub (or even subsection of a sub) spends in execution. Sometimes you might be surprised which specific statements or loops are the resource hogs.
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
  #5  
Old 04-18-2013, 10:35 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

thanks for the advice.
usually when i make a game loop a call a number of subs from the loop, but in this project the loop does nothing but draw.
i placed simple checks in the subs and i did find one that was leeching but when i corrected it, it made no difference.

i think it has something to do with memory on my computer, because i get this FPS drop usually during mid day.
i didn't have the problem until i added more forms (no loops in them) and more code, i think the size of this program has something to do with it as well.
i've also noticed that the use of extra picture boxes seems to drag on the total power of the program , even though the pictures in the boxes are refreshed ever 2 minutes or so.


i think this is a lesson of why people don't use bitblit to make games.
i was hoping that graphics part would be small enough to get away with it
__________________
The Pho·net·ic Programmer
Reply With Quote
  #6  
Old 04-19-2013, 01:42 PM
passel's Avatar
passelComputer FPS problem passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,026
Default

How are you measuring "leeching"?
There are primarily two types of resources that you can be consuming.
First, those that you create which will consume memory and add load to the system by increasing the number of resources that windows has to maintain.
Secondly, those resources that are pre-created by Windows and maintained in pools for applications to Get, use and return.
There are plenty of example programs on the internet that repeatedly Get handles but never return them, which will over time cause the whole system to slow down as the pool is drained and all the processes are waiting for access to a dwindling supply.
Since you can't give an example of problem, we'll never know for sure, but how is the program structured? How big is the map? How do you move it? How do you draw it?
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
  #7  
Old 04-19-2013, 10:41 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

a couple months ago i got the idea to build a low graphics game, so i could build a game and just throw up some simple graphics.
(it's based on Ultima 5)

it's Bitblit not DirectX.
i'm not using classes like a pro,
everything is done with subs.
i currently have 3 forms and 2 modules.

the map is a Type ,tested with either 200sqd or 800sqd times 8 properties.
Map(800,800).
it's a scrolling map that draws only whats on screen.
towns temporarliy hold Map(100,100).
the towns load and save instantly in the program.



i normally have 2 or 3 instances of VB open , the game , the map editor, and the NPC script.
my FPS was 80 to 90.

everything was going great so i kept adding.

one day i noticed when i closed my other instances of VB, sometimes i would get a super low FPS 12 to 16 when i ran the game by itself.

the second i start up, i either get 80 to 90FPS, or 12 to 20 FPS, its fairly random.
there is no random factor from one start-up to another.


i posted the problem here because i thought there might be a way to set the program to prority so my computer would give it full CPU power on every start up.
Attached Images
File Type: png Boat.PNG (53.1 KB, 13 views)
File Type: png BoatLand.PNG (56.7 KB, 10 views)
__________________
The Pho·net·ic Programmer

Last edited by wolfstrike; 04-19-2013 at 10:52 PM.
Reply With Quote
  #8  
Old 04-21-2013, 12:25 PM
Cerian Knight's Avatar
Cerian KnightComputer FPS problem Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,193
Default

I see these things from time to time. Sometimes just opening a utility program and closing it will alter the timing of certain apps. Anti-virus programs, desktop composition, changes in thread affinity are just a few things that might have an impact. There are others...

Just a few questions:
This behavior is in the compiled version (as uncompiled will be much slower)?
Are you using any compiler optimizations (or the default)?
Are you using any 'On Error...' statements within critical speed subs.
What Operating System (and Service Pack) and CPU?
Does your PC have integrated graphics (sharing RAM with the CPU) or do you have a discreet graphics card?
Are you using SP6 for VB6?
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
  #9  
Old 04-22-2013, 04:41 AM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

Quote:
This behavior is in the compiled version (as uncompiled will be much slower)?
uncompiled.
i only got a small amount speed increase when i tried it a long time ago

Quote:
Are you using any compiler optimizations (or the default)?
default

Quote:
Are you using any 'On Error...' statements within critical speed subs.
no.
only thing i'm using that for is loading maps.
the sub maps during the game load instantly


Quote:
What Operating System (and Service Pack) and CPU?
xp , sp3 , 1.2g


Quote:
Does your PC have integrated graphics (sharing RAM with the CPU) or do you
have a discreet graphics card?
not sure, everything is standard


Quote:
Are you using SP6 for VB6?
?
Service pack?
mine is SP3
__________________
The Pho·net·ic Programmer
Reply With Quote
  #10  
Old 04-22-2013, 09:00 AM
Cerian Knight's Avatar
Cerian KnightComputer FPS problem Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,193
Default

I recommend always testing compiled, as uncompiled code is substantially different (and even sometimes aberrant in timing behavior).

Numerous bugs have been fixed since SP3, so I strongly recommend installing SP6:
http://www.microsoft.com/en-us/downl...s.aspx?id=5721

Discreet graphics can help prevent contention between the CPU and GPU for RAM intensive tasks (like BitBlt). Capping the size of the BitBlts and eliminating redundant calls might help. If you can add-in a cheap graphics card (presuming you currently have integrated graphics on the motherboard/chipset), that most always helps with performance.

If your .Picture is using .AutoRedraw=True, then make sure you are not calling .Refresh excessively or you may get slowdowns as you describe. The PaintPicture method may have some value over BitBlt (but usually not).
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
  #11  
Old 09-14-2014, 03:41 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

since all my projects take years, I eventually got a new laptop.
my game loads on the laptop at consistent speeds.
my old computer would randomly load the game at 2 different speeds.
i'm pretty sure it had something to do with cpu distribution.
...don't have to worry about it now
__________________
The Pho·net·ic Programmer
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Computer FPS problem
Computer FPS problem
Computer FPS problem Computer FPS problem
Computer FPS problem
Computer FPS problem
Computer FPS problem Computer FPS problem Computer FPS problem Computer FPS problem Computer FPS problem Computer FPS problem Computer FPS problem
Computer FPS problem
Computer FPS problem
 
Computer FPS problem
Computer FPS problem
 
-->