Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (fogman, Grant, AndrewAMD, juanex), 989 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Slowly declining FPS #139723
07/05/07 22:16
07/05/07 22:16
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline OP
User
MrCode  Offline OP
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
I've been trying to figure this out for a while now, but whenever I run my AckNote project, the frame rate decreases gradually.

On initial startup, it's running at a near-perfectly stable 75 FPS, which is great for me. But, as the program runs (even when nothing is being changed or moved), the FPS gradually drops towards about 40 FPS.

Anyone know why this could be happening?


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}
Re: Slowly declining FPS [Re: MrCode] #139724
07/05/07 22:25
07/05/07 22:25
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
This happened to me on several occasions and in one, it was a function looping endlessly and in another it was a morph effect reproducing the same model continuosly.
Using the debug panel I was able to pinpoint each problem.

Re: Slowly declining FPS [Re: Nems] #139725
07/06/07 01:26
07/06/07 01:26
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline OP
User
MrCode  Offline OP
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
Well, I have loops running for the alpha and color of the GUI panels, as well as for the color of the background.

and for the GUI themes (while (_mode== n)).

I think I may have answered my own question. I'll see what I can do to optimize my code.

Thanks for the tip!

One thing, though: How would you use the debug panel to fund out how many loops are running?

EDIT: ok, I went through it, removed some of the superfluous while-loops (like the ones controlling the GUI themes), replaced some of the while(1) with while(mouse_left== on), and it seems to run at 75 FPS longer. But after a while, the FPS still drops to 60. I can't change how the program deals with the background color, because that has to be able to change dynamically. Same with the GUI color, I had to leave it as a while because then it wouldn't be able to be interchangeable with the GUI themes.

I don't know if there's anything else I can do about the FPS. If I can, please post about it (unless I figure it out first, then I'll post, ).

Last edited by MrCode; 07/06/07 01:49.
Re: Slowly declining FPS [Re: MrCode] #139726
07/06/07 01:32
07/06/07 01:32
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Check out 'msc/frame' and 'count of' columns for fnc running.
Cheers.

Re: Slowly declining FPS [Re: Nems] #139727
07/06/07 01:54
07/06/07 01:54
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline OP
User
MrCode  Offline OP
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
I see, the number of functions increases by 10 when I go to and from the window test.

How do you check whether a function is running or not through code?

This is so that I can stop the other functions when the window test is running so that the script doesn't run redundant functions every time I want to go to and from the window test.


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}
Re: Slowly declining FPS [Re: MrCode] #139728
07/06/07 02:13
07/06/07 02:13
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Sorry, thats beyond me but I think I have seen other posts where debugging is a main theme.
What I did was to comment each function untill I found the ones that were giving me the grief.

Re: Slowly declining FPS [Re: Nems] #139729
07/07/07 02:44
07/07/07 02:44
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline OP
User
MrCode  Offline OP
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
Correct me if I'm wrong, but I think I may have found it: proc_status()?

Thanks for the help!


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}
Re: Slowly declining FPS [Re: MrCode] #139730
07/07/07 07:21
07/07/07 07:21
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Quote:

On initial startup, it's running at a near-perfectly stable 75 FPS, which is great for me. But, as the program runs (even when nothing is being changed or moved), the FPS gradually drops towards about 40 FPS.

Anyone know why this could be happening?




This is probably what is known as a "memory leak" (in general terms), and is probably the worst kind of bug, because it could be almost anything.

However, with A6 and script, you dont have to bother with so much stuff like in a C++ program, so it shouldn't so hard to track down.


Sphere Engine--the premier A6 graphics plugin.
Re: Slowly declining FPS [Re: Matt_Aufderheide] #139731
07/07/07 17:45
07/07/07 17:45
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
i had a similar problem, it was caused by calling function with 'while' loop from the other loop. Just look attentively at the structure of your code, and remove unneeded function calls

Re: Slowly declining FPS [Re: Shadow969] #139732
07/07/07 18:47
07/07/07 18:47
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
check number of num_actions in debug panel(F11) or your own panel


Never say never.

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1