Delta Time as int : VUpdate()

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • RE: Delta Time as int : VUpdate()

      The simple answer is because GetTickCount() (which is used for getting that delta) returns an unsigned long, not a float. No reason to convert if we don't need to.

      -Rez
    • A few reasons. First, we really didn't need the precision. GetTickCount() has good enough precision for most of what we do with Teapot Wars. It's not perfect, but it works. This is an engine on training wheels, after all. ;)

      Second, QueryPerformanceCounter() has a bit more overhead. I *think* it's also slower, but I don't remember. I did a bunch of tests a number of years ago.

      QueryPerformanceCounter() also can have some odd issues, which we ran into on Rat Race a number of years ago. A few of them are captured here, if you're curious:
      gamedev.net/topic/357918-query…ecounter-vs-gettickcount/

      So basically it comes down to GetTickCount() being easier to deal with and more stable. Timing is always different on every project I've worked on. One project I was on used Assembly Language.

      If I recall, there are very few places we actually call GetTickCount(). It would be trivial to change those to another timing method if you like. Feel free. :)

      -Rez