Ok, i was making my pathfinding program (as you do), i got my legendary 47.75mb or something array down to 177kb (thanks for the heads up about vectors Bran flakes91093, what i do now is i store the previous paths in a long string, then when i need to i split it up into a temp vector <string>, which ill clear after use.)
But i was suprised to see, that on a 15x15 plain, my fps (previously capped at 30 it seemed) could still struggle to go beyond 30.
So, i decided to go through each part of the code finding what was causing this lagg (i only pathfind when the nodes are regenerated, so that happens only when i press R, and it takes around 5-20 ms to generate the path, after that it doesnt look at pathfinding). I then got kinda frustrated at remmed out EVERYTHING, except for the core bits.
(without the remed code my game basically reads):
#include "DarkGDK.h"
#include <vector>
#include <string>
using namespace std;
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetDisplayMode (1024,768,32);
dbMaximizeWindow();
dbRandomize ( dbTimer ( ) );
while ( LoopGDK ( ) )
{
dbInk(dbRGB(255,255,255),0);
dbText(5,3,"FPS = ");
dbText(50,3,dbStr(dbScreenFPS()));
dbSync ( );
dbCLS();
}
return;
}
PS: i know you can combine FPS and ScreenFPS into one string, im just not really that fussed to do that atm.
I run that, and my fps is still capped at 30 it seems, even tho on the screen its just white text on a black background.
However, i dont know if this means anything, most likley not, but if i minimize my 'game' (showing fps on a black screen is hardily a game), and reopen it, itll read 60fps for a second or so, then go back to 30.
I have asked a few other people to look at my game to see what fps they got, and they all say they can only get 30fps, (even tho some have pretty darn good computers).
So can anyone please answer me why this is happening, or what i should do?
Thanks in advance.
---I included the app---