Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorials
#1
I cant find verrigans tutorial to double the tickcount. And I was also interested in seing pingus ini tut but couldn't find any of them xD
Reply
#2
Double tickcount?

If you mean the replacement, he did it in another topic, it isn't in it's own.

I'll let you find it though Tongue
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
Found it: viewtopic.php?f=70&t=772&st=0&sk=t&sd=a&hilit=tickcount
Reply
#4
I put something similar to this in vbGORE, but not too happy with it and haven't used it again since. The problem with it is its resolution - its pretty low. I think it is around 24 milliseconds. It works well for an engine of Mirage's speed, and also vbGORE's (though may be cutting it a little closer, but still fine), but anything very time critical where you're simulating any form of physics on the server (client/server physics simulations like in a FPS or sidescroller) it is not good.

The rollover time really isn't too much of a problem, either, since its often good to reset at least once every two weeks, if not every week, since no matter your coding and no matter the OS you're using, the server will always perform better after a reset then it will after a week of running.
Reply
#5
Yes, but people used speed hacks in my game, and I'd like to get that fixed.

What do you mean with the resolution being low?
Reply
#6
Resolution is the frequency that the timer updates. For example, an output of a few counters:

Template code:

Code:
Private last

Private Sub Form_Load()
Dim i As Long
Dim r(0 To 9) As Double
Dim s As Double

    Do While i < 10
        r(i) = GetTime(GetTickCount)
        If r(i)  0 Then
            Debug.Print i & ". " & r(i)
            i = i + 1
        End If
    Loop
    For i = 1 To 9
        s = s + Abs(r(i) - r(i - 1))
    Next i
    Debug.Print "Avg: " & (s / 9)
    Unload Me
    End

End Sub

Private Function GetTime(ByVal t)
    If t  last Then
        GetTime = t
        last = t
    Else
        GetTime = 0
    End If
End Function

GetTickCount:

Code:
0. 6890312
1. 6890328
2. 6890343
3. 6890359
4. 6890375
5. 6890390
6. 6890406
7. 6890421
8. 6890437
9. 6890453
Avg: 14

timeGetTime + timeBeginPeriod:

Code:
0. 6954644
1. 6954645
2. 6954646
3. 6954647
4. 6954648
5. 6954649
6. 6954650
7. 6954651
8. 6954652
9. 6954653
Avg: 1

GetSystemTime:

Code:
0. 12837730444578.1
1. 12837730444593.8
2. 12837730444609.4
3. 12837730444625
4. 12837730444640.6
5. 12837730444656.3
6. 12837730444671.9
7. 12837730444687.5
8. 12837730444703.1
9. 12837730444718.8
Avg: 15.625

And just for fun, QueryPerformanceCounter + QueryPerformanceFrequency:

Code:
0. 7222.254
1. 7222.2542
2. 7222.2543
3. 7222.2545
4. 7222.2546
5. 7222.2547
6. 7222.2549
7. 7222.255
8. 7222.2551
9. 7222.2552
Avg: 1.33333333299864E-04
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)