All Questions
Tagged with collision-detection optimization
60 questions
1
vote
0
answers
217
views
Sweep and Prune algorithm performance
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)...
0
votes
3
answers
149
views
Reduce processing time of image to shape
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 ...
2
votes
1
answer
738
views
Efficiently find all points within a circle
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 ...
0
votes
0
answers
22
views
More smaller scripts or less larger in Unity 2d Development? Better or worse performance? [duplicate]
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 ...
1
vote
1
answer
488
views
How does a game like slither.io handle collision?
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 ...
5
votes
1
answer
3k
views
Quadtree for AABB collision boxes
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 ...
0
votes
3
answers
3k
views
How to optimize collisions
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 ...
3
votes
2
answers
3k
views
How does layer based collision affect performance
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 ...
0
votes
1
answer
325
views
optimizing collision detection with stationary objects (walls, floors, obstacles, etc.)
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 ...
0
votes
2
answers
534
views
Does it matter who does the collision detection?
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 ...
1
vote
1
answer
710
views
Frustum culling takes ages c++
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....
14
votes
4
answers
14k
views
How do I efficiently check if a point is inside a rotated rectangle?
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 ...
0
votes
2
answers
544
views
Efficient Collisions Iteration?
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, ...
0
votes
2
answers
185
views
Collision detection enhancement
I am developping a spaceinvader-like game. There comes the problem of how to handle collision detection.
At first I was doing like that :
...
3
votes
1
answer
331
views
How do I efficiently collide and match groups of coloured circles?
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 ...
6
votes
2
answers
8k
views
How can I improve my collision detection's performance?
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 ...
2
votes
0
answers
301
views
Storing rigid body collision shapes in local or world coordinates
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 ...
24
votes
6
answers
8k
views
How to optimize the distance function?
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 ...
9
votes
4
answers
7k
views
How do collision meshes work in games like Zelda on the N64?
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 ...
20
votes
3
answers
12k
views
Are collision detection always O(n^2)?
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, ...
5
votes
2
answers
3k
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) space. ...
1
vote
2
answers
595
views
My grid based collision detection is slow
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 ...
5
votes
1
answer
14k
views
How to detect collision in Unity3D without rigid bodies?
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 ...