H!tman Posted November 30, 2011 Share Posted November 30, 2011 can i calculate game FPS per frame(if it was impossible can i calculate it like fraps)? if it was possible please tell me. Link to comment
Jaysds1 Posted November 30, 2011 Share Posted November 30, 2011 Why would you need to calculate? unless you mean updating it. Link to comment
Castillo Posted November 30, 2011 Share Posted November 30, 2011 Look what I've found in just 5 seconds in the MTA community: https://community.multitheftauto.com/index.php?p= ... tails&id=7 https://community.multitheftauto.com/index.php?p= ... ils&id=585 https://community.multitheftauto.com/index.php?p= ... ils&id=450 Link to comment
H!tman Posted November 30, 2011 Author Share Posted November 30, 2011 Look what I've found in just 5 seconds in the MTA community:https://community.multitheftauto.com/index.php?p= ... tails&id=7 https://community.multitheftauto.com/index.php?p= ... ils&id=585 https://community.multitheftauto.com/index.php?p= ... ils&id=450 i said per frame not per second or 1/2 second !!!!! I WANT TO KNOW MY FPS ON RENDER !!!!! Link to comment
Jaysds1 Posted November 30, 2011 Share Posted November 30, 2011 Frames Per Second... what do you mean, calculate how much frames there are? Link to comment
Castillo Posted November 30, 2011 Share Posted November 30, 2011 FPS = Frames Per Second. P.S: You can edit these resources maybe, and get a better attitude if you want to be helped. Link to comment
Jaysds1 Posted November 30, 2011 Share Posted November 30, 2011 FPS = Frames Per Second.P.S: You can edit these resources maybe, and get a better attitude if you want to be helped. ya, we're helping you and your giving us attitude, we don't know what your talking about, FPS is Frame Per Seconds, what do you mean about per frame? Link to comment
H!tman Posted November 30, 2011 Author Share Posted November 30, 2011 for every time GTA lead a new frame i want to know what is my frames can be loaded in 1 second, i want update it not after 1 second i want it like fraps. if you didn't understand what i'm talking about, a lot of us know the fraps and you know the yellow numbers at the corners of the screen(FPS), fraps calculating it about 20 times per second! i don't know what i should say. thats all in my mind Link to comment
Castillo Posted November 30, 2011 Share Posted November 30, 2011 Why should we give you the script done? can't you check these FPS in the MTA community and try to make it yourself? Link to comment
H!tman Posted November 30, 2011 Author Share Posted November 30, 2011 i did before i post this thread i'm not fool Link to comment
Blaawee Posted November 30, 2011 Share Posted November 30, 2011 https://community.multitheftauto.com/index.php?p= ... tails&id=7 Link to comment
Sharingan Posted November 30, 2011 Share Posted November 30, 2011 It's impossible what you're saying, because FPS is Frames per second and you can't calculate how many fps are in a frame. But, It's possible calculate how many Frames pass per second, I'm saying, FPS. Link to comment
DiSaMe Posted November 30, 2011 Share Posted November 30, 2011 onClientPreRender event has a timeslice parameter. It's time in miliseconds between last two frames. So you can divide 1000 (one second) by one frame duration and you will have FPS based on the length of that frame. However, I noticed that every frame is a lot shorter or longer than previous frame. I mean, every other frame has something what takes more time to process (maybe game physics?). Because of that, you will see FPS increasing and decreasing every frame. Link to comment
AGENT_STEELMEAT Posted November 30, 2011 Share Posted November 30, 2011 FPS - Frames Per Second. It's simple. Oh, and I did a simple Google search. http://stackoverflow.com/questions/8730 ... -in-a-game Link to comment
arezu Posted November 30, 2011 Share Posted November 30, 2011 FPS - Frames per second, meaning 1 second. And you want FPS counter to update 20 times a second, but show how many frames per 1 second a player has? I tried doing that just now, however the fps jumps too much, which i think is because of time lag somewhere. Link to comment
H!tman Posted November 30, 2011 Author Share Posted November 30, 2011 i want to calculate it like fraps and if you didn't know what is fraps, it's programe record/take a screen shot for games + calculating frames. this is the link if you want try it: http://www.fraps.com/download.php Link to comment
AGENT_STEELMEAT Posted November 30, 2011 Share Posted November 30, 2011 Then you need to start writing some code. Try it yourself, and post it here so we can guide you. Link to comment
JR10 Posted November 30, 2011 Share Posted November 30, 2011 addEventHandler ( "onClientRender" , root , function ( ) if not startTick then startTick = getTickCount ( ) end if not frames then frames = 0 end frames = frames + 1 currentTick = getTickCount ( ) if currentTick - startTick >= 1000 then setElementData ( localPlayer , "fps" , frames ) startTick = nil frames = nil end end ) Now it sets the localPlayer's element data 'fps' to the current FPS, updates every second. You should probably add a scoreboard column. Link to comment
AGENT_STEELMEAT Posted November 30, 2011 Share Posted November 30, 2011 Why global variables and why broadcast FPS to the server every second. Bandwidth rape much? Link to comment
H!tman Posted November 30, 2011 Author Share Posted November 30, 2011 i don't want to show it in scoreboard i want only dxDrawing it Link to comment
AGENT_STEELMEAT Posted December 1, 2011 Share Posted December 1, 2011 Write some code and try yourself before asking for code. Link to comment
H!tman Posted December 1, 2011 Author Share Posted December 1, 2011 i did before, i ask if i failed to get it after many times and all tries. Link to comment
AGENT_STEELMEAT Posted December 1, 2011 Share Posted December 1, 2011 Post your code here. Link to comment
Blaawee Posted December 1, 2011 Share Posted December 1, 2011 FPSLimit = 37 FPSMax = 1 function onClientResourceStart ( resource ) if ( guiFPSLabel == nil ) then FPSLimit = 255 / FPSLimit guiFPSLabel = guiCreateLabel ( 0.03, 0.94, 0.5, 0.1, "FPS: 0", true ) guiSetFont ( guiFPSLabel, "sa-header" ) FPSCalc = 0 FPSTime = getTickCount() + 1000 addEventHandler ( "onClientRender", getRootElement (), onClientRender ) end end addEventHandler ( "onClientResourceStart", getRootElement (), onClientResourceStart ) function onClientRender ( ) if ( getTickCount() < FPSTime ) then FPSCalc = FPSCalc + 1 else if ( FPSCalc > FPSMax ) then FPSLimit = 255 / FPSCalc FPSMax = FPSCalc end guiSetText ( guiFPSLabel, "FPS: "..FPSCalc.." Max: "..FPSMax ) guiLabelSetColor ( guiFPSLabel, 255 - math.ceil ( FPSCalc * FPSLimit ), math.ceil ( FPSCalc * FPSLimit ), 0 ) FPSCalc = 0 FPSTime = getTickCount() + 1000 end end mybe this ? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now