Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Collision Question

Author
Message
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 20th May 2009 17:38
Hi all

a quick question: what would be faster?
if i have 20 objects who all need collision checks, would it be faster to first calculate the distance to that object and if its less than X, check for collision?

thx

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
the destroyer
15
Years of Service
User Offline
Joined: 24th Dec 2008
Location:
Posted: 20th May 2009 18:16
I think it is better to use sparky's collision dll, it's free and you can assign every object to one group then check for collision just to that group
I'ts really good
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 20th May 2009 21:57
i know, i already use it but should i use the method i used above, or just use the groups? cause i don;t know how much cpu it costs to claculate distance

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th May 2009 22:18
Considering you would be using compiled DBPro code to check for distance, I would stick with Sparky's. It will likely be much faster.

bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 21st May 2009 00:11
and porbably much easier. thx for all the help

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
Deego
16
Years of Service
User Offline
Joined: 21st May 2008
Location:
Posted: 23rd May 2009 08:50 Edited at: 23rd May 2009 08:53
This is what I like to do for collision. Depending on how expansive your game world is, it might not be feasible, but I usually do smaller games where this works fine.

Load and create objects that you want to test for collision like this:



I'm not sure of the speed of it but it's easy to code. You can easily pick out enemies (object position x(BadGuyA(3)), and when the second parameter of object collision is 0 it returns the object number the first parameter collides with. Very useful.

Login to post a reply

Server time is: 2024-11-24 06:43:31
Your offset time is: 2024-11-24 06:43:31