What You think about this FPS speed? |
AutoAim | I would let you guys test the program yourself but it toke me a good 30-45 minutes just to get these numbers:
###########################################################
Map View and Screen Size : 800x600
Color Depth: 16 Bit
Tile Size: 64x64
===================================================
| Map Size | Avearge FPS for three runs | Memory Usage Size |
100x100 map = 1503fps, 1480fps, 1409fps (Mem Usage - 3,624K)
500x500 map = 1490fps, 1503fps, 1423fps (Mem Usage - 4,604K)
1000x1000 map = 1497fps, 1493fps, 1585fps (Mem Usage - 7,552K)
2000x2000 map = 1548fps, 1579fps, 1525fps (Mem Usage - 19,264K)
5000x5000 map = 1448fps, 1520fps, 1519fps (Mem Usage - 101,464K)
###########################################################
Computer Specs:
Windows XP Pro (SP2) Version 2002
Intel Pentium 4 2.66 GHz (HT)
1.00 GB RAM
Nvidia Quadro4 900 XGL
===================================================
Current Running Processes: 44
Current Available Physical Memory: 577556K Out Of 1047532K
Current Page File Usage: 338 MB
###########################################################
You think the FPS is good? I like how the FPS stays no matter what map size, but you think that is a good fps for the specs of the computer? |
sdw | Those results make sense because you're doing the same amount of drawing no matter what size the map is. The map size only effects the amount fo memory used, which is reflected by your results. Maybe you should also post the method you're using to calculate fps, because lets face it 1500 fps is suspiciously high :D Are these results from using DirectDraw, Direct3D, another API? |
AutoAim | If it was the winapi then i gave my computer extasy ;-)
its on DirectDraw, then map class source can be viewed here www.angelfire.com/games5/visualgamebasic/mapclasscode.html
to demo exes (100x100 and 500x500 map sizes) www.angelfire.com/games5/visualgamebasic/maptest.zip
and the code to get the fps:
[code]
'in the game loop:
lngTimeA = GetTickCount()
If lngTimeA - lngTimeB >= 1000 Then
'if its has been one second then
lngTotal = lngTotal + lngFps
lngCount = lngCount + 1
lngFps = 0
lngTimeB = GetTickCount()
'update the string fps and clear the fps
'when you close the program:
strFps = Str$(lngTotal / lngCount)
MsgBox "Average FPS: " & strFps
[/code] |
sdw | And that code actually runs with no errors? |
AutoAim | whicih code the fps code or map class code? i don't get an errors why? |
sdw | There is no "End If" in the code above. Either you didn't copy all the code or you typed that all out from memory. In any case, it appears you're not counting the number of frames each second, instead you're doing everything at a 1000ms interval and nothing at a frame-based interval. Take a look at the following link to see how it compares to your current code: [url]http://www.vbgamer.com/msgboard/topic.asp?TOPIC_ID=323[/url]. |
AutoAim | quote: Originally posted by sdw
<br>you're doing the same amount of drawing no matter what size the map is. The map size only effects the amount fo memory used, which is reflected by your results.
Well thats really not true, lots of people go thourgh each tile seeing if that tile is on screen or not, so if the map array is gets larger then it has to go through more tiles checking to see if its on screen, well i just knock that part out by finding the beginning upper,left Tile then the End lower,right Tile and only draw those tiles inbetween, no need to go through each tile.
[code]
lngFps = lngFps + 1
'count the fps
lngTimeA = GetTickCount()
'get the tickcount
If lngTimeA - lngTimeB >= 1000 Then
'if its has been one second then
lngTotal = lngTotal + lngFps
lngCount = lngCount + 1
lngFps = 0
'clear the fps
lngTimeB = GetTickCount()
End If
Loop
End Sub
Private Sub Game_ShutDown()
bRunning = False
Set Map = Nothing
Set BackBuffer = Nothing
DD7.Shutdown
Set DD7 = Nothing
Me.Hide
strFps = Str$(lngTotal / lngCount)
MsgBox "Average FPS: " & strFps
End
End Sub
[/code]
sorry about that, this mouse is messed up |
sdw | quote: lots of people go thourgh each tile seeing if that tile is on screen or not
Ehh, you mean starting from element 0? Yes, thats a big no no.
Generally you only need 3 variables for calculating FPS. Try using this instead:
[code]
If GetTickCount() - lngTime >= 1000 Then
'if its has been one second then
lngTotal = lngFps
lngFps = 0
lngTime = GetTickCount()
else
lngFps = lngFps + 1
End If
[/code]
Where lngTotal will hold the number of frames which passed during the last second and is therefore used for displaying the FPS.
Edit: Ok I looked over your code again and looks like it's correct. Do you still get 1500 fps from the code above? |
AutoAim | i'm calcutling the avearge (sorry about that to, should have said that) i add to the current fps to the total; every second i add it to the lngtotal again, (the lngcount is to count how many times i have added to the total) then when you end the program it gets the avg and tells the user what the avg fps was |
Threshold | Many people go through each tile? I doubt it. I never did that even when I was a n00b. I did make one game that wasn't tile based and did that. It wasn't all that slow, actually. |