Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Make collision detection run more frequently than drawing  (Read 2657 times)

0 Members and 1 Guest are viewing this topic.

BlueMagic

  • Newbie
  • *
  • Posts: 49
    • View Profile
Make collision detection run more frequently than drawing
« 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

HKei

  • Newbie
  • *
  • Posts: 23
    • View Profile
Make collision detection run more frequently than drawing
« Reply #1 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).

BlueMagic

  • Newbie
  • *
  • Posts: 49
    • View Profile
Make collision detection run more frequently than drawing
« Reply #2 on: February 13, 2012, 06:56:27 pm »
Ho would I go about doing it then?

tobybear

  • Newbie
  • *
  • Posts: 27
    • View Profile
Make collision detection run more frequently than drawing
« Reply #3 on: February 13, 2012, 07:00:53 pm »
This page should have all information you need:
http://www.koonsolo.com/news/dewitters-gameloop/