The determination of whether or not two or more entities make contact with each other during gameplay.

learn more… | top users | synonyms (2)

3
votes
2answers
466 views

2D destructable terrain with collisions in MMO

Task What I want is to create destructable terrain (like in Worms) and collisions with this terrain (with calculated normals) that will be fast enough to work on server machine. Basically lets say ...
4
votes
5answers
541 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 ...
0
votes
2answers
409 views

GLSL light coloring blocked surfaces

I have created a very simple lighting shader. It currently only supports point lights, but it lights up surfaces that are completely blocked from the light. I know why, but I want to know how I can ...
1
vote
2answers
173 views

Per color collision is really expensive - can my approach be improved?

I've been working on adding a color based collision component which takes a list of colors and checks to see if an object is colliding with any of them. However, the operation seems to be extremely ...
2
votes
3answers
335 views

What is the best way to check lists of objects that collide

I am making a top down shooter in XNA. I have a player, a list of enemies, a list of world objects like crates, trash cans, etc. and the map which has walls. Is there a better way to check for ...
2
votes
1answer
328 views

RK4 integration and Continuous Collision Detection

I'm using this method to detect collision between two AABBs. The algorithm is simple, fast and works great. It uses the relative velocity between the two objects to calculate TOI. This works fine with ...
4
votes
2answers
654 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 ...
1
vote
1answer
230 views

Pygame - Change sprite collision Rect

I'm making a platformer in Pygame. One of the sprites I'm using is a flag, and I want to detect if the player collides with the flagpole (just like in Super Mario Bros). The problem is that the image ...
2
votes
1answer
311 views

Min/Max of two vectors?

This seems like a simple question, but i'm having trouble searching the internet for it. In XNA, during a collision detecting method, I would determin the minimum of some vectors. // Get the minimum ...
4
votes
3answers
560 views

Boundaries in game development: How do “professionals” do it?

How do professionals do boundaries in a 2D game? The way I do is say I don't want the sprite to move into a certain area: //Example if ((playerPosX >= 825) && (playerPosX <= ...
-1
votes
1answer
176 views

simple escape algorithm: enemy escapes when hero approches

I need some clues on a "escape" algorithm. My scene a 2D rectangle (0,0,1000,1000) I have enemy sprites on this scene. They are immobile until distance from hero <100. If distance<100, enemy ...
0
votes
2answers
162 views

Why does this collision detection & resolution code only work for one side?

I am having a bit of trouble with my collision detection. It only works correctly for the right side, meaning, if I enter the tile from any other side, it brings me to the right side. Here is my ...
1
vote
2answers
190 views

Simple Bounding Sphere Calculations for 2d game

I'm writing a 2d game and have a question regarding the use of bounding spheres. I'm kind of OK with the math, but I'm confused about one thing. To work out the distance between the 2 centre points ...
1
vote
1answer
284 views

Collision Detection Tips

I need collision detection for my 3D racing game but it isn't going well right now. I think I understand the concept of testing boxes and generating a response, however implementation part is a ...
7
votes
1answer
208 views

Determining whether two fast moving objects should be submitted for a collision check

I have a basic 2D physics engine running. It's pretty much a particle engine, just uses basic shapes like AABBs and circles, so no rotation is possible. I have CCD implemented that can give accurate ...
6
votes
2answers
2k views

Get collision details from Rectangle.Intersects()

I have a Breakout game in which, at some point, I detect the collision between the ball and the paddle with something like this: // Ball class rectangle.Intersects(paddle.Rectangle); Is there any ...
0
votes
1answer
230 views

Can't detect collision properly using Rectangle.Intersects() [closed]

I'm using a single sprite sheet image as the main texture for my breakout game. The image is this: My code is a little confusing, since I'm creating two elements from the same Texture using a ...
4
votes
2answers
186 views

Collisions on complex map 2D

I'm currently thinking about collision and map system that I want to use in my next game and I'm kind of puzzled. Maps are going to be somewhat complex with lots of irregularities and thus tiling is ...
0
votes
0answers
281 views

Swept sphere to line segment intersection in 2D

How can you determine when a moving sphere intersects a line segment, and the normal of that intersection? Ideally Javascript, but anything that's tidy, simple and self-contained and easy to port to ...
-1
votes
2answers
233 views

My 2D collision code does not work as expected. How do I fix it?

I have a simple 2D game with a tile-based map. I am new to game development, I followed the LazyFoo tutorials on SDL. The tiles are in a bmp file, but each tile inside it corresponds to an internal ...
5
votes
2answers
274 views

How do I find actors in an area on a poly-precise basis?

Ok, I've been asking various questions and getting some good answers, but I think I need to rethink my method, so I'll describe the problem. I have a player who has a big blue box in front of him. ...
2
votes
2answers
417 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 ...
0
votes
1answer
322 views

Sweep and Prune vs Quad Tree

I need some broad phase algorithm for my 2d game (shmup, bullet hell). Does one or another solution have any major advantages?
2
votes
2answers
1k views

Efficient collision detection - tile based HTML5/Javascript game

I'm building a basic RPG game and I'm looking at collisions/pickups etc now. It's tile based and I'm using HTML5 and Javascript. I use a 2D array to create my tilemap. I'm currently using a switch ...
1
vote
0answers
82 views

Collision detection code style [closed]

Not only there are two useful broad-phase algorithms and a lot of useful narrowphase algorithms, there are also multiple code styles. Arrays vs. calling Make an array of broadphase checks, then ...
0
votes
1answer
155 views

SFX Played Once per Collision or Hit

I have a question about using Box2D (engine for LibGDX used to make realistic physics). I observed on the code that I've made for the physics here below: @Override public boolean touchUp(int screenX, ...
0
votes
1answer
749 views

HTML5 platformer collision detection problem

I'm working on a 2D platformer game, and I'm having a lot of trouble with collision detection. I've looked trough some tutorials, questions asked here and Stackoverflow, but I guess I'm just too dumb ...
2
votes
1answer
125 views

Collision Detection algorithms with early Collision exit

I'm using collision detection in Monte Carlo simulations and at the moment I'm using GJK which is quite fast. I can't help to think it could be done even faster though. In the simulations, about 70% ...
8
votes
3answers
765 views

Narrow-phase collision detection algorithms

There are three phases of collision detection. Broadphase: It loops between all objecs that can interact, false positives are allowed, if it would speed up the loop. Narrowphase: Determines whether ...
2
votes
1answer
663 views

circle - rectangle collision in 2D, most efficient way

Suppose I have a circle intersecting a rectangle, what is ideally the least cpu intensive way between the two? method A calculate rectangle boundaries loop through all points of the circle and, ...
4
votes
2answers
320 views

Space-efficient data structures for broad-phase collision detection

As far as I know, these are three types of data structures that can be used for collision detection broadphase: Unsorted arrays: Check every object againist every object - O(n^2) time; O(log n) ...
2
votes
1answer
697 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 ...
1
vote
1answer
93 views

Collision planes confusion

I'm following this tutorial by thecplusplusguy and in the linked video he explain that for example for the world basement and walls we need to create the actual rendered (shown to the player) walls ...
6
votes
1answer
1k views

How many and which axes to use for 3D OBB collision with SAT

I've been implementing the SAT based on: http://www.geometrictools.com/Documentation/DynamicCollisionDetection.pdf for 3D collisions On page 7, in the table, it refers the 15 axis to test so we can ...
7
votes
5answers
764 views

How do I calculate distance from a point to a rectangle?

I have a 2D rectangle with x, y position, height and width, and a randomly positioned point nearby. Is there a way to check if this point might collide with the rectangle if it is closer than a ...
3
votes
1answer
369 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 ...
4
votes
1answer
439 views

3d Collision Handling

I have trouble while detecting collisions on my 3D-Game. I have set-up Rays, to detect collisions (Screenshot) and my main-rountine already analyzes them. But now there's the question what to do ...
0
votes
2answers
430 views

map data structure in pacman

i am trying to make a pacman game in c# using GDI+, i have done some basic work and i have previously replicated games like copter-it and minesweeper. but i am confused about how do i implement the ...
2
votes
2answers
162 views

Typical collision detection

I would like to know how is the typical collision detection of most games. For example, you control a character which can move in 2 dimensional directions (except up and down). Now lets asume he walks ...
2
votes
2answers
525 views

Collision checking problem on a Tiled map

I'm working on a pacman styled dungeon crawler, using the free oryx sprites. I've created the map using Tiled, separating the floor, walls and treasure in three different layers. After importing the ...
1
vote
1answer
439 views

How do 2D physics engines solve the problem of resolving collisions along tiled walls/floors in non-grid-based worlds?

I've been working on implementing my SAT algorithm which has been coming along well, but I've found that I'm at a wall when it comes to its actual use. There are plenty of questions regarding this ...
0
votes
1answer
117 views

enemy behavior with boundary to change direction

I'm doing space shooter kind of game, the logic is to reflect the enemy if it hits the boundary. With my logic, sometimes enemy behaves like flickering instead of changing the velocity. It's like ...
1
vote
1answer
458 views

XNA Per-Polygon Collision Check

I'm working on a project in XNA for WP7 with a low-poly environment, my problem is I need to setup a working per-polygon collision check between 2 or more 3d meshes. I've checked tons of tutorials ...
1
vote
1answer
168 views

this.BoundingBox.Intersects(Wall[0].BoundingBox) not working properly

I seem to be having this problem a lot, I'm still learning XNA / C# and well, trying to make a classic paddle and ball game. The problem I run into (and after debugging have no answer) is that ...
2
votes
1answer
361 views

How does the SAT collision detection algorithm work

There are a lot of tutorials and sample code available showing how to implement the SAT collision detection algorithm. But can someone explain, without math or code, what are the general principls ...
1
vote
1answer
325 views

How do I get the axes for SAT collision detection

In SAT collision detection how do I calculate the axes for projection?
1
vote
1answer
179 views

Who should respond to collision: Unit or projectile?

In an RTS if a projectile hits a unit. Who should handle the collision? If projectile handles the collision, it must be aware of all possible types of units, to know what damage to inflict. For ...
9
votes
2answers
482 views

Boat passing under a bridge in a 2D tile based RTS

I'm writing a 2D tile based RTS. And I want to add a 'pseudo 3D' feature to it - bridges over the rivers. I havent't start any coding yet, just trying to think how it fits the collision detection ...
3
votes
5answers
1k views

2D Collision detection for Pinball Game

So far in previous games I have used simple 2D collision with boxes then checking at pixel level for a collision. If making a pinball game in nearly a lot of frames the ball will be in contact with a ...
-1
votes
1answer
440 views

Making a perfect map (not tile-based)

I would like to make a map system as in the GameMaker and the latest code is here. I've searched a lot in google and all of them resulted in tutorials about tile-maps. As tile maps do not fit for ...