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)

2
votes
2answers
133 views

SAT - How to find Shortest line between two static convex 2D Polygons

I have a pretty standard SAT algorithm that seems to successfully be detecting collisions.. but now I am looking for some assistance in finding the Shortest line between 2 separated Polygons. I ...
0
votes
1answer
386 views

How do I handle collision response between many different types of game objects?

I am looking for a way to avoid the dreaded switch or if/else scenarios between numerous game object types when a collision takes place in a game. For example: You have a list of game objects which ...
0
votes
2answers
349 views

2D Rectangle Collision

I want to make a small 2D game. In the game you can go in all directions(with the bird's-eye view) and can shoot. (A little bit like BoxHead http://de.y8.com/games/box_head_2play) My problem there is ...
1
vote
1answer
86 views

Calculating the point(s) at which two moving objects are a certain distance from each other

Problem This is similar to a Closest Point of Approach calculation, but instead of the closest point(s), I want the points at which the objects are a given distance away from each other. (Imagine two ...
1
vote
2answers
571 views

Why is mesh baking causing huge performance spikes?

A couple of seconds into the gameplay on my Android device, I see huge performance spikes caused by "Mesh.Bake Scaled Mesh PhysX CollisionData" In my game, a whole level is a parent object containing ...
0
votes
0answers
127 views

How can I align a 2D object properly using tilemap collision

I'm making a mario clone, and I have been working on the collision but I can never seem to get it right. I started out with "true/false" collision, aligning the player at it's last position, and as ...
2
votes
2answers
129 views

Sweep collision between two moving spheres?

Say I have a scenario like this: Here I got two spheres (sphere A and B) that moves from on spot to another during a frame. How can I predict where these two collide if they collide at all? In ...
0
votes
1answer
256 views

How do I implement pixel-exact collision server-side?

Recently I made a 2D offline game with HTML5 Canvas and JavaScript. I'm detecting collisions by first checking whether image bounding boxes overlap. If they do, I check against the bounding boxes, ...
1
vote
2answers
157 views

Collision detection circle-segment-segment

I've already implemented collision detection in my game loosely following this tutorial, which works great, but I realized there's one major flaw. The player and the enemies are circles, while the ...
3
votes
3answers
219 views

Using uniform grids for collision detection - Efficient way to keep track of what a cell contains

I was looking for an efficient way to implement collision detection in a 2D game. A way that won't result in an O(n^2) level of complexity. A lot of people recommend to use Uniform Grids for this ...
0
votes
1answer
113 views

How do physics engines like Box2D detect and respond to collisions between arbitrary polygons?

I've always wondered how collision detection like this was achieved, and I've always wondered what the response would be. Do they perform line-line intersection tests for each line making up the two ...
0
votes
0answers
79 views

How to implement Uniform Grid for collision detection

I want to implement a unifrom grid to use for collision detection in my 2D Java game. This way instead of checking for each game object if it collides with any other object on the screen, I only check ...
3
votes
1answer
150 views

Calculate point of circle–circle collision between frames

I need to find the exact XY coordinate where a circle collides with another circle calculated between frames. This means that I take the coordinate of the moving circle on the previous frame and take ...
0
votes
1answer
77 views

How do I keep enemies from clumping up into one area? [duplicate]

I am making a zombie game and as I was making it I noticed the zombie AI starts to clump up into one mega zombie in one area. I was wondering how I could keep the zombies from doing that and instead ...
2
votes
1answer
154 views

How to impale and stack targets correctly according to the collider and its coordinate?

I'm making another simple game, a catch game, where a spawning target game object must be captured using a skewer to impale it. Here how: At the start, the falling object (in red) will fall in a ...
0
votes
1answer
272 views

Top-down player collision with walls

I am having trouble trying to think of how I am going to approach collisions in my game. My idea which sucked in the beginning because it would reduce performance dramatically has failed which was ...
1
vote
1answer
170 views

Pixel Perfect collision detection on rotated bitmaps [duplicate]

I have two bitmaps which are being drawn onto a canvas using a matrix canvas.drawBitmap(bitmap, matrix, paint); first to work out if I need to check for a collision i am using eucilidean vectors ...
0
votes
0answers
87 views

Precalculating timespan of bullet collision on cubic bezier curve circles?

I'm fairly new to game logics, C#/XNA (The language/library of choice) and bezier curves in general, and is stuck in my current project. I'm going to try to explain as thoroughly as I can what the ...
3
votes
1answer
120 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 ...
0
votes
0answers
63 views

Overlap detection, nearest neighbors

I'm trying to get something similar to the Nearest Neightbor Problem, except I only want neighbors with radius overlapping a radius, and all of them. I'll explain my problem before explaining what I ...
0
votes
3answers
168 views

Collision Detection in a big map?

So I've been wondering lately... on games like pokemon (on ds and gba), How did they handle the collision of all those tiles in the map? Should all those collision checks running in the background ...
1
vote
0answers
100 views

Speeding up point-in-polygon for Python

In researching collision detection methods for non-Rect-like objects I came across point-in-polygon -- specifically, the even-odd rule. The one presently on Wikipedia claims it is written in Python, ...
0
votes
1answer
417 views

How does Raycasting work in XNA Farseer and player collision?

Wanting to know how to figure out if player's bottom is colliding with object so that I could allow the player to jump. I was trying to use OnCollision but was referred to ray-casting, I looked ...
2
votes
3answers
1k views

libgdx - collision detection with tiled map java

currently, I am working on a 2d rpg game which is similar to final fantasy 1-4. I can load up a tiled map and the sprite can walk freely on the map. However, I will like to create a wall for it to ...
1
vote
1answer
149 views

Calculating How To Intercept a Moving Object [duplicate]

So I have two objects, Target and Interceptor. Target's position, direction of movement and movement speed are known, and Interceptor's position and movement speed are also known. Both movement speeds ...
3
votes
1answer
152 views

Calculating impulse with multiple collision points

In my amateur 2D rigid body physics engine for a game I react on collisions between two bodies with an impulse j (formula 11) as explained here. To calculate this impulse I need one contact point P ...
0
votes
1answer
1k views

Platformer raycast collision detection

I'm using Unity to create a 2D platformer. For collision detection, I'm using raycasting to detect any possible collisions with specific collision layers, and adjusting the desired delta x & y ...
0
votes
2answers
159 views

Efficient type checking in collision detection

Basically, what's the most efficient and professional means of checking an object's type when it collides with another object. For instance (ignoring the math for collision detection), suppose we have ...
1
vote
1answer
110 views

How to make platforms spawn without touching other platforms

So I am making a doodle jump like game where there are platforms scrolling by but right now how I have platforms spawning is completely random. I would like the platforms to be spread apart so they ...
0
votes
0answers
119 views

Farseer Player Movement and Collision

I have added a video link for any one who whats to see what the problems are by watching the game. I am trying to create a player movement system and there are small problems that I am running into. ...
0
votes
0answers
147 views

Polygon Collision Response

I'm working on a game engine that has a built in custom physics engine (I know it's a waste of time, but I have years to make this, so why not make it good?). Currently, with any number of polygons, ...
0
votes
1answer
129 views

Strange collision in Breakout [closed]

My Breakout game works fine so far, but I struggle with the collision detection... Well... just with the collision from the ball with the brick... Here's the relevant code: List<Brick> ...
0
votes
1answer
211 views

How to architect collision detection in SFML

I have a pretty simple game engine that I'm making for a 2d platformer game. I don't want it to be super advanced, but it does have some basic properties. Most important to this question is a class ...
0
votes
2answers
85 views

Collision detection in seemingly random locations [closed]

I have a square that moves around with user input and should return to top left of screen when it collides with one of the rectangles on the screen. It works fine when the the rectangles are not ...
0
votes
0answers
179 views

Non-rectangular hitbox methods in XNA

I'm creating a 2D top-down RPG, and many of my buildings/scenery have non-rectangular corners to the textures. Does anyone know a good way to create circular/triangular/polygonal hitboxes, or is too ...
6
votes
2answers
628 views

Triangle-triangle continuous collision detection

I am making a 3D game engine and I use continuous collision detection. I am using Sphere-Trees to cull primitive collision checks to a minimum. However, I'd like to perform continuous ...
8
votes
2answers
2k views

How can I prevent rigid bodies from moving through each other using Unity's built-in physics?

I'm trying to create a game where objects can be dragged, but I'm having trouble with the physics. With rigid bodies that have similar masses, they sometimes push through each other when dragged and ...
1
vote
1answer
257 views

Player Movement Systems

I am working on a project were in class my group of students help produce a video game. We are creating a 2D platformer and was trying to make a pixel based system collision witch fell through. Now I ...
9
votes
1answer
570 views

How do I make a curved surface out of rectangular blocks?

For a Peggle-like game, I want to make blocks that follow a curve, like this: The blocks would then disappear as the ball hits them. I managed to draw some horizontally, but I'm having trouble ...
0
votes
1answer
37 views

Ground hitting system [closed]

I want to know how to make character hit ground and lose health. For example: when character is falling of one meter he losing only a small part of his health, and when he's falling of 10 metters he ...
4
votes
1answer
248 views

How do I simulate a trampoline?

I'm quite new to game development. I was pretty impressed with the elastic effect I saw in this flash game when the ball hits the trampolines and I'm wondering how to recreate it. I've done some ...
1
vote
2answers
196 views

Collision detection via adjacent tiles - sprite too big

I have managed to create a collision detection system for my tile-based jump'n'run game (written in C++/SFML), where I check on each update what values the surrounding tiles of the player contain and ...
2
votes
0answers
322 views

C++ FPS game collision detection with partitioning system or physics engine? [closed]

I'm working on a small FPS game (as a hobby and for learning purposes, nothing else) built with C++ in OpenGL (from scratch). Documenting online on the kind of strategy someone would approach with ...
0
votes
0answers
74 views

Interactions between camera and procedural terrain

QUESTION REWORKED I need to update every frame camera position along a surface with hills and drops. In this picture you can see a particle of the surface terrain (just one triangle) and a sphere ...
1
vote
1answer
350 views

Strange collision behaviour in 2D game even though the collision is very basic [closed]

I have a player ship (cube) and some enemy laser projectiles. When the player ship has position X values greater than 1, collision with the enemy projectiles occur but when it has lower X values, the ...
0
votes
0answers
113 views

Smooth circular collisions with edges/collision boxes [C# + XNA]

So, me and a friend are working on our top-down perspective 2D game, and have come to work on perfecting our collisions. In its current state our player sprite is colliding with walls, but is ...
2
votes
2answers
186 views

Collision detection - make sure the player touches the object exactly

I know this is really something I should be able to figure out on my own, but a solution is evading me. Okay, here are a few relevant parts of my code. bool Game::Col(int x1,int y1,int w1,int h1, ...
0
votes
1answer
109 views

CDK (as3) false positives when using it with array elements

I'm having problems when using the CDK (Collision Detection Kit) with elements in an array. It keeps getting me false positives of collision. I'm making a game in which the player controls a “ship”, ...
2
votes
1answer
195 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
1answer
606 views

Libgdx - Collision position - Box2D

I'm actually developping my own game but i'm facing a little problem. I trying to figured out how to get the position of a fixture (collision) between two entities. For example this : ...