Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, AndrewAMD), 1,079 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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 | 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