Questions tagged [spatial-partitioning]

Spatial partitioning refers to dividing up some space (such as the game world) into regions with the intent to efficiently search or traverse those regions or the objects within those regions.

Filter by
Sorted by
Tagged with
0 votes
2 answers
32 views

Using spatial hash to determine view distance

I am creating a client/server that is 2D and based on a map. Characters on the server are then separated into a spatial hash. I am using this to determine who to send data to, essentially, people in ...
Charlie's user avatar
  • 101
1 vote
2 answers
91 views

Performance for range of effect in city builder

I am working on a city building game where all buildings are axis aligned rectangles. Currently I am using spatial hashing to detect if the insertion of a building intersects a building in the board. ...
nico.user's user avatar
  • 111
0 votes
0 answers
186 views

Can inserting/removing one point in a quadtree or octree cause multiple splits/collapses?

I was reading Robert Nystrom's Game Programming Patterns website and, in the section about spatial partitioning, particularly in the section on quadtrees, he mentions: Objects can be added ...
Carmo's user avatar
  • 157
0 votes
0 answers
58 views

Gauss-Krüger system to Unity Coordinate Conversion

In my recent project, I am getting an object file via a request to REST API and found that the OBJs (object file) are in Gauss-Kruger System. I want to know that how exactly I place the model as I ...
Muhammad Faizan Khan's user avatar
1 vote
2 answers
1k views

Optimizing a quadtree for circles and circular queries

I'm developing a 2D ant simulation in JavaScript. I'd like to implement a quadtree to store the positions of ants and other markers. I approximate all of these entities as circles, and I'm only ...
Aaron Eads's user avatar
1 vote
1 answer
1k views

Using octrees as LOD system

I am using an octree to define my 3D voxel world. And I want to use octree subdivision as a LoD system. This means, subdivide close to the player, but far away nodes un-subdivided. But it occurs to me ...
Bram's user avatar
  • 3,729
1 vote
0 answers
89 views

3D Binary Space Partitioning with solid/empty leaves

I've recently started looking into BSPs for real-time collision detection, and I'm now looking into improving the performance of my solution. The system that I've implemented is rather similar to the ...
Lolslayer's user avatar
0 votes
0 answers
210 views

Help deciding data structure for spatial partitioning, using only value-types in c#

I simply want to implement some sort of grid where I can sort units in an RTS into cells, and then for each unit check to avoid other units and attack other units, in 2d. My map grid is currently 10 ...
Tree3708's user avatar
0 votes
0 answers
625 views

2D Spatial Hashing in C++ Causing Game to run more Slowly

I'm trying to use spatial hashing to speed up collision detection in my game. I believe spatial hashing is better suited for my game than quadtrees, because I have lots of fast-moving objects in my ...
makinGames's user avatar
0 votes
2 answers
553 views

How to handle objects at the edges of spatial partition cells?

A lot of games store object positions as floats and have a closed ball for the game area (eg. a rectangle and objects are allowed to have position coordinates on all 4 edges). However, this becomes ...
Shuri2060's user avatar
  • 113
0 votes
1 answer
126 views

Does collision detection data structures require a manifold mesh

Is it possible to apply spatial split techniques (oct-trees bsp-trees, etc) when meshes are not necessary manifolds? The mesh in question represents the "map". This means that it is static so spatial ...
user877329's user avatar
24 votes
4 answers
7k views

How can I detect "rooms" in a 2D side scrolling game?

I'm looking to create a system that recognizes certain types of buildings and rooms you can create in game, like how Terraria detects "residences." In that game, a house can be constructed in a tile-...
Bernardo Becker's user avatar
4 votes
2 answers
3k views

Performance problems with quadtree for dynamic objects

I´ve implemented a quadtree spatial partitioning to my game engine as I wanted to try it and see how it affects the performance checks. The results were great (instead of hundreds collision checks ...
Pins's user avatar
  • 549
3 votes
0 answers
183 views

How often should I do a spatial partition over a top down MMO 2D game?

I am writing an top down 2D game like agario/diep.io and I am using spatial hashing for detecting on screen objects. However I find it is too expensive to do a spatial partition a few times a second. (...
newguy's user avatar
  • 255
0 votes
2 answers
2k views

Looking for a 2D spatial partitioning method for my top down browser game

Hi I am currently using a modified version of spatial hashing algorithm written by Christer Bystrom. This algorithm is OK for collision detection. However when I use it for detecting entities in ...
newguy's user avatar
  • 255
0 votes
1 answer
191 views

Should I check all the collisions in the game world?

I'm developing a 2D game engine and right now I'm designing the collision system. I've read about space partitioning and quad trees, and I understand that only the objects that are in the user's ...
Beto's user avatar
  • 23
2 votes
2 answers
384 views

How do I efficiently choose the terrain chunks to render based on the player position?

Well, I have an array with all the terrains. How do I render them? I just add them to a List of terrains that are sent to the Renderer. There, every terrain of the list is rendered. The problem is ...
Daniel Béjar's user avatar
1 vote
0 answers
110 views

How can I represent collection of distant but visit-able stars while using minimal resources?

I have recently started to plan a project in Unity that will be for Android. I have a database that consists of over 150,000 stars (may trim this down if I/O cripples the overhead). The game will ...
MarsYeti's user avatar
  • 135
0 votes
1 answer
1k views

How can I find the object closest to a given 2D point?

I have an array of objects. Their position is a Vector2. I want to select the closest object, given an X and Y coordinate that represents an user touch on screen. ...
alexpfx's user avatar
  • 137
0 votes
2 answers
228 views

Quick algorithm to identify undrawn rectangles inside a map

I already have a working algorithm for this but it's home-made and there is some redundancy in the things it checks, so I'm looking for a fast algorithm (or the name of it) that would detect undrawn ...
the_yellow_logo's user avatar