Collision prediction - Simple or complex approach?

Started by
4 comments, last by oliii 18 years, 4 months ago
Hello everyone. I'm in the process of creating a high quality breakout game [at the very least, that's where I'm aiming at]. My problem is choosing the type of collision checking system. Would predicting collision using equations be overdoing it or would checking for the next frame state enough? The ball's acceleration is not constant [depends on a couple of objects on the level, which affect the ball]. Would I need to run a simulation of the game on the background for it to check for collisions? The game uses delta time movemet, which means the ball might skip objects on a couple of occasions. Is delta time movement generally bad for breakout games? I guess I just need someone to point me to the right direction. Thanks in advance, Ori.
The Department of Next Life - Get your Next-Life Insurance here!
Advertisement
Quick question. Presumably your bricks are rectangular. Is the ball a rectangle also (presumably square), or is it a circle?
If you use vector maths in checking collision rather pixel perfect or rectangle-based collision detections, the system won't miss any collisions even at a low frame rate (I'm talking about 2 objects, for multiple objects colliding simultaneously that is an other story). So delta time based movement is applicable.

You may consider take a serious course learning game physics as it'll be easier for you (and your engine) when moving to 3D games. GDNet's articles maybe a good place to start.
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
I would suggest using a circle-line collision chech.
construct four lines out of your bricks and then check the lines
against the ball.
hope this helps.
Thanks for the replies.
The ball is a circle and the bricks are rectangles that may be placed diagonally.
I'd just like the game to have a professional feel - a single collision miss can and will break that image.
I've got google to search for many collision methods, which I have done, but more to the point, I need a system that would suit this game's needs.
I'll try having the game predict the next frame relying on the distance delta [ommiting the change in velocity and change in acceleration in hope it'll still look precise].
If there appear to be problems with the collision's stability I'll just corss that bridge when I get there.
Hopefully I won't have to rewrite too much code, but I guess experience eventually teaches best.
Anyhow, I'd be happy if anyone would care to throw some experience at me [smile]!
Thanks again,
Ori
The Department of Next Life - Get your Next-Life Insurance here!
here's some code for 2D sphere-polygon collision.

and for polygon-polygon collision.

for polygons, there is a discussion is here.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement