|
-
Dec 19th, 2000, 05:16 PM
#1
Thread Starter
Lively Member
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
-
Dec 19th, 2000, 06:55 PM
#2
transcendental analytic
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.
-
Dec 21st, 2000, 11:25 PM
#3
Fanatic Member
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
-
Dec 21st, 2000, 11:27 PM
#4
Fanatic Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|