Results 1 to 4 of 4

Thread: Game Time

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    I am wondering in games such as Unreal, SimCity and others like that, how do the programmers do the time. I mean like in Tetris I assume that a timer would triker then their would be code in that timer that would move the blocks. So what do Unreal, Simcity do. Is it a timer or something else

    Thanks

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    They probably use a gameloop instead of a timer, that is a serie of operations like rendering, keyboard and mouse input, processing all the data needed under a cycle, which repeats on until the game is ended. Timing is then achieved with using for instance Gettickcount api.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625

    Chuka-Laka!!

    Yep, id have to agree with kadaman,
    they dont use a timer, they use a loop untill something breaks the loop, but there is also a timere so that the game doesnt take too lonad and to keep track of playing time.

    UT has a logger, which logs gane events into a temp file, you can save that log file and look at it.

    Code:
    Do While Not isEventTriggered
      ''some hundreds of lines of code....
      If event == eventTrigger Then
        isEventTriggered = True
      End If
      ''etc... some other bunch of code
      If timeGetTime(now) >= maxTime Then
        isEventTriggered = True
      End If
      ''guess whats next
      ''yup!! u guessed right (more code)
    
    Loop
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  4. #4
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625

    Chuka-Laka!!

    what i just wrote is not even anywhere near what ut uses,
    it is just a sketch of what most devlopers do to keep track of game play... and to have a game that doesnt end as soon as it draws one pixel on the screen.

    that would suck.
    but this is one way you can do in vb.

    peace out m8s
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width