Welcome, Guest. Please Login or Register.  • Help
SMF Underground
+ SHMUP-DEV » SHMUP DEV FORUMS » Assistance
|-+ Time Based or Frame Based?

Pages: 1 [2]  All   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read January 25, 2006, 10:53:03 AM #40
ynohtna

Re: Time Based or Frame Based?

Fixed time-step logic provides complete determinism, which is vital for recording and playback of replays and networking. And having the ability to record and play replays makes debugging easier too.

As always, it all depends on what your requirements are.
Offline  
Read January 27, 2006, 06:23:08 PM #41
gamesmad

Re: Time Based or Frame Based?

I would say time based, there is nothing more annoying than a game playing to quickly for you to be able to control what is happening.  It also means that those with a lower spec machine can still play the game, and the time limits etc would still be accurate to them, meaning they can share their times with people online.

Will
Offline  
Read January 28, 2006, 07:35:15 AM #42
ynohtna

Re: Time Based or Frame Based?

Uh, as mentioned previously it's quite simple to decouple logic calculations from the frame rendering rate.

This article at Gamasutra explains the concept better than I could, although my code implementation is far cleaner. Wink
Offline  
Read January 28, 2006, 10:24:43 AM #43
Luzersoft

Re: Time Based or Frame Based?

Timer should definitively be frame-based. For example, if you're planing on making game with 60 FPS and someone gets 10 FPS and game timer is time-based then player couldn't do anything whitin time limit with 6 times slower game.
Offline  
Read January 28, 2006, 11:00:52 AM #44
gamesmad

Re: Time Based or Frame Based?

Having it time based is also easier if you ever try to implement some kind of Internet/LAN play, because otherwise, those with a higher spec system would ALWAYS win, however good the other player was, which would be the WORST thing ever for those with less powerfull machines.

Will
Offline  
Read January 29, 2006, 12:54:02 PM #45
ynohtna

Re: Time Based or Frame Based?

Uh, nope.

Think of the rendering frame rate as decoupled from the logic updates - between rendering updates (a frame) the processor clock is checked for the time since the last frame rendered and the appropriate number of game logic updates performed to maintain a consistent logic update rate.

So, if the user's machine is only rendering at 10FPS but the game logic updates are supposed to run at 60Hz then 6 iterations of the game logic are performed each frame. Conversely, if the user has a ninja machine which can render at 120Hz then each game update is only performed every other frame.

The reason this is vital for network play and replay reproducibility is that time-delta based calculations (position += direction * velocity * frame_duration) will not match the same calculation performed at a different frame duration due to accumulation and rounding errors. Position calculations across different client machines will instantly lose synchronisation. Also, frame-rate independent logic must be implemented to ensure that each machine performs the same number of AI calculations per second (of real-time). Otherwise, the player whose machine is rendering 120 FPS will find that their enemies are thinking 4 times faster than someone's whose machine is only rendering 30 FPS.

Does that make sense? I really recommend reading the Gamasutra articles on reproducible behaviour and networked game programming if my explanations are too fuzzy (highly possible). Trust me, these systems are implemented in professional game engines for good reason.
« Last Edit: January 29, 2006, 12:58:46 PM by ynohtna »
Offline  
Pages: 1 [2]  All   Go Up
Jump to:  

Page created in 0.161 seconds with 17 queries.