Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
0 answers
217 views

I just managed to implement my Sweep and Prune algorithm together with AABB and it's working correctly in the first axis (I haven't implemented second and third yet to complete the collision detection)...
Zoler1337's user avatar
2 votes
1 answer
163 views

I'm new to Unity. I was wondering what the best workflows were for placing colliders. I'm going for high performance, and I've heard that mesh colliders aren't as performant as just placing down box ...
Taylor Goeman's user avatar
0 votes
3 answers
151 views

I'm making a simple game engine using Java and have found a major issue. To create accurate collision detection I decided to convert a transparent image into a ...
Grinding For Reputation's user avatar
0 votes
1 answer
46 views

I am doing a Unity project, that makes it necessary to import a mesh consisting of triangles. As it is possible to reduce the amount of triangles in a mesh and keeping the structure similar, I am ...
Enceladus's user avatar
2 votes
1 answer
738 views

I am writing code that requires me to find all points within circle on certain parts of the screen hundreds of times per frame. I wrote a quadtree for this and have 1 method called query_circle that ...
Aayush's user avatar
  • 67
3 votes
1 answer
4k views

I am making a Bloons tower defense game and I came across a problem with regards to collisions. The way my code currently works is all the current bullets on the screen(could be potentially thousand) ...
Aayush's user avatar
  • 67
0 votes
0 answers
22 views

In my unity 2d game I had large amount of scripts which were components of different enemies and obstacles. All of them were checking for collison, had FixedUpdate, Start and OnCollisionEnter2D and ...
Lordoftherings's user avatar
1 vote
0 answers
87 views

It bothers me that a lot of character controllers are written to rely on raycasting for movement along the ground. While this solution is very straightforward and general (especially in the sphere ...
smallobsession's user avatar
1 vote
1 answer
490 views

This question can be generalized to "how does one efficiently determine if a collision has taken place between curvy lines" On https://slither.io there are snakes that players play as that ...
Ryan Peschel's user avatar
0 votes
1 answer
280 views

I have a Unity 2D project which has a player character and numerous NPCs all potentially moving (top-down) at the same time during play. The number of NPCs is not to exceed 100 (and will be, probably, ...
Offlein's user avatar
  • 103
5 votes
1 answer
3k views

I have a whole bunch of entities constantly being processed and testing for collisions. I've tried to optimize this by stopping certain entity types from checking each other, dead entities not being ...
Aquaphor's user avatar
0 votes
0 answers
341 views

I found that state-of-the-art physics engines like Bullet and Box2D all use binary AABB-Tree for broad-phase collision detection. I wonder, did anybody tested AABB-tree with >2 branches per node ? ...
Prokop Hapala's user avatar
0 votes
3 answers
3k views

I'm building a 2D MORPG using JavaScript, Node JS and socket.io To prevent cheating, I have to run all collisions for all players on my server. I'm currently doing fairly simple square collisions ...
Pascal Claes's user avatar
4 votes
1 answer
3k views

I have two 2D arbitrarily-positioned axis-aligned squares. I need to find the minimum distance between those squares – i.e. if you were to draw them, what's the length of the shortest line you could ...
Max's user avatar
  • 143
3 votes
2 answers
3k views

In Unity3D, and others, there are Layer Based Collision System which makes collisions only happen between specified Layers. It defaults to all layers colliding with all others. Does making use of ...
Jethro's user avatar
  • 309
1 vote
1 answer
184 views

I am asking this question because I am currently at the point where I have to think about how the characters in the game that I am making will be animated and I want to check if my desired approach ...
simulate's user avatar
  • 145
0 votes
1 answer
325 views

For detecting collisions between sprites, I know a 2D spatial hash is a way to optimize the number of collision checks that need to happen. But is there a way to optimize even further for objects that ...
rurouniwallace's user avatar
0 votes
1 answer
549 views

I want to build a simulator using Game Maker in which there are many (up to hundreds) of obj_Cell, each has a radius of 10, (they don't have sprites, they just draw ...
user289661's user avatar
0 votes
2 answers
534 views

I gave an answer to How to decide which GameObject should handle the collision?, and received a lot of negative feedback on it, claiming that it does not matter who does the collision detection. I am ...
Evorlor's user avatar
  • 5,881
0 votes
1 answer
177 views

In my 2D platformer game, I have a number of sprites moving around the world. When two sprites collide with each other, I calculate how deep the collision is and then call a virtual method on both ...
Celarix's user avatar
  • 203
1 vote
1 answer
711 views

I have two ways of doing frustum culling taken from different web sources. First one takes 200ms to check 10k AABBs, second around 50ms for the same box count. I read some forum answers, people say 0....
Russoul's user avatar
  • 282
10 votes
1 answer
2k views

In a physics engine I'm developing (for learning) using love-2d, I implemented collision resolutions in this way: ...
dnk drone.vs.drones's user avatar
14 votes
4 answers
14k views

Part for the sake of optimization, part for learning purposes, I will dare to ask: How can I most efficiently check whether a 2D point P is inside a 2D rotated ...
Louis15's user avatar
  • 569
1 vote
3 answers
264 views

I have a number of quads (suppose like 20-40) and i want to quickly check the collisions between any of them. I would like to know if there's a quick algorithm to do that 60 times per second without ...
user avatar
0 votes
2 answers
545 views

My project has upwards of 3000 2D objects but not all of them collide with each other. Between each object that can collide, a CollisionPair is created and stored inside a flattened array. Currently, ...
JPtheK9's user avatar
  • 2,031
1 vote
2 answers
295 views

I'm developing a game in Android using LibGDX (although this is more of a JAVA problem than an engine problem). My aim is to have my player bounce off one spring onto another that will eventually take ...
eyes enberg's user avatar
0 votes
2 answers
185 views

I am developping a spaceinvader-like game. There comes the problem of how to handle collision detection. At first I was doing like that : ...
realUser404's user avatar
  • 1,057
1 vote
2 answers
1k views

I am optimizing my "little" Java (LibGDX) shooter game, and perhaps unsurprisingly, collision detection is a "bottleneck"; I've kind of reached my performance goals already, but I want to tweak the ...
user2499946's user avatar
3 votes
1 answer
332 views

I am new to game programming and working on clone of this game in libgdx. The game has some static balls and one ball that moves. I want to check if the moving ball collides with any static ones, but ...
Zohaib Amir's user avatar
4 votes
2 answers
2k views

I'm using a quadtree to prune collision detection pairs in a 2d world. How should I choose to what depth said quadtree is calculated? The world is made mostly of moving objects1, so the cost of ...
Evpok's user avatar
  • 161
6 votes
2 answers
8k views

I'm new to programming and want to speed up the collision detection in my C++ 2D platformer game engine. Currently, only the player's collision detection works: Every frame, the player's update ...
barwin's user avatar
  • 63
1 vote
1 answer
2k views

Until now I used a list of objects sorted by a single axis for limiting the amount of objects that collisions are checked against. The idea is simple: if the x coordinate of two objects differs by ...
API-Beast's user avatar
  • 6,869
2 votes
0 answers
302 views

I'm writing the beginnings of a lightweight 2d rigid body engine (in javascript, as a hobby project), and i'm debating whether to store collision shapes in local or in (updated as needed) world ...
skwashi's user avatar
  • 36
1 vote
1 answer
1k views

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, ...
Stick's user avatar
  • 339
24 votes
6 answers
8k views

While developing a reasonably simple RTS-like game, I noticed my distance calculations were causing an impact in performance. At all times, there are distance checks to know if a unit is in range to ...
Grimshaw's user avatar
  • 3,131
17 votes
3 answers
12k views

EDIT/UPDATE: My biggest question right now is whether step 3's "t=..." equation is a good idea or there a better way to do it. Most other issues have been partially or fully addressed, but no ...
9 votes
4 answers
7k views

I was recently reading about the technology of Ocarina of Time/Majoras Mask and discovered that world collision is done using a single triangle mesh (vertices, normals, etc) for an entire area. There ...
Justin Meiners's user avatar
13 votes
5 answers
5k views

If this is your first time on this question, I suggest reading the pre-update part below first, then this part. Here's a synthesis of the problem, though: Basically, I have a collision detection ...
Vittorio Romeo's user avatar
20 votes
3 answers
12k views

Are physics engine able to decrease that complexity, for example by grouping objects who are near each other and check for collisions inside this group instead of against all objects ? (for example, ...
jokoon's user avatar
  • 5,253
7 votes
1 answer
2k views

I lately integrated Bullet Physics into my little game engine, but for now I only use basic shapes as spheres or boxes for collision checks. For more realistic physics I need collision meshes for all ...
danijar's user avatar
  • 5,751
5 votes
2 answers
3k views

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) space. ...
Marian Ivanov's user avatar
1 vote
0 answers
285 views

For a new game we have do set up a scene with a minimum of 30 bone animated models.(shooter) The problem is that the update process for the animated models takes too long. Thats what I do: Each ...
Mathias Hölzl's user avatar
1 vote
2 answers
596 views

Something about my implementation of a basic 2x4 grid for collision detection is slow - so slow in fact, that it's actually faster to simply check every bullet from every enemy to see if the ...
Fibericon's user avatar
  • 657
1 vote
1 answer
354 views

The game I'm creating is a bullet hell game, so there can be quite a few objects on the screen at any given time. It probably maxes out at about 40 enemies and 200 or so bullets. That being said, I'm ...
Fibericon's user avatar
  • 657
5 votes
1 answer
14k views

The target platform of my game is mobile devices therefore I try to develop it performance oriented. It will be a strategy game so I don't really need physics in it, consequently I did not add ...
nosferat's user avatar
  • 822
2 votes
4 answers
8k views

I'm working in a 2d environment and have hundreds of objects, brute force collision checking would be out of the question, but would my method below work? For example, lets say I have a ...
rxc's user avatar
  • 91