100,000 collision checks

BlitzMax Forums/BlitzMax Programming/100,000 collision checks

Robert Cummings(Posted 2006) [#1]
Hi,

I want to create a multi-tiered bucket collision check thing in blitzmax. Basically, I'd like to create a bucket which has lots of little buckets in that and more buckets in that till I get to the collisions.

Do you think that is a bad way of dividing up the screen / level for collision checking?

Any better ideas?


TartanTangerine (was Indiepath)(Posted 2006) [#2]
You should look at quadtrees.

Sorry no time for linkies :)


ImaginaryHuman(Posted 2006) [#3]
You should definitely look at ways of reducing that 100,000 number.


(tu) ENAY(Posted 2006) [#4]
Sorry, but something that requires 100,000 collision checks is not properly designed :) Well certainly for real time anyway.


Robert Cummings(Posted 2006) [#5]
Its ok guys, I decided to partition the screen a little...


TartanTangerine (was Indiepath)(Posted 2006) [#6]
I can't wait to see this game :)


Grey Alien(Posted 2006) [#7]
hah, it's probably just 1000 balls floating around a screen right now.


Robert Cummings(Posted 2006) [#8]
Hahahah laugh it up, wait n see :)

Its actually 2 games - I put the first on hold while doing this one as it made financial sense...


TartanTangerine (was Indiepath)(Posted 2006) [#9]
Rob, I've been wanting to see it since you joined indiegamer, then argued with Dev on the popcap forums :D


Grey Alien(Posted 2006) [#10]
At least it should have good graphics even if it is just a load of balls. How long I got to wait?

Have you solved all the zillions of technical problems yet then? Nah, oh well :-) me neither... crap, just realised I forgot to eat anything tonight, just been living off trance and code.


IPete2(Posted 2006) [#11]
One Eyed.

I guess the problem is that you have to check collisions in the each object against every single other object, in such a way that doesnt repeat any checks. Are you using frame independent collision checking code?

With so many collisions, you will need to know if a collision happened since the last frame you were able to check them.

I have been reading about such maths checking for circles/ balls recently the maths involves quadratic equations which provide you with collision checking but not the responses. Quadratic equations always provide two possibilities for the answers,when the collision will take place, when it will stop taking place (under the current movement/acceleration etc).

This code can also tell you if in the past, during the present frame or on which frame in the future a collision will occur.


IPete2.


Grey Alien(Posted 2006) [#12]
I used quadtratic equasions for an old DOS based shootem up so the aliens could predict *where* you were going to be based on your movement and fire there, instead of fireing at where you are now, it was cool.


ImaginaryHuman(Posted 2006) [#13]
example code of quadratic equation use
?


IPete2(Posted 2006) [#14]
Angel,

I haven't converted it into BMax yet - I'm using it in Flash, but I was thinking that may be a better way to learn it...

Let me see what I can do.

IPete2.


Grey Alien(Posted 2006) [#15]
Mine's in C++ and on the other computer. I'm looking after the kids right now and am on the laptop. It's not that hard. Google Quadratic bung in your parameters and off you go.