Collision detection is the determination of whether or not two or more entities make contact with each other during gameplay.

learn more… | top users | synonyms (2)

8
votes
2answers
390 views

Platform jumping problems with AABB collisions

See the diagram first: When my AABB physics engine resolves an intersection, it does so by finding the axis where the penetration is smaller, then "push out" the entity on that axis. Considering ...
4
votes
5answers
589 views

Collision detection performance problem

Using python and pygame I've built a collision detection system according to the instructions in this YouTube tutorial. This is updated 40 times per second and controls movement and collision ...
4
votes
2answers
1k views

Sliding collision response

I have been reading plenty of tutorials about sliding collision responses yet I am not able to implement it properly in my project. What I want to do is make a puck slide along the rounded corner ...
4
votes
1answer
2k views

How can I convert a 2D bitmap (Used for terrain) to a 2D polygon mesh for collision?

So I'm making an artillery type game, sort of similar to Worms with all the usual stuff like destructible terrain etc... and while I could use per-pixel collision that doesn't give me collision ...
4
votes
2answers
2k views

Algorithm to fit shapes to 2D grid?

Let's say you have an n-by-m grid. Some squares are occupied, some are not. You want to know where in the grid you can fit arbitrary shapes such as to not hit an occupied square. The shapes would ...
3
votes
1answer
341 views

Moving the jBullet collision body to with the player object

I am trying to update the location of the rigid body for a player class, as my player moves around I would like the collision body to also move with the player object (currently represented as a ...
3
votes
3answers
253 views

Physics System ignores collision in some rare cases

I've been developing a simple physics engine for my game. since the game physics is very simple I've decided to increase accuracy a little bit. Instead of formal integration methods like fourier or ...
3
votes
2answers
2k views

3D Ball Physics Theory: collision response on ground and against walls?

I'm really struggling to get a strong grasp on how I should be handling collision response in a game engine I'm building around a 3D ball physics concept. Think Monkey Ball as an example of the type ...
2
votes
1answer
288 views

How do I create a player movement system in Farseer?

My group of students is helping produce a a 2D platformer. We tried making a pixel-based collision system which fell through. Now I am trying this physics engine on for size and see new ways to create ...
2
votes
1answer
2k views

Would someone please explain Octree Collisions to me?

I've been reading everything I can find on the subject and I feel like the pieces are just about to fall into place, but I just can't quite get it. I'm making a space game, where collisions will ...
10
votes
2answers
535 views

How do I make good guy attacks only hit bad guys and vice versa?

My game has many different type of good guys and many different type of bad guys. They will all be firing projectiles at each other but I don't want any accidental collateral damage to occur for ...
10
votes
4answers
2k views

Collision rectangle response

I'm having difficulties getting a moveable rectangle to collide with more than one rectangle. I'm using SFML and it has a handy function called intersects which takes 2 rectangles and returns the ...
7
votes
5answers
2k views

How to determine which cells in a grid intersect with a given triangle?

I'm currently writing a 2D AI simulation, but I'm not completely certain how to check whether the position of an agent is within the field of view of another. Currently, my world partitioning is ...
7
votes
3answers
695 views

Your recommendation for path construction from a single background image?

So I currently have my background as a single PNG and some obstacles (like blocks as part of that PNG). In order to create a path, I currently store pixels above a unique green color (my hill) and use ...
6
votes
4answers
3k views

How do I find the intersection of two lines

I have a bounding box on my character, its position in the previous frame an the current frame. The bounding box is axis aligned. My character is running around inside a cave, I have a list of ...
5
votes
2answers
333 views

How to handle collisions without ugly conditionals and type checking?

(I asked a similar question, but this one is far more specific). How can I handle collisions without having to do a lot of type checking and if statements? People here suggested that when spotting a ...
5
votes
1answer
3k views

how get collision callback of two specific objects using bullet physics?

I have got problem implementing collision callback into my project. I would like to have detection between two specific objects. I have got normall collision but I want one object to stop or change ...
5
votes
2answers
831 views

Collision response for 2D racing game

The title is fairly self-explanatory. I have a 2D racing game that utilizes per-pixel collision detection (the track is essentially two bitmaps, one for the graphics, one for collision data). The ...
5
votes
2answers
1k views

Tile based collision detection failing when player is going too fast

I'm creating a side scroller and I'm have a problem with my collision detection. The collision detection works perfect when the player is falling at a constant speed, but when I implement more ...
4
votes
1answer
682 views

Character jittering with this tile based collision code

I have been trying to get my collision code working for hours now but with every resource I have tried my character still jitters. First I tried using the platformer sample but my character still ...
4
votes
1answer
1k views

2D Collision: Check before or check after?

I'm using velocity to move my character, I just add/subtract 0.4f and then update the players position in the update loop. I was wondering, when would be the best place to check for collision? Do I ...
4
votes
1answer
944 views

Are there any good engines for isometric collision detection and platforming?

I've decided to resurrect an old game idea I had years ago. I currently have zero experience with programming, but I'm going to begin studying either C#, Python or both in the near future. The issue ...
4
votes
1answer
3k views

Line-Rectangle Collision Detection and Response

I've looked through Google and none of the solutions seem to pinpoint my idea. Ultimately, I want to create a level editor where I can draw lines and have them exported to a file for my engine to ...
3
votes
3answers
147 views

Lerping character moving up and down slope tiles

So, when interpolating position against a standard 'horizontal' platform, everything works great. What happens is something like this..... (Question continues after graphic) Now, the question I ...
3
votes
1answer
135 views

How to detect if a ball will collide with another, and the normal vector of the collision?

So I have a 2D game involving balls (circles) colliding. I want to be able to detect if two balls will collide before it happens, and the normal vector of the collision if a collision is going to ...
3
votes
1answer
123 views

How do you prevent AABBs from passing through each other?

I know what an AABB is, but I don't know how you would check for collision with an object that is going really fast. If an object goes fast enough, it can skip over other bounding boxes without it ...
3
votes
2answers
427 views

Collision Detection - Slide Around Sprite

I'm creating an RPG using XNA/C# and am trying to add some complicated collision detection code. I have the playable character 'Wizard' and when it collides with something, a method gets called in his ...
3
votes
1answer
1k views

Platformer Starter Kit - Collision Issues

I'm having trouble with my game that is based off the XNA Platformer starter kit. My game uses smaller tiles (16x16) then the original (32x40) which I'm thinking may be having an effect on collision ...
3
votes
4answers
694 views

How to avoid collision detection to enter infinite loop in this case?

I am writing a collision detection system which uses the logic mentioned by Trevor here But I have anticipated a problem which I have shown as a diagram How do we handle this problem?
3
votes
3answers
2k views

Collision detection of convex shapes on voxel terrain

I have some standard convex shapes (cubes, capsules) on a voxel terrain. It is very easy to detect single vertex collisions. However, it becomes computationally expensive when many vertices are ...
2
votes
1answer
209 views

When is a quadtree preferable over spatial hashing?

I'm making a 2d platformer with lots of objects at the same time. They're all AABB collision detected. I first tried a quadtree to decrease the number of of objects to check, tried a few different ...
2
votes
2answers
631 views

How do I detect multiple sprite collisions when there are >10 sprites?

I making a small program to animate the astar algorithm. If you look at the image, there are lots of yellow cars moving around. Those can collide at any moment, could be just one or all of them could ...
2
votes
3answers
2k views

Game physics / 2D Collision detection AS3

I know there are some methods you can use like hittestPoint and so on, but I want to see where my movieclip colliedes with another another movieclip. Any other methods I can use? by any chance does ...
2
votes
3answers
691 views

Collision Detection Problems

So I'm making a 2D tile based game but I can't quite get the collisions working properly. I've taken the code from the Platformer Sample and implemented it into my game as seen below. One problem I'm ...
2
votes
1answer
506 views

3D RTS pathfinding

I understand the A* algorithm, but I have some trouble doing it in 3D to suit the needs of my RTS Basically, in the game I'm making, there will be agents with different sizes of OBB collision boxes. ...
1
vote
1answer
544 views

Box2D: Efficient method to create b2Chainshapes for a tile-based map?

I'm working on a platforming game with tile based levels. I store the collision model for my tileset in an array. This is how the collision model for a 4x4 tilesheet would look like (I can't post ...
1
vote
1answer
160 views

How can I make it so that my player object doesn't penetrate world collision when I'm holding down movement keys in that direction?

Right now I have a player object and an obstacle, both with bounding box rectangles around them. The issue is that when my player runs into this obstacle, as long as I'm holding down the movement key, ...
1
vote
1answer
709 views

How to detect screen boundary using AndEngine GLES1?

I am using the AnalogOnScreenControl to move my sprite around the screen. I would like to restrict the sprite so it can not move outside the screen boundaries. I have tried putting a line at the ...
1
vote
2answers
3k views

Collision detection - Smooth wall sliding, no bounce effect

I'm working on a basic collision detection system that provides point - OBB collision detection. I have around 200 cubes in my environment and I check (for now) each of them in turn and see if it ...
1
vote
1answer
987 views

Java 2D Tile Collision

I have been working on a way to do collision detection forever, and just can't figure it out. Here's my simple 2D array: for (int x = 0; x < 16; x++) { for (int y = 0; y < 16; y++) { ...
1
vote
1answer
425 views

How can we match polygon data structure with a background image

I am referring to this fireball game. The ball will collide with background, which is in polygon form. I was wondering, how I can match my polygon data structure with the background image. Say, I ...
1
vote
3answers
3k views

How to detect which edges of a rectange touch when they collide in iOS

I'm creating a basic "game" in iOS 4.1. The premise is simple, there is a green rectangle ("disk") that moves/bounces around the screen, and red rectangle ("bump") that is stationary. The user can ...
0
votes
1answer
418 views

How can I determine which direction a 2D collision is occurring from?

The problem is as follows: Think 2D Zelda (Links Awakening, A Link to the Past) style movement where you can run into walls from any of the four cardinal directions, or basically up, down, left, and ...
-1
votes
1answer
307 views

Detailed Modern Opengl Tutorial? [duplicate]

I am asking for a specific modern opengl tutorial. I need a tutorial that does not skip to explain any lines of code. It should also include different independent objects moving/rotating (most ...
7
votes
1answer
3k views

How do I calculate collision response between a sphere and a plane?

I'm trying to create a simple 3D game and need to constrain the player within the limits of the game world. When the player hits the sides of the world I want the player's ship to bounce off slightly. ...
7
votes
3answers
736 views

Polygon editor to draw collision data over image

I need an editor to plot a polygon over the texture for of a ship in my game. It would look like this.. Where the red is the collision outline and the image is the texture. I want to store the ...
5
votes
2answers
979 views

Swept AABB vs Line Segment 2D

I've really exhausted as much as Google has to give, I've spent a solid week googling every combination of words for an "AABBvsLine sweep", downloaded countless collision demos, dissected SAT ...
4
votes
1answer
664 views

Collision Filtering in Box2D

I have four bodies in my Box2D World. Each are polygon shape, with some physics parameters. Now when the game start, I need one of the bodies from the World (BodyA) to not be allowed to collide with ...
4
votes
1answer
1k views

Effects of collisons: broken glass, damaged cars, how are they created?

My question is related in particular to achieving the effects of collision in game engine, how is this done? I have searched a bit, read from the internet and went through a few tutorials, and saw ...
4
votes
2answers
825 views

I need help with 2D collision response (of stacking rotating polygons, with friction and gravity, for a game)

Hi I am looking for suggestions on how to write a collision response for game programming purpose (so not a scientific simulation). I am dealing with 2D polygons that are rotating, and I want them to ...