The determination of whether or not two or more entities make contact with each other during gameplay.
7
votes
1answer
3k views
Microsoft XNA Platformer Example, is the Collsion Detection implemented accurately?
The example provided by Microsoft seems as if the collision detection (from what I can see) will have a small error. When the user collides with an Unpassable tile, the depth of the intersection is ...
43
votes
7answers
4k views
2D Platformer AABB collision problems
I have a problem with AABB collision resolution.
I resolve AABB intersection by resolving the X axis first, then the Y axis.
This is done to prevent this bug: http://i.stack.imgur.com/NLg4j.png
...
4
votes
1answer
4k views
How can I use Rectangle.Intersect() to resolve collisions in XNA?
I have a 2D game written in XNA, and I've been trying to fine-tune my collision resolution. All of my game objects are squares, which means detecting a collision is easy - use the position and the ...
6
votes
4answers
2k views
How do I calculate the angle of the slope at a point on a 2D bitmap terrain?
I have an arbitrary destructible bitmap terrain like the one in "Worms". It's easy to work out if a character or missile intersects the terrain, but how do I work out the angle of the slope at the ...
5
votes
2answers
2k views
How to determine collision direction between two rectangles?
I am trying to figure out how to determine the direction a collision occurs between two rectangles.
One rectangle does not move. The other rectangle has a velocity in any direction. When a collision ...
11
votes
5answers
2k views
2D Rope Collision Detection
I'm wanting to create a rope that can collide with objects like in the following youtube video:
2D Game Physics Rope
I'm thinking that you implement the verlet integration which uses points and ...
8
votes
2answers
2k views
Collision resolution in case of collision with multiple objects
I have static objects and movable objects. The collisions are detected using the separating-axis-theorem.
For example, in this situation I have two static objects (in red):
and a movable object ...
107
votes
9answers
16k views
How was collision detection handled in The Legend of Zelda: A Link to the Past?
I would like to know how the collision detection was done in The Legend of Zelda: A Link To The Past.
The game is 16x16 tile based, so how did they do the tiles where only a quarter or half of the ...
22
votes
6answers
5k views
How does a collision engine work?
How exactly does a collision engine work?
This is an extremely broad question. What code keeps things bouncing against each other, what code makes the player walk into a wall instead of walk through ...
22
votes
10answers
10k views
What is the fastest way to work out 2D bounding box intersection?
Assume that each Box object has the properties x, y, width, height and have their origin at their center, and that neither the objects nor the bounding boxes rotate.
17
votes
4answers
3k views
Should collision detection be done server-side or cooperatively between client/server?
I am working on an online game that will have very heavy collision detection processing. Player models will collide with other players, mobs, structures, terrain, and solid objects that only exist ...
7
votes
8answers
2k views
How do I prevent my platformer's character from clipping on wall tiles?
Currently, I have a platformer with tiles for terrain (graphics borrowed from Cave Story). The game is written from scratch using XNA, so I'm not using an existing engine or physics engine.
The tile ...
6
votes
2answers
1k views
Isometric Collision Detection
I am having some issues with trying to detect collision of two isometric tile.
I have tried plotting the lines between each point on the tile and then checking for line intercepts however that didn't ...
4
votes
1answer
340 views
Collision Detection with SAT: False Collision for Diagonal Movement Towards Vertical Tile-Walls?
I'm developing my first tile-based 2D-game with Javascript. To learn the basics, I decided to write my own "game engine". I have successfully implemented collision detection using the separating axis ...
21
votes
8answers
868 views
Is there a simple way to stop enemies standing in the same spot?
So: top-down game, my enemies chase the player, when they get within a certain distance they stand still and fire. If they're all coming from the same direction they all end up standing in the same ...
5
votes
1answer
2k views
Sidescroller variable terrain heightmap for walking/collision
I've been fooling around with moving on sloped tiles in XNA and it is semi-working but not completely satisfactory. I also have been thinking that having sets of predetermined slopes might not give me ...
0
votes
1answer
656 views
Making an efficient collision detection system
I'm very new to game development (just started 3 months ago) and I'm learning through creating a game engine. It's located here. In terms of collision, I know only brute-force detection, in which ...
-5
votes
4answers
1k views
How to implement a 2d collision detection for Android
I am making a 2d space shooter using opengl ES. Can someone please show me how to implement a collision detection between the enemy ship and player ship. The code for the two classes are below:
...
7
votes
2answers
7k views
Is there a good way to get pixel-perfect collision detection in XNA?
Is there a well-known way (or perhaps reusable bit of code) for pixel-perfect collision detection in XNA?
I assume this would also use polygons (boxes/triangles/circles) for a first-pass, quick-test ...
28
votes
3answers
2k views
A ball hits the corner, where will it deflect?
I need to brush up my trigonometry and hope you can help here with a simple mathematical model. Here is my model so far in the image attached. I am aware that the frame animation has other problems ...
10
votes
5answers
3k views
2D Level design/editing/saving questions
I thought about making a simple 2D Sidescroller game like SuperMario.
Then i wondered about how to save, load or create the levels for the game. The first thing i thought of was drawing a simple ...
20
votes
6answers
2k views
What is a good algorithm to detect collision between moving spheres?
If (for the purpose of collision detection) 3D objects are represented in a game by spheres, what is a good algorithm to detect a collision between spheres?
If each object has a position as of the ...
12
votes
6answers
3k views
How do I handle Isometric collision detection?
I would like to make an isometric run-jump style platformer. The player should be able to jump on top of platforms above the floor, hit the side of objects etc.
I'll be using a 2D game engine so I ...
8
votes
4answers
798 views
What's the most efficient way to find the intersection point of a missile and a bitmap terrain?
Following up on my earlier question about finding the slope of a 2D bitmap terrain I now need to know the best way of finding the point on the 2D terrain that the missile hit. Obviously, I can see if ...
13
votes
2answers
946 views
Best/Efficient way to implement a 3d Collision
I've already programmed a 2d based collision system for a previous game. It was my first collision system and it was ugly. I was looking for collision between objects by checking all objects with all ...
7
votes
1answer
2k views
Circle-Line Collision Detection Problem
I am currently developing a breakout clone and I have hit a roadblock in getting collision detection between a ball (circle) and a brick (convex polygon) working correctly. I am using a Circle-Line ...
6
votes
4answers
1k views
Is there a way to increase the collision check efficiency of a system of n objects?
I'm making a game that consists of many onscreen objects, one of which is the player. I need to know which objects are colliding every iteration.
I made something like this:
for (o in objects)
{
...
4
votes
4answers
4k views
2D Platformer Collisions
I've basically asked this question before, and I know it's been asked probably a billion times, but I still can't seem to do it. All I want to know is how I should go about doing basic 4-way, ...
2
votes
3answers
4k views
2D Tile-based Collision Detection
I've been planning an indie game project for a while now. I'll summarise it for you so I can get right to the question.
It's done entirely using the latest version of XNA through Visual Studio. ...
7
votes
5answers
3k views
2D rectangular object collision - Detect direction
Coming form this question, I'm needing some more help.
I need some ideas to find out from which side the collision came, and react accordingly.
Use this image as reference:
The blue lines are the ...
4
votes
3answers
2k views
Collision Detection Structure
I'm well aware of how to detect if two or more 2D objects collide but I'm interested in how to decide whether to check for a collision. In previous projects, I just had every object check against ...
7
votes
2answers
3k views
2D object-aligned bounding-box intersection test
I have two object-aligned bounding boxes (i.e. not axis aligned, they rotate with the object). I'd like to know if two object-aligned boxes overlap. (Edit: note - I'm using an axis-aligned bounding ...
5
votes
3answers
3k views
OBB vs OBB Collision Detection
Say you have two Bounding Box Objects each of them storing the current vertices of the box in a vector with all the vertices of the object rotated and translated relative to a common axis.
Here is an ...
5
votes
2answers
2k views
Stuck in Wall after rectangle bounding box collision
Using XNA's built in Intersects() on two Rectangles, I can detect a collision and set my velocity to zero. However, the object is stuck there and can't get out! How can I resolve this collision ...
4
votes
1answer
1k views
Minecraft-style player-gound collision detection
The title pretty much says it all... (Minecraft is a game consisting of evenly-spaced cubes for terrain, like voxels)
Note: I am using C# XNA.
I am pretty sure AABB is the way to go, yet I don't know ...
4
votes
1answer
1k views
2D collision-detection middleware
(This question was split off from http://gamedev.stackexchange.com/questions/3345/)
Are there any recommendable middleware available for 2D collision detection?
I believe I've heard that Box2D could ...
1
vote
4answers
951 views
Which Side Was Hit?
I am working on an Android game and I have two objects A and B (both rectangles) and when they collide I simply want to know which side of B was hit. I have detected the collision fine, but I am ...
1
vote
4answers
3k views
Side detection on Rectangle collision detection?
How can I determine which of the sides on a Rectangle that was hit by another Rectangle (or Circle if that's easier)?
I originally tried creating 8 subrectangles for my main rectangle - one for each ...
6
votes
2answers
1k views
How do I find the point of impact with 2D per-pixel collision detection?
I'm creating a platformer and have implemented per-pixel collision detection. However, this has caused 2 obstacles that I've yet to figure out. The first obstacle, which this question is about, is ...
6
votes
4answers
3k views
Cocos2D collision detection against a random shape
I would like to brainstorm a few ways of handling how to detect a collision between a sprite and a user generated shape of some sort.
For example. There are 3 objects on the screen. The user takes ...
5
votes
1answer
1k views
Fast, accurate 2d collision
I'm working on a 2d topdown shooter, and now need to go beyond my basic rectangle bounding box collision system.
I have large levels with many different sprites, all of which are different shapes and ...
5
votes
3answers
402 views
How to separate colliding objects without creating more collisions
Suppose I use a simple discrete collision detection system where I move all objects then check for collisions. I want any colliding objects to be separated (of course) and assigned appropriate ...
5
votes
4answers
2k views
2D Platformer Collision Handling
I am trying to create a 2D platformer (Mario-type) game and I am some having some issues with handling collisions properly. I am writing this game in C++, using SDL for input, image loading, font ...
0
votes
1answer
529 views
How can I test if my rotated rectangle intersects a corner?
I have a square, tile-based collision map. To check if one of my (square) entities is colliding, I get the vertices of the 4 corners, and test those 4 points against my collision map. If none of those ...
6
votes
1answer
2k views
Given a plane and a point, how can I determine which side of the plane the point is on?
Given the point
Vector pos = new Vector(0.0, 0.20156815648078918, -78.30000305175781, 1.0);
and the plane (triangle)
Vector a = new Vector(-6.599999904632568, 0.0, -78.5, 1.0);
Vector b = new ...
4
votes
1answer
604 views
AABB - AABB Collision, which face do I hit?
To allow my objects to slide when they collide, I need to :
Know which face of the AABB they collide with.
Calculate the normal to that face.
Return the normal and calculate the impulse that to ...
3
votes
1answer
697 views
Circle-Rectangle collision in a tile map game
I am making a 2D tile map based putt-putt game.
I have collision detection working between the ball and the walls of the map, although when the ball collides at the meeting point between 2 tiles I ...
3
votes
1answer
1k views
New Vector Calculation for Elastic Collision of Circle and Fixed Rectangle
I am writing a fairly simple breakout-style game for Android phones. I have successfully detected the collisions between the ball(s) and bricks. The problem that I am having is in calculating the new ...
2
votes
1answer
215 views
Collision Detection Efficiency
I've just written my first successful collision detection code, and it works great for a small scene of actors (player + 4-5 obstacles).
However, I realize that since it checks every possible ...
1
vote
2answers
382 views
SAT, How Do I Find The Penetration Vector?
I've just successfully implemented Separating Axis Theorem (SAT) in my game but I was wondering how do I find the penetration vector? I heard it can be useful for collision response. e.g. The harder ...

