A process of adjusting game objects position after collision.

learn more… | top users | synonyms

28
votes
6answers
2k views

Hexagon collision detection for fast moving objects?

A object has a position and a speed vector. Usually only the position is used to check if two objects collide, this is problematic for very fast moving objects as it can happen that the object moves ...
17
votes
4answers
3k views

How to deal with corner collisions in 2D?

I'm writing a top down 2d XNA game. Since its my first I'm trying to write the physics and collision stuff myself to learn it. Whenever my player sprite character attempts to move into a position ...
12
votes
3answers
1k views

Resolving a collision with forces

In my 2D physics engine, I can detect AABB vs AABB collisions, and resolve them by finding the shortest penetration vector and adding it to the AABB's position. Doing this "pushes" the first AABB ...
12
votes
4answers
2k views

How do I calculate rotation caused by bounce friction?

Following on from my previous question: I have the ball quite realistically bouncing from surfaces it hits. Now I'd like to make it spin from the friction of the hit. Showing this is simple enough: I ...
11
votes
3answers
3k 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 ...
10
votes
4answers
1k 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 ...
9
votes
4answers
620 views

Make the player run onto stairs smoothly

I have a 2D Platform game, where the player Always runs to the right, but the terrain isn't Always horizontal. Example: I implemented a bounding-box collision system that just checks for ...
8
votes
1answer
4k 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 ...
7
votes
4answers
280 views

Need efficient way to keep enemy from getting hit multiple times by same source

My game's a simple 2D one, but this probably applies to many types of scenarios. Suppose my player has a sword, or a gun that shoots a projectile that can pass through and hit multiple enemies. ...
7
votes
3answers
598 views

Reusable top-down collision class

I've recently picked up monogame and am working on a simple top down game to get me started and learn the basics. I've got the movement and the rotation to follow the mouse sorted out but I'm stuck ...
7
votes
3answers
730 views

Collision Detection Game Design and Architecture

I've reading some articles about collision detection. My question here is about ideas on the design for it. Baically I have a C++ game that has a main loop with entities with an update method. Based ...
7
votes
2answers
2k views

How to resolve penetration of two colliding bodies

I've implemented simple 3D game physics engine. I already have decent collision detection in place, now I'm trying to figure out the collision response part. I'm using impulse based method to ...
6
votes
3answers
511 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 ...
6
votes
3answers
339 views

Calculating impulse propagation through a rigid body after a collision

I'm working on a game. I need to work out what the impulse is at different points on a body as a result of a collision. For example, in the following diagram, if there is a collision that results in ...
6
votes
2answers
2k views

How to implement friction in a physics engine based on “Advanced Character Physics”

I have implemented a physics engine based on the concepts in the classic text Advanced Character Physics by Thomas Jakobsen. Friction is only discussed very briefly in the article and Jakobsen himself ...
6
votes
1answer
247 views

Collision Detection problems for vertically moving platforms

Background My game is a static screen (ie, no scrolling) 2d platformer and my CD routine is split into 2 - after vertical movements, (ie, gravity etc) I check for collisions, and if they are ...
6
votes
3answers
3k views

Implementing Separating Axis Theorem (SAT) and Minimum Translation Vector (MTV)

I was following codezealot's tutorial on SAT and MTV and trying to implement it myself but I've come a cropper when it comes to getting the correct MTV. Here is my example: (Cue pretty pictures...) ...
6
votes
5answers
800 views

Need some advice regarding collision detection with the sprite changing its width and height

So I'm messing around with collision detection in my tile-based game and everything works fine and dandy using this method. However, now I am trying to implement sprite sheets so my character can have ...
5
votes
2answers
2k views

How do I resolve a collision with two tiles at once?

I am having some problems with collision detection. I have 2 types of objects excluding the player. Tiles and what I call MapObjects. The tiles are all 16x16, where the MapObjects can be any size, but ...
5
votes
1answer
1k 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 ...
5
votes
1answer
284 views

Move penetrating OBB out of another OBB to resolve collision

I'm working on collision resolution for my game. I just need a good way to get an object out of another object if it gets stuck. In this case a car. Here is a typical scenario. The red car is in ...
5
votes
3answers
706 views

When two moving objects collide, which one sends the message, and which one recieves it?

I am writing a platform game using an entity-component system. Entity-World collisions are robust and work very well, and I'm now working on collisions between entities. Just to be clear, in my code ...
4
votes
1answer
330 views

Help me please to choose proper path-finding algorithm

I am new to game development and just want to ask for advice. I need to know which path-finding algoritm will be suitable for my scenario: Units - any shape. But in most cases rectangles of ...
4
votes
3answers
182 views

How do I resolve a sphere-triangle collision in a given direction?

I am trying my hand at game physics. I understand that the basic way to pull back a sphere when it collided is to negate the penetration distance: // If collided... // `distance`: distance form ...
4
votes
3answers
228 views

Creating an unbiased deterministic collision resolution order

I'm working on a game with a replay system, so I need the game logic to be deterministic. A part of this is collision detection and I'm having a bit of a conceptual problem here. (I'm programming in ...
4
votes
2answers
364 views

Allowing a player to walk up and down slopes without resistance

I am trying to implement a platformer where both the player and the level are made up of arbitary polygons. One requirement is that the player can stand still on slopes, and walk up and down them ...
4
votes
3answers
224 views

XNA Collision is quircky/wobbly, how to improve?

I am sorry if this was already answered but I couldn't find the answer. So I am doing a tile based platformer and when I was making collision I had quiet a struggle I looked here and googled for ...
4
votes
2answers
166 views

Why is my collision resolution failing on the corners?

I'm tearing my hair out trying to work out how to handle my collision resolution at the corners of the rectangles that I'm colliding with. The code that I'm working with is: class Player(object): ...
4
votes
1answer
2k views

Collision with tile corners/seams in 2D platformer

There seems to be a lot of somewhat related questions answered already, but none I read answered my exact problem. I have a 2D platformer whose world is made entirely out of tiles that are in a ...
4
votes
2answers
746 views

XNA 4.0 / C# Collision Response

Okay, this is really starting to annoy me. First of all, detecting collisions is nice and easy. I have a list of tiles, and a player. The player and each tile have their own rectangles. (The tiles ...
4
votes
1answer
270 views

How to handle collision resolution in a top-down car game?

I have a top-down car game which takes place in an arena. The game is very very light on physics, so I'm not actually using a physics engine. The cars' movement is mostly managed by a struct I called ...
4
votes
2answers
695 views

Handling collisions with ground

How do you usually solve collisions between entities and the ground? Sending collision events hardly seems appropriate since almost everything touches the ground at almost all points in time. Calling ...
4
votes
1answer
118 views

Collision Response: game character vs. density function

Introduction I am working on my own "novelty" game-engine project, where the world is represented by a continuous density function. It has only one interface, a function that returns the density at a ...
4
votes
1answer
673 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 ...
3
votes
3answers
2k views

Ball collisions 'sticking' together

I have a program which simulates many bouncing balls. The balls can bounce off each other and off the sides of the container. The problem I am having is that sometimes when two balls collide, they ...
3
votes
1answer
336 views

Sensor based vs. AABB based collision

I'm trying to write a simple collision system, which will probably be primarily used for 2D platformers, and I've been planning out an AABB system for a few weeks now, which will work seamlessly with ...
3
votes
1answer
97 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 ...
3
votes
1answer
427 views

How to handle the top of a slope in a 2D tile-based platformer?

I'm working on a 2D tile-based platformer that supports 45-degree slope tiles. There are several questions on the topic, but none seem to cover this precise problem that I have. This excellent ...
3
votes
2answers
424 views

Collisions between moving ball and polygons

I know this is a very typical problem and that there area a lot of similar questions, but I have been looking for a while and I have not found anything that fits what I want. I am developing a 2D ...
3
votes
1answer
258 views

Collision detection for sloping tiles

I've been looking into adding 'sloping' tiles into my platform game and my first attempt at collision detection with these tiles has produced some promising results (considering it's a first attempt), ...
3
votes
1answer
252 views

2D collision resolution: works on each axis individually, but not with both combined

My collision detection method is solid and detects box to box collision every time. Then comes the resolve part which I'm struggling with quite a bit. It works perfectly when I'm manipulating the ...
3
votes
2answers
268 views

When to detect and respond to collisions?

I've usually implemented collision detection like this in the past: Move entity Check if it collides with anything Resolve the collision by moving it back That's also the approach employed by most ...
3
votes
1answer
405 views

Collision resolution - Character walking on ascendent ground

I don't know if the solution to this problem is quite straight-foward but I really don't know how to handle collision resolution on a game where the player walks on an ascendent floor which is not ...
3
votes
1answer
381 views

2D Motocross physics

I'm looking into making a 2D motocross bike game with plausible physics. It should look like this: For a first try, I've created only the player (a motocross driver) and the map (consisting of ...
3
votes
1answer
206 views

Is it possible to get the colliding sides using the separating axis theorem?

The title says it all, is it even possible to get the colliding sides? I'm checking for collisions between two OABBs, which works fine using SAT. Now I want to set the moving object's velocity to the ...
3
votes
1answer
202 views

How can I easily model semi-realistically human movement and collision in a 2D game?

I am writing a sports simulation game in which the simulated players will interact physically with each other (i.e. tackle, push, bump...) as well as do individual actions such as changing direction ...
3
votes
1answer
396 views

Meaning of offset in pygame Mask.overlap methods

I have a situation in which two rectangles collide, and I have to detect how much did they collide so so I can redraw the objects in a way that they are only touching each others edges. It's a ...
3
votes
3answers
174 views

Collision and Graphics integration

I'm a little confused about the integration between collision and graphics. They both need to share the same position in the world. The most obvious choice is the center of the entity, which is good ...
3
votes
1answer
379 views

SAT and then what?

I am on my way to make another Arkanoid game but this time I decided that I want it a little bit more realistic than just checking intersections between AABB and inverting one vector's component on ...
3
votes
2answers
737 views

AABB > AABB collision response?

I'm really confused about how to fix this in 3d? I want it so that I can slide along cubes but without getting caught if there's 2 adjacent cubes. I've gotten it so that I can do x collision, with ...