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.

DarkBASIC Discussion / DBC Collision Question

Author
Message
TheSquid
21
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Ohio
Posted: 17th Feb 2004 22:14
I wrote a test program (and I'll post the code later) to do this. It's simply two cubes, numbered object 1 and object 2. At the top is a display to show what object the cubes are in collision with.

If I don't turn off the global collision, of course this works and the numbers display 1 and 2 when the two cubes are colliding.

If I turn the global collision off and create collision boxes, this does not work at all.

Isn't this supposed to work?

And yes, I know about the Nuclear Glory dll, but I'd much rather have an answer than a commercial - no offense to the Nuclear Glory product.
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 17th Feb 2004 22:29 Edited at: 17th Feb 2004 22:32
Aw shucks <kicks the sand>

No offense taken. The product is not hyped though

It was actually originally designed for DBC because the DBC collision is really mucky. The 1st release was back before the DBP days, lol.

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 18th Feb 2004 02:33
Hi TheSquid,
(sorry for commercials!) I tried doing collision on DBC, and eventually I unplugged the computer, screamed at it for about fifteen minutes, and went to play HALO for a really really long time. Then I downloaded the 2.03 demo for Nuclear Glory's dlls, and the test collision I needed to do was done in seconds after I read through the manual a little bit. As I read deeper into all the commands it made so much sense! I came from Blitz (thus joining the light side of the force ), and preferred their collision in comparison to the kind used in darkbasic....until I tried NG.

But all the other advice I can give you is look for collision examples in the snippets section and codebase, and look very closely at the stuff that comes with DB.

Crazy Donut Productions
Current Project: KillZone
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 18th Feb 2004 02:55
LOL, you'd have been better off not mentioning the collision DLL:p

have you tried the:
SET OBJECT COLLISION ON Object Number
command?

The 3D Modeler's Group : http://groups.yahoo.com/group/3dModeler/
The Unofficial DB Software Group : http://groups.yahoo.com/group/dbsgroup/
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 18th Feb 2004 03:47
either your collision boxes are not properly defined or your collision statements are incorrect etc... post the code so we can take a look

TheSquid
21
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Ohio
Posted: 18th Feb 2004 15:40
I'll post the code tonight, but for the record, none of the sample programs that come with Dark Basic use the SET GLOBAL COLLISION OFF command. Believe me, I looked. I did a search on this forum, but nothing of use turned up.
TheSquid
21
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Ohio
Posted: 19th Feb 2004 04:46
As promised, here is the code. I'm attaching the entire test program here, so you can load it and test it out. It's really simple, arrow keys to move, that's it. The numbers in the corner represent object 1 and object 2, showing the number that they are in collision with.

In a perfect world, the numbers should read 2 1, but instead, they always read 0 0. You get the picture.



Hopefully you guys will have better luck with this than I have.
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 19th Feb 2004 15:55
your right i usually set global collision on, that's why i never came across this problem, interesting... anyone else has any suggestions?

JohnFP
21
Years of Service
User Offline
Joined: 5th Feb 2004
Location: Maryland
Posted: 19th Feb 2004 16:14
I am not sure if it is a problem with DBC or the help statement is incorrect. I found the same thing. Anytime I set Global Collision Off then none of the collisions would work even though the help states that if Global Collision is set Off then individual collisions need to be set up. It makes sense to me that the help information is incorrect as if there is no global collision defined then only individually set collisions work which would seem redundant for having a function act like the default. Thus setting global collision off turns off all collisions, even if individually defined. Anyway that is what I have found.
TheSquid
21
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Ohio
Posted: 20th Feb 2004 01:53
Based on the number of views over the past couple of days, I'm guessing that a lot of people are interested in this topic. Someone has to know for certain whether or not this code is bad, or if there is a flaw in DBC.

If anyone here can answer this for certain, let me (us) know!!!
TheSquid
21
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Ohio
Posted: 24th Feb 2004 20:54
Is this a bug in DBC? Surely some of the very intelligent people on this forum as the answer!!!

It's a shame if it is, as DBC is no longer updated.
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 24th Feb 2004 21:51
And what happens if you use:
SET OBJECT COLLISION ON obj
SET OBJECT COLLISION TO BOXES obj


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
TheSquid
21
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Ohio
Posted: 25th Feb 2004 05:32
tried that, didn't work any differently
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 25th Feb 2004 08:58
That sure is a hum-dinger of a conundrum you've given us there...

After looking at it all... It apears that seting the global collision off overwrites any other collision command after that.

Maybe if you email a nice small example to one of the DarkBASIC team ( ie, Mike or Lee etc ) then I'm sure they can tell you what's up with the code, as it doesn't appear to work as it should. ( or, as we think it should )

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
TheSquid
21
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Ohio
Posted: 25th Feb 2004 16:01
I'll do that now and post the results in this forum.

Thanks for taking the time all!
TheSquid
21
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Ohio
Posted: 25th Feb 2004 21:46
From TGC Support (very prompt response as well!!!)

Quote: "This certainly seems like a bug (according to the help) - your code has the same effect when run under DBPro too.

Until I find out either way, you best bet is to disable object collision individually rather than disable all and enable individual objects. "
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Feb 2004 03:00
Nice...

Good work TheSquid, and good work to the TGC team for such a swift responce.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Guitarman
21
Years of Service
User Offline
Joined: 31st Jan 2004
Location:
Posted: 26th Feb 2004 21:20
I don't know how much this will help but for my collision, i store the collision status of an object as a variable then test what the variable is and then determine what to do if colliding. EX:
Coll#=object collision(1,0)
if coll#>1 then position object 1 old x(1),old y(1),old z(1)

if that isn't good then just check the distance between the objects and then if they're too close position the object at its old x,y, and z spots.

I'm new to this too so this may be completely off topic. Sorry if it is.
TheSquid
21
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Ohio
Posted: 27th Feb 2004 19:09
The code you listed above will not work if you use the SET GLOBAL COLLISION OFF command and turn on collision individually. Knowing this could save you some headaches down the line.

Login to post a reply

Server time is: 2025-05-22 17:16:57
Your offset time is: 2025-05-22 17:16:57