100,000 collision checks
BlitzMax Forums/BlitzMax Programming/100,000 collision checks
| ||
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? |
| ||
You should look at quadtrees. Sorry no time for linkies :) |
| ||
You should definitely look at ways of reducing that 100,000 number. |
| ||
Sorry, but something that requires 100,000 collision checks is not properly designed :) Well certainly for real time anyway. |
| ||
Its ok guys, I decided to partition the screen a little... |
| ||
I can't wait to see this game :) |
| ||
hah, it's probably just 1000 balls floating around a screen right now. |
| ||
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... |
| ||
Rob, I've been wanting to see it since you joined indiegamer, then argued with Dev on the popcap forums :D |
| ||
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. |
| ||
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. |
| ||
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. |
| ||
example code of quadratic equation use ? |
| ||
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. |
| ||
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. |