| Mirage Source http://miragesource.net/forums/ |
|
| Tutorials http://miragesource.net/forums/viewtopic.php?f=201&t=2896 |
Page 1 of 1 |
| Author: | William [ Thu Oct 18, 2007 2:49 pm ] |
| Post subject: | Tutorials |
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 |
|
| Author: | Robin [ Thu Oct 18, 2007 3:15 pm ] |
| Post subject: | Re: Tutorials |
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 |
|
| Author: | William [ Wed Oct 24, 2007 8:52 am ] |
| Post subject: | Re: Tutorials |
Found it: viewtopic.php?f=70&t=772&st=0&sk=t&sd=a&hilit=tickcount |
|
| Author: | Spodi [ Wed Oct 24, 2007 9:21 am ] |
| Post subject: | Re: Tutorials |
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. |
|
| Author: | William [ Wed Oct 24, 2007 10:14 am ] |
| Post subject: | Re: Tutorials |
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? |
|
| Author: | Spodi [ Wed Oct 24, 2007 8:18 pm ] |
| Post subject: | Re: Tutorials |
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 |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|