Schedules | Members | Resources | Tools | Assignments | Message Boards
Story | Screenshots | Downloads | Objective | Home
Collision detection is the practice of checking if objects in the game have intersecting polygons. Different games handle instances of collision differently, but most don't allow it. We're taking that approach.
There are several means of detecting for collision. The one we are using is a multi-level system. The first check is grid-based. We place all objects on a grid and check if multiple objects share a grid-space. If they do, we move to the second check: bounding boxes. By placing boxes around the objects, we can check encase all the polygons in a simple box. If the boxes intersect, we agree to call it an interaction. This is a quick algorithm that will prove very practical in our game.
Then, we need to determine what to do in the case of an interaction. In the case of low velocity motion, we may choose to move an object to the last safe place. In the case of high velocity motion, we need to calculate a distance which would make sense for a bounce.
Object Collision & the Enemy MarchThis has everything to do with recording object position and maintaining it until all collision detection is complete. Basically, consider you are running with an enemy close behind. Well, if you detect the enemy's new position first, he might have runned right into you, or so it seems, until we record your new position. Now, everything is right in the world again. However, the only way to be sure you complete that calculation is to create a second table with new locations, and check collision there. Then, you must interpolate against the first table to determine an appopriate position in the event of a collision.
Object Collision for Projectile SpeedsWhat I more clearly mean is checking for objects that may pass completely through each other from one frame of action to the next. How this is determined is to create a 2d equation with starting point of original position and ending point of new position (y = mx + b from (x1,y1) to (x2,y2)). Then, you check to see if it's possible it two moving objects have intersecting courses. If so, check if it occured at a point that exists for both equations. Then, check moving objects against solid objects. If so, you bounce objects accordingly from their meeting point.