Jump to content

  • Log In with Google      Sign In   
  • Create Account

Seperated world intro smaller chuncks, object occupies more the none chunk


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 BaneTrapper   Members   -  Reputation: 1246

Like
0Likes
Like

Posted 02 July 2014 - 06:37 AM

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 biggrin.png.


Edited by BaneTrapper, 02 July 2014 - 06:38 AM.

Current projects:
The Wanderer, 2d turn based rpg style game

www.gamedev.net/topic/641117-check-up-the-wanderer/


Sponsor:

#2 Lactose!   GDNet+   -  Reputation: 3818

Like
4Likes
Like

Posted 02 July 2014 - 06:40 AM

Spatial partitioning?

http://gameprogrammingpatterns.com/spatial-partition.html

 

EDIT: Also see the references at the bottom for other methods of partitioning.


Edited by Lactose!, 02 July 2014 - 06:40 AM.


#3 BeerNutts   Crossbones+   -  Reputation: 2999

Like
1Likes
Like

Posted 02 July 2014 - 07:37 AM

Spatial Hashing is also a term used for this.  Be sure to include that in your googling (you'll find some gamedev articles on it in fact)


My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#4 BaneTrapper   Members   -  Reputation: 1246

Like
0Likes
Like

Posted 06 July 2014 - 06:27 AM

Thank you, i totally forgot i asked for it here, that helps allot!


Current projects:
The Wanderer, 2d turn based rpg style game

www.gamedev.net/topic/641117-check-up-the-wanderer/





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS