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.

Program Announcements / DBP/DBC Collision DLL - FREE

Author
Message
Darkbasic MADPSP
18
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 24th Oct 2005 23:34
Hi sparky i have a problem withit the program i have set object terrain on runs and then just closes all tho it has a loop in the dbpro program

dbpro 5.9beta 3

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Oct 2005 23:58
If it's closing before it shows the terrain, check you have a memblock command somewhere.

If it closes randomly, can you post some code so I can take a look.

Cheers
Darkbasic MADPSP
18
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 25th Oct 2005 00:13


That's the code for it any idea from that why it would be i've never used memblocks before either can you help with that?

Kohaku
19
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 25th Oct 2005 00:15
Just stick delete memblock 1 at the bottom of your code.


You are not alone.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Oct 2005 00:25
The collision DLL needs the memblock commands from dbpro, if there are no memblock commands in your code dbpro thinks you're not using any and removes the memblock commands from your exe. Without them the collision DLL crashes.

As Pai Mei says, just stick a delete memblock 1 (or any other memblock command) after the loop and it should work.
David iz cool
18
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 25th Oct 2005 05:15
hi,i want to use this but i wanted to ask a few questions about it 1st.

1 is there a readme explaining everything about how to use it in dbp?

2 how do u install it into dbp?

3 how is it used in dbp?

4 are there new commands to go with it?

thanks!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Oct 2005 15:37
1 - A readme is included in the zip file explaining what you need to do, as well as a commands file listing all the commands available and what they do

2 - The only necessary step is to put the dll into the
"DarkBasic Professional\Compiler\plugins-user\" folder
the readme also details how to add help files and syntax highlighting if you want these as well.

3 - Once the dll is in the right folder you just call the dll commands as if they were normal darkbasic commands

for example:



would then compile successfully

4 - The dll provides commands to setup your objects for collision, check rays against them and retrieve the information about any collisions.
headcrab 53
18
Years of Service
User Offline
Joined: 14th Jul 2005
Location:
Posted: 3rd Nov 2005 21:43 Edited at: 3rd Nov 2005 21:47
Excellent. I get about 900 - 1200 fps on the examples.

Windows XP Service Pack 2 -- Pentium 4 HT 3.0 ghz
1 GB DUAL DDR RAM -- NVIDIA GeForce 6600 GT 128 MB (PCI Express)
Supremacy
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 11th Dec 2005 16:23
i cant dowload your dll, can u upload it somewhere else plz ?

Your signature has been erased by a mod because it's larger than 600x120....
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Dec 2005 22:00
All the links work here, what sort of trouble are you having exactly?
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Jan 2006 16:24
Just started using this DLL, and it's quite nice. Any news on the Object -> Object collision you were working on?

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Jan 2006 23:17
Thanks. The update is in Mike's hands at the moment. It's all finished, just needs integrating.
FoxBlitzz
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location: United States
Posted: 24th Jan 2006 04:47
I don't know if this has been asked before, but I'm having problems with my collision spheres. I mean, when my hovercraft hits a wall it bounces just fine and all, but the problem is that the collision sphere is tiny, meaning that the craft moves almost halfway through the wall before the collision is accounted for. I suppose I could make a temporary sphere object and make a collision sphere off of that, but... any way to change the size of the collision sphere other than that?

AMD Athlon 64 X2 4200+
1GB DDR-SDRAM (May increase to 2GB one day)
512MB ATI Radeon X1800 Series - Finally! A card that does pixel shaders correctly!
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 24th Jan 2006 05:21
how are you using sparky's to make your "collision sphere"? are you using the tried and true kensupen method? i would need more info to help you out.

"Genius is 1% inspiration and 99% perspiration"
FoxBlitzz
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location: United States
Posted: 24th Jan 2006 22:21 Edited at: 25th Jan 2006 03:35
Here's the basic code for the collision so far:



Edit: You know, I just realized that this dll isn't good for object to object collision. I'll have to rework my code then.

AMD Athlon 64 X2 4200+
1GB DDR-SDRAM (May increase to 2GB one day)
512MB ATI Radeon X1800 Series - Finally! A card that does pixel shaders correctly!
Relativity
18
Years of Service
User Offline
Joined: 29th Mar 2005
Location: Position is relative.
Posted: 25th Jan 2006 20:09
Hey Sparky, I think I found a bug. I wrote a little program in DBC in which the user picks an object (using your intersectObjectDBC() function) and moves it around. I have a cube on the screen which uses box collision and two other objects which use other types of collisions. The problem occurs when I click on an object with any collision system but box with an object with box collision directly behind it. The first object is completely bypassed and the box collision object is selected instead.

Just thought I'd let you know.

The force will be with you. Always.
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 25th Jan 2006 20:52
@FoxBlitzz

you can use sparky's collision for object to object collision. i've done so quite successfully for my project. your method for doing it is the problem. you would need to do it with 'kensupen's method'. to see what i mean, check out the 'X collision' sticky in the code snippets section.

"Genius is 1% inspiration and 99% perspiration"
headcrab 53
18
Years of Service
User Offline
Joined: 14th Jul 2005
Location:
Posted: 2nd Feb 2006 01:16
I had a thought. Do you think you could add a way to adjust the width of the ray? That would work well with object to object collision. A ray could be cast from the top of an object to the bottom with the same width as the object. That way if anything was touching the object it would hit the ray, instead of having the ray only being in the middle. Sort of like STATIC LINE OF SIGHT(X1, Y1, Z1, X2, Y2, Z2, Width, Accuracy)



"Not again!" - A Grunt
CTF Freak
18
Years of Service
User Offline
Joined: 27th Oct 2005
Location: In your base
Posted: 2nd Feb 2006 16:38 Edited at: 2nd Feb 2006 16:41
I don't think that would work you have to figure out a way to do multipule rays around the outside of your object kind of like this


@sparky is there a way you could make it work on animated objects too?
I don't see how we can use this to calculate bullets if when we animate our objects it messes it all up.

Attachments

Login to view attachments
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 2nd Feb 2006 22:02
bullets go in a straight line. cast a ray across that line

formerly xMik
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Feb 2006 00:03
Sphere casting might suit what you are trying to do, as soon as dbpro gets another upgrade this should be available.

Quote: "is there a way you could make it work on animated objects too?"


Currently no, it only takes a snapshot of your object when you set it up. But I'll bear it in mind if I do anymore work on it.

CTF Freak
18
Years of Service
User Offline
Joined: 27th Oct 2005
Location: In your base
Posted: 3rd Feb 2006 03:50
So is there anything I can use on animated objects that is as acurate as your dll?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Feb 2006 21:51
The DBPro Instersect Object command might work on animated objects, but I don't know of any others that do.

Mattman
20
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 4th Feb 2006 19:23
Is there a way to see which limb I am hitting?

Why make sense when you could make brownies?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 6th Feb 2006 16:32
No, the whole object is counted as a single mesh.

Darth Vader
18
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 9th Feb 2006 08:22
Does this do Matrix collision?

You Don't know the power of the Dark Side!!
Oh but I do!!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Feb 2006 12:45
No, objects only

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 9th Feb 2006 12:55
Use this to make the matrix an object (or place a hidden matrix object for testing) for use with the dll.

http://forum.thegamecreators.com/?m=forum_view&t=58829&b=6

Darth Vader
18
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 28th Feb 2006 10:18
Ahh does this replace the inbuilt DarkBASIC Pro collision?

You Don't know the power of the Dark Side!!
Oh but I do!!
Oddmind
19
Years of Service
User Offline
Joined: 20th Jun 2004
Location: Atlanta, Georgia
Posted: 7th Mar 2006 00:31
Is there someway i can have a colision sphere thats hidden surround my animated object and have the animated object positioned always at the spheres position?

like ( ) theres my character inside the hidden sphere, hes animated.

formerly KrazyJimmy
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 7th Mar 2006 11:38
Quote: "Ahh does this replace the inbuilt DarkBASIC Pro collision?"


Only the Intersect Object command

Quote: "Is there someway i can have a colision sphere thats hidden surround my animated object and have the animated object positioned always at the spheres position?"


Yes, you can do something like this



as long as some object exists at that number the dll doesn't mind what it is. updateObject will still correctly update the position and rotation.

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 7th Mar 2006 12:57
Interesting, Sparky, I didn't know you could do that! This makes one of my projects 3x easier and faster...

formerly xMik
Baggers
19
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 8th Mar 2006 14:05
hehe yeah its a great trick !
I found it as result of a lucky guess a while back and has proved invaluable.

Cash Curtis II
18
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 8th Mar 2006 15:16
Hey, that is cool. BTW Sparky, I love your DLL. I like it better than NGC, which I'm sad to have paid for. It's faster, and I can control the collision for each axis perfectly. I've never had a problem with gravity, friction, or walking up steps.

ALEdotX
18
Years of Service
User Offline
Joined: 7th Mar 2006
Location:
Posted: 9th Mar 2006 20:14
Hi Lost in Thought, Sparky, XMilk and any other geniuses that can help. I was wondering if the collision code that XMilk created could work on the advanced terrain? Here is the code with the AT code included but the camera just falls straight through it. What am I doing wrong? Or is it not possible to implement the dll for this?
Oddmind
19
Years of Service
User Offline
Joined: 20th Jun 2004
Location: Atlanta, Georgia
Posted: 10th Mar 2006 03:08
I said something useful! haha right on sparkalicious. Im going to try this out in a bit. I think ellipsoids might be better with human models tho . I hope the collision range isnt too wide, is there another way to do it to shape the collision sphere more shaped elongated?

formerly KrazyJimmy
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Mar 2006 23:42
Quote: "is there another way to do it to shape the collision sphere more shaped elongated?"


Only by using a form of polygon collision, something like this:



If that doesn't do it then this should



nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 11th Mar 2006 09:19
Quote: "I like it better than NGC, which I'm sad to have paid for."


I'm sorry you feel that way. Hopefully you'll feel differently with our current and future releases.

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Lightwave Scene Exporter to .X also at: http://www.nuclearglory.com
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Mar 2006 10:48
I have been using both this dll for ray casting and NGC for sliding. I'll test the speeds between v4.01 and Sparky's dll as soon as I get a chance and let yall know. Sparky's was 10x faster or more than NGC v2.03. I think v4.01 will be a whole lot faster than 2.03 with the static meshs in. It should be a better comparison to Sparky's now. I'll post all 3 tests (Sparky's, NGC 2.03, and NGC 4.01).

nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 11th Mar 2006 10:57
Don't forget our octree support. Yes, it should be very fast now. I will outperform Sparky yet

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Lightwave Scene Exporter to .X also at: http://www.nuclearglory.com
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Mar 2006 13:05 Edited at: 11th Mar 2006 13:07
It's gonna be an interesting test. I am going to have to find a higher resolution timer for testing sparky's.

Using DBP's built in timer function and taking a time sample of 5000 checks and dividing by 5000 on a 130050 poly terrain (casting a ray from corner to corner diagonaly):

NGC v2.03 is 50ms per check
SParky is 0.09MS per check
NGC v4.01 is untested yet ( I am sleepy )

I will modify the code tonight to make sure the camera is in the exact same location, pointing in the exact same direction, with the code as close to each other as possible, and then repost all 3 reulsts (with code and media).

nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 11th Mar 2006 13:12
LOL, I believe it. My v2.03 code is WAY unoptomized (although I didn't think that at the time).

Good man btw! Those people who setup half-arsed tests and get dodgy results drive me crazy.

If it doesn't quite reach Sparky's speed I want one more shot (I'm calling it now). Cause I can see, looking at my code, another optimization I can put into place for the static meshes.

Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 12th Mar 2006 05:17
You should be able to specify the thickness of the raycasting line. It will make it easier to not squeeze through tiny gaps.

nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 12th Mar 2006 05:59
Rays don't have thickness. That would be cylinder testing, lol.

Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 12th Mar 2006 06:42
It would still be nice.

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Mar 2006 21:39
Quote: "I will modify the code tonight to make sure the camera is in the exact same location, pointing in the exact same direction, with the code as close to each other as possible, and then repost all 3 reulsts (with code and media)."


Will be an interesting test, I look forward to the results

I suspect it will come down to the octree structure (mine's a binary tree) and/or our point in poly methods.

Either way, the users are the real winners

nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 12th Mar 2006 22:06 Edited at: 12th Mar 2006 22:27
Agreed. It's more about how useful our stuff is to everyone else.

A binary tree never came to mind all these years. That might be something I check into.

edit:
LOL! That's so simple it's stupid. No wonder your plugin flies.

You know, I could use the same thing to crank up the speed of not only my raycasting but also my ellipsoid testing. My point-in-poly testing is pretty fast (there is one spot I might be able to move it up a notch).

Octrees are also pretty fast but have a bad habit of having the reverse effect when you're doing really long raycasts or ellipsoid movement (because you cross a lot of the nodes at once and this starts reversing the speed you'd otherwise be gaining).

WELL... With all the other optimizations I've put in, if I stick binary-tree handling in there too maybe I can hold a card up too eh?

Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Mar 2006 04:42 Edited at: 16th Mar 2006 00:30
Took a 5 point test on a large terrain and averaged witha ray 3000 units long.

NGC v2.03 is appx 35ms per check

SParky is appx 1MS per check

NGC v4.01 is appx 14.5ms per check as octrees are bugged (26ms with them) you have to turn them off. Once fixed it should drop it down more.

[edit2] In the new version Matthew sent me, NGCv4.01 is now 2.3ms with no octree support. Once it is in I would think that would drop dramatically.

nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 13th Mar 2006 07:21
I just shot a test version to Lost in Thought. It should bring our ms down some more. There is one more speed optimization I have to put in to see if we can get it to go faster on top of that ( I know it's possible )

Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Pulsar Coder
20
Years of Service
User Offline
Joined: 3rd Jan 2004
Location:
Posted: 13th Mar 2006 20:20 Edited at: 13th Mar 2006 20:41
Quote: "mine's a binary tree"


So, with that kind of tree you avoid to find neighbours, right? Sort of BSP ...

Login to post a reply

Server time is: 2024-03-28 23:15:54
Your offset time is: 2024-03-28 23:15:54