SFML community forums

Help => General => Topic started by: BlueMagic on February 13, 2012, 05:00:39 pm

Title: Make collision detection run more frequently than drawing
Post by: BlueMagic on February 13, 2012, 05:00:39 pm
I have seen quite a few game developers (including some from here) claim that they make the collision detection/logic run faster than the draw loop (ie: collision detection at 1000hz and drawing at 60hz or whatever).  What are the ways of achieving this?

I'm guessing threads are pretty much the only option (someone correct me if I'm wrong), but what do I want to have in consideration when programming this? Does anyone have some article as reference or anything?

Thank you very much
Title: Make collision detection run more frequently than drawing
Post by: HKei on February 13, 2012, 06:40:48 pm
No, threading is unnecessary. Logic is something very separate from drawing, so running the two at separate speeds isn't very problematic at all - just don't draw stuff when you don't need to.

(Though running logic at 60 Hz should be more than enough for most applications anyways).
Title: Make collision detection run more frequently than drawing
Post by: BlueMagic on February 13, 2012, 06:56:27 pm
Ho would I go about doing it then?
Title: Make collision detection run more frequently than drawing
Post by: tobybear on February 13, 2012, 07:00:53 pm
This page should have all information you need:
http://www.koonsolo.com/news/dewitters-gameloop/