Hello.
I am doing 2d top down game, and i am storing objects as(chair, unit, tree, stone...) in a 1d vector, i used to loop all objects to seach for but, as the map grew in size and i require faster search for objects in it at this point.
For perspective, map size X = 3200pixels, map size Y = 3200pixels and has 5 layers, objects size vary from 5x5 pixels to 96x128 pixels in size, there can stacked one upon other.
What i require: I want to speed up the process when i search for a object that fits the search criteria. My solution would be to separate map intro smaller peaces and with that achieve easier search for objects.
For one scenario lets take this: A unit moves, it needs to check if position is valid, it needs to check each object if it collides with the new position unit wants to move to, it no collision found, position fine and it can reposition the unit, if collision was found no movement can be done.
I thought if i separate map intro smaller peaces i can check only the peace where unit wants to move and efficiently reducing amount of objects that it has to check collision with.
The question: What is the term called when i want to separate a big map intro smaller peaces, id like to read on the topic and educate, i have no experience in it, and i don't know the term.
Also if you want to do suggestions, fell free to do so .