SuperFreaksDev
Member
I'd like to drastically cut down on collision checks by using what I believe is a spatial grid (I think?)
Basically you'd split your room into different, equal sized cells, and every object is stored into one or more of these cells if they overlap them. Objects would only need to check for collisions with objects in the same cell(s).
I'd actually be capable of doing this myself, but I'm not sure how I should go about storing the information. If I have a ds_list for each cell that would work perfectly, but it might take up more memory. If I use a ds_grid then it would be easier to handle, but adding new object ID's to it would be much more difficult.
Here's an example of what I'm going for:
https://conkerjo.wordpress.com/2009/06/13/spatial-hashing-implementation-for-fast-2d-collisions/
Basically you'd split your room into different, equal sized cells, and every object is stored into one or more of these cells if they overlap them. Objects would only need to check for collisions with objects in the same cell(s).
I'd actually be capable of doing this myself, but I'm not sure how I should go about storing the information. If I have a ds_list for each cell that would work perfectly, but it might take up more memory. If I use a ds_grid then it would be easier to handle, but adding new object ID's to it would be much more difficult.
Here's an example of what I'm going for:
https://conkerjo.wordpress.com/2009/06/13/spatial-hashing-implementation-for-fast-2d-collisions/