2
\$\begingroup\$

I have read the article here about realtime systems and am looking for examples specific to game loops.

Am I correct in saying:

Hard realtime systems will lag and slow down gameplay causing slow motion if processing of AI, collision detection, or user input is delayed past the rendering deadline set by the realtime system. Example, must render every 1/30 sec but processing caused delay to 1/20 sec.

Soft realtime systems will render at 30 FPS regardless of the other subsystems processing but if there is a delay in AI, collision detection, or user inputs, the game will be presented in stop motion instead of slow motion every 1/30 sec.

\$\endgroup\$
2
\$\begingroup\$

There is hardly any practical relation between soft and hard realtimes in industry(what the wiki page is about) and gaming. It is usually hardware or OS designed to meet deadlines where it is absolutely a must e.g. navigation systems in airplanes. Unless you ship (own) RT OS with your game you don't have to worry about anything like this simply because the OS you are running the game on was not designed to do such thing.
Also there is no slow motion in hard realtimes it is not designed to ever not meet deadline(actually, when designing one you have to prove first there is no possibility at all of not-meeting deadline) - not meeting deadline in hard RT would usually means death, or billion dollar assembly line blowing up. For soft RT it is more relaxed - it can be simplified as "if you did not managed to finish computing physics, I don't care about (this frame's) physics anymore". You should probably understand the first sentence by now.

\$\endgroup\$
  • \$\begingroup\$ So there is no side effect to missing a Hard RT deadline, its system failure or crash. And for soft RT the processing for a frame is abandoned if the deadline is missed but the execution continues. \$\endgroup\$ – David Nov 2 '15 at 6:35
  • \$\begingroup\$ @damorton no, missing hard RT deadline never happens, if it does the results are undefined(and usually bad). In games it would be profiling your game and proving that the loop can never finish late on any machine or system load(you have to agree this can be nearly impossible). For soft RT yes, the single task not meeting deadline is abandoned, what task is, however, depends on your implementation - it can be for example frame. \$\endgroup\$ – wondra Nov 2 '15 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.