Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 15,499 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
What variable can I use to check the fps? #289512
09/13/09 17:27
09/13/09 17:27
Joined: Aug 2003
Posts: 716
Canada, Toronto
thegamedesigner Offline OP
User
thegamedesigner  Offline OP
User

Joined: Aug 2003
Posts: 716
Canada, Toronto
Hello, I've looked in the manual, and used the search function. I can't find my answer, so I'm asking here.

I want to check what the FPS is in my code, like this:

if(fps > 50)
{

}
else
{

}

But I don't know the variable name, and like I said, I can't find it in the manual or the forums (forums are just hard to search for this term, it's mentioned so much).

- Michael.


My games - www.spyeart.com
Re: What variable can I use to check the fps? [Re: thegamedesigner] #289513
09/13/09 17:37
09/13/09 17:37
Joined: Apr 2005
Posts: 3,076
Germany, NRW
rvL_eXile Offline

3D Artist
rvL_eXile  Offline

3D Artist

Joined: Apr 2005
Posts: 3,076
Germany, NRW
I have written this Function, this FPS Pnael, shows the Framrate in different colors (green = Great / orange=ok / Red = Bad) and the visible entitys / visible Polycount.

Code:
text info_txt 
{
		 Font=arial_font2;
       layer = 20; 
       pos_x = 797;
       pos_y = 0;
       string = "FPS";
       string = "Polygone";
       string = "Entitys";
       flags = visible;

}

panel framerate_pan 
{

       pos_x = 700; //820
       pos_y = 0; //740
       layer = 20;
       digits = 150, 0,7,arial_font2,1, fpsec;  //FPS 
       digits = 150,15,7,arial_font2,1,num_visentpolys ; //POLYS
       digits = 150,33,7,arial_font2,1,num_visents ; //ENTITYS    
       flags = overlay, refresh, visible;
} 

 

starter set_fpsmax()
{

       while (1)
       {
               
               init_frames = total_frames;
               sleep (1);
               fpsec = total_frames - init_frames;
               
               If(fpsec<=400 && fpsec>=51)
               {
               framerate_pan.red=60;
               framerate_pan.green=200;
               framerate_pan.blue=60;	
					}               
               
               If(fpsec>=31 && fpsec<=50)
               {
               framerate_pan.red=255;
               framerate_pan.green=190;
               framerate_pan.blue=80;	
					}
					
               If(fpsec<30)
               {
               framerate_pan.red=255;
               framerate_pan.green=0;
               framerate_pan.blue=0;	
					}
               
               wait (1);

       }

}



cYa Sebastian

Last edited by rvL_eXile; 09/13/09 17:37.

Tutorials:
[Blender]Terrain creation ENG/GER
[Blender]Low Poly Tree Modeling
[GIMP]Create a Texture for Terrains
CLICK HERE


Re: What variable can I use to check the fps? [Re: rvL_eXile] #289525
09/13/09 18:39
09/13/09 18:39
Joined: Aug 2003
Posts: 716
Canada, Toronto
thegamedesigner Offline OP
User
thegamedesigner  Offline OP
User

Joined: Aug 2003
Posts: 716
Canada, Toronto
Thanks. I'll use your system there.


My games - www.spyeart.com

Gamestudio download | 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