SFML community forums
Help => General => Topic started by: Dark Nemesis on January 24, 2014, 06:45:22 pm
-
I am making a game and using the same code as mentioned in SFML Game Development Book.
I am using the fixed time steps method (where I send a fixed dt time every time I call update).
I have set my frame rate to 60.
Now the problem arises, I want to move 420 pixels per second, which makes up 7 pixels per frame (due to 60 FPS). This leads to tunneling/ghosting of my objects (as some collision objects are shorter). The only way to reduce tunneling is if i move less pixels per frame. That can be achieved either by increasing the FPS or by reducing the overall pixel/sec. speed of the object. The first thing causes performance issue, while the latter makes game play issues.
So is there any another way, other than these two, to remove tunneling (completely, if possible)??
Thanks
-
Of course there are other ways. Since you use the term tunnelling, did you ever try to make some research on it (e.g. google "collision detection prevent tunneling")?
The basic idea is, that you predict where the object will be in the next iteration and make sure it doesn't jump over other objects.
-
Check out this Gamasutra article: http://www.gamasutra.com/view/feature/3015/pool_hall_lessons_fast_accurate_.php