Frame Offset or Time Offset?

Started by
4 comments, last by dbzprogrammer 18 years, 2 months ago
I'm currently taking a look at my Process system. And I was thinking, some processes will need to be run every thread (Render, Audio, Input, etc...), but what about all the others that won't (Networking, Physics, AI)? Should they be based on frame time or actual time? What's your experience on this? Here's my thoughts on it: Pro's for per-frame: If framerate is critical, it would allow the renderer to have priority until a good framerate is re-established. Would be more based on my game, would require less mathematical computation. (Not that it matters too much.) By being relative to my game, it could allow me to keep the game more realistic because I could choose how often something needed to be done in proportion to the frame rate. Con's for per-frame: I would have less control over time critical game components. Some things might need to be done at a certain time. Pro's for per-time: Easier time based movement. (Don't know about this one.) Con's for per-time: All the Pro's for per-frame... Right now in my head, per-frame is winning except for the fact some things might be time critical. Any experience you guys have had or wisdom on this would be apprieciated. I'm asking to know and make sure I don't mess things up too fast.
We should do this the Microsoft way: "WAHOOOO!!! IT COMPILES! SHIP IT!"
Advertisement
You need to describe your system a little more. What is a process? What does "run every thread" mean? In general, it is probably easier to make everything time-based, except for the things that are time-critical. Do you have some sort of interrupt or timer callback system?
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Quote:Original post by JohnBolton
You need to describe your system a little more. What is a process? What does "run every thread" mean? In general, it is probably easier to make everything time-based, except for the things that are time-critical. Do you have some sort of interrupt or timer callback system?


I have an event manager. It deals with processes and the Windows Proccess Callback function. While there are no Win32 messages, it runs the game. The Event Manager contains Processes, such as the render process, the logic process, the input process. Certain one's get called every frame, others don't. My "run" function, which runs every frame, calls the high priorities everytime, and checks for low priorities and if they need to run. My question is, what should my "time" unit be? Per-frame, or per-real-time?
We should do this the Microsoft way: "WAHOOOO!!! IT COMPILES! SHIP IT!"
I would make it per-time since the interval of a frame is unpredictable.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
I would do per-frame updates (which seem to have more pros), with time-based interrupts as required for time-critical events and game components. This seems to me to be the best of both worlds.
I'll try it out.
We should do this the Microsoft way: "WAHOOOO!!! IT COMPILES! SHIP IT!"

This topic is closed to new replies.

Advertisement