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 Collision DLL v2.05

Author
Message
Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 21st Mar 2006 17:43 Edited at: 1st Sep 2009 17:25
I've had this sitting around for a while now, with the posibility of including it as core commands in DBPro.

But in order to preserve legacy code, and avoid the complexity of adding it in, it's being released as a seperate TPC DLL.

DLL: SC_Collision v2.05 (DBPro version)

DarkGDK: SC_Collision v2.05c (GDK Version)

+ Code Snippet

Edit: Updated the terrain demo for v2: http://sparky152.homestead.com/files/TerrainDemo_v2.zip

Main new features are sphere casting/sliding, and an object collision(a,b) replacement.

Attachments

Login to view attachments
Essence
14
Years of Service
User Offline
Joined: 12th Oct 2002
Location: The Netherlands
Posted: 21st Mar 2006 17:51
Wow
Nice job Sparky

Actually, it would be great if there is a command that gives you the possibility to make everything collidable within a specified object number range.
So i.e. if you have your player which is object 10 and your level which are objects 1000 to 5000, there should be a command like:
do_collision(10,1000,5000) or something like that
Pretty handy, and also to avoid the 'need help with collision' threads.

Lost in Thought
13
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 21st Mar 2006 22:45
Yeah this is a pretty cool system. I've been waiting a while for it to be released. It's probably better off released like this instead of integrated into DBP anyway. Something was bound to get screwed up on integration.

adr
14
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 22nd Mar 2006 10:10
I've only just started using v1 of your collision system and I was impressed with its simplicity.

V1 Is Dead! Long Live V2!

[center]
iv tryed everything!!!!!!!!!! could u please just add The gun and shooting Code thats All!!!!!!!!!
Baggers
13
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 22nd Mar 2006 10:16
Lean, clean and powerful. Nice work again man.

M.I.A is pending
Lost in Thought
13
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 22nd Mar 2006 11:13
I love the ability to update the object's state when I want to, instead of it auto updating all of them. NGC has just provided this functionality as well. I have been using Sparky's v2 for a bit now and love it except it uses sphere casting instead of ellips. You can make a work around for that in most cases though This is a really great system, especially since it is free.

Freddy 007
12
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 22nd Mar 2006 16:56 Edited at: 22nd Mar 2006 16:57
That's really awesome, but I get an error( "Could not understand command" ) at this line(33):

setupTerrainCollision 1,1,2

In the terrain example. Otherwise, this looks really cool. Nice job!

Hawkeye
13
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 22nd Mar 2006 17:14
Quote: "-Improved the speed of raycasting"

Now that's impressive - the old system had an average of 1ms per cast. Can't imagine how fast it is now Sphere casting looks interesting as well...


I am but mad north north-west; when the wind is southerly I know a hawk from a handsaw - Hamlet, Hamlet
Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 22nd Mar 2006 17:22 Edited at: 22nd Mar 2006 17:25
Quote: "but I get an error( "Could not understand command" ) at this line(33)"


My mistake, uploaded the wrong terrain demo version. Clear your browser cache and it should work now. The only real difference in the new terrain demo is the commands are now prefixed by 'sc_' hence the error!

Thanks for the comments.


Edit:

Quote: "Now that's impressive - the old system had an average of 1ms per cast."


The real speed comes from the binary tree structure, but there are always optimizations to be found in the surrounding code

Hawkeye
13
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 22nd Mar 2006 17:47 Edited at: 22nd Mar 2006 17:47
HOLY COW! Just tried out the demos. This baby is frikkin' impressive... and the sliding collision is suheeeeeet.

Have a pwngiun on the house


I am but mad north north-west; when the wind is southerly I know a hawk from a handsaw - Hamlet, Hamlet
coolgames
11
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 24th Mar 2006 05:39 Edited at: 24th Mar 2006 05:50
When I try to compile I get an error "Subscript must be integer or dword when referencing an array at line 154". This is the Multiple Intersect Demo that I'm doing.

I did put the dll in the plugins-user directory.

Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Mar 2006 12:30
The dll looks like it's been recognised, otherwise you would have got errors about commands higher up.

What version of DBPro are you using?

Hawkeye
13
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 24th Mar 2006 13:39
I should point out that when I start any of the demos, I get a
Quote: ""Command in DLL command-table duplicated (SC_Collision.dll:setDebug)""

message. The proggy still runs fine, but it does spit that out every time...


I am but mad north north-west; when the wind is southerly I know a hawk from a handsaw - Hamlet, Hamlet
Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Mar 2006 13:54
Quote: "Command in DLL command-table duplicated (SC_Collision.dll:setDebug)"


This will happen if you have both the old Collision.dll and the new SC_Collision.dll in the plugins-user folder, although not a problem deleting the old one should remove this message.

MiR
14
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 24th Mar 2006 16:30
At the risk of sounding like an idiot. Is this dll usable with the DGDK?

Need path finding in your games? Have a look at the tutorials on www.telefonica.net/web2/paskyprog/.
Hawkeye
13
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 24th Mar 2006 16:43
How silly of me. I thought I had already removed the old version before installing the new one Got rid of the old one and it works swimmingly.


I am but mad north north-west; when the wind is southerly I know a hawk from a handsaw - Hamlet, Hamlet
Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Mar 2006 17:45
Quote: "Is this dll usable with the DGDK?"


Nope, once the DGDK has VS2005 support I'll see if I can find time to look at this.

coolgames
11
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 24th Mar 2006 18:08
I'm using u6b3. I still have the old collision dll in the plugins directory. Could they be interfering? I wouldn't think so, since the commands names are different.

Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Mar 2006 21:01
I've tested with 5.9 and u6b3, both work fine here.

Quote: "Subscript must be integer or dword when referencing an array at line 154"


That sounds like a compiler issue, the line points to a command not an array. Either it's not recognising that command for some reason or it's reporting the wrong line.

Anyone else having this problem?

Math89
13
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 24th Mar 2006 21:08
You have to delete the old dll from the plugins-user folder.
Benjamin
14
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 24th Mar 2006 23:06 Edited at: 24th Mar 2006 23:07
Quote: " When I try to compile I get an error "Subscript must be integer or dword when referencing an array at line 154". This is the Multiple Intersect Demo that I'm doing."
This would happen if the DLL wasn't in the right place, and it would be giving this error on a line that you try to return a value from a command.

Tempest - P2P UDP Multiplayer Plugin - 70%
Download the free version
Lost in Thought
13
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 25th Mar 2006 01:50 Edited at: 25th Mar 2006 01:54
Quote: "Anyone else having this problem?"
Nope works perfectly here (DBP 5.9).

[edit] All of the demos work here.

coolgames
11
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 25th Mar 2006 03:46
I removed the old dll from the plugins directory. It works now. My only
problem is that my project needs the old one. I will probobly not be able to use this until I finish it.

Lost in Thought
13
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 25th Mar 2006 03:56
Why not? You can use very easily convert it over. The old commands are in the new one with extra parameters. Won't take you 5mins to change over.

Hawkeye
13
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 25th Mar 2006 13:54
Shouldn't this be, like, stickied or something...?


I am but mad north north-west; when the wind is southerly I know a hawk from a handsaw - Hamlet, Hamlet
MiR
14
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 25th Mar 2006 20:02
Quote: "Nope, once the DGDK has VS2005 support I'll see if I can find time to look at this."

Thought not. Ok.
Preemptive thanks for giving it a look later on.

Need path finding in your games? Have a look at the tutorials on www.telefonica.net/web2/paskyprog/.
Freddy 007
12
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 26th Mar 2006 22:48
So, anything about that terrain error?

Just to spare you the trouble of finding my other post:

Quote: "That's really awesome, but I get an error( "Could not understand command" ) at this line(33):

setupTerrainCollision 1,1,2

In the terrain example. Otherwise, this looks really cool. Nice job!"


Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 27th Mar 2006 11:40
Quote: "Just to spare you the trouble of finding my other post"


And I'll spare you the trouble of finding mine

Quote: "My mistake, uploaded the wrong terrain demo version. Clear your browser cache and it should work now."


Darth Vader
12
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 27th Mar 2006 11:46
Do these commands replace the inbuilt DarkBASIC collision commands?
I wasn't sure about this with the first version!

When in Trouble with anything visit here your number one stop for help
Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 27th Mar 2006 11:52
The do not overwrite them, if that is what you mean.

But SC_ObjectCollision() and SC_IntersectObject() do provide similar functionality to their DBPro commands.

Darth Vader
12
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 27th Mar 2006 13:31
lol

I meant are they better then the in-built ones. and easier!

When in Trouble with anything visit here your number one stop for help
Hawkeye
13
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 27th Mar 2006 16:31
The built in commands don't even work properly, at least in u5.9. They're going to be fixed in u6, but no way will they match this baby in speed


I am but mad north north-west; when the wind is southerly I know a hawk from a handsaw - Hamlet, Hamlet
Freddy 007
12
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 27th Mar 2006 17:00 Edited at: 27th Mar 2006 17:03
Sparky, I <EDIT> re-downloaded </EDIT> this the 25th or so. Shouldn't that be the fixed version?

Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 27th Mar 2006 18:43
Yes it should, I've renamed the file (to TerrainDemo_v2.zip) so it should definately work now. I suspect it was being cached somewhere.

Cash Curtis II
12
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 29th Mar 2006 04:47
Why doesn't TGC use your collision DLL to replace their own, Sparky?

Lost in Thought
13
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 29th Mar 2006 07:03
Because they would have to go through the trouble to integrate it. And then it would be too fast.

Besides alot of stuff would get borked on the integration. I'm just glad to finally have it to use publicly

Great Job.

Turoid
13
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 29th Mar 2006 23:32
Perfect sparky!!

Quote: "it would be great if there is a command that gives you the possibility to make everything collidable within a specified object number range"


Yeah that would speed programs too maybe, depending on how the command is coded within the dll.

Maybe you can think about making a function like essence said?


.::Studying game design at the moment::.
Oneka
13
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 30th Mar 2006 00:25 Edited at: 30th Mar 2006 00:30
EDIT: Lol wrong thread, anyway great collision sparky!


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Mar 2006 00:28 Edited at: 30th Mar 2006 00:31
Quote: "Maybe you can think about making a function like essence said?"


It's not something I want to look into, it would be a lot of work to make such a general command especially for a free dll!

But you should now have the speed and commands to implement a collision system specific to your needs.

Cash Curtis II
12
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 30th Mar 2006 10:22 Edited at: 30th Mar 2006 10:24
Quote: "Because they would have to go through the trouble to integrate it. And then it would be too fast.
Besides alot of stuff would get borked on the integration. I'm just glad to finally have it to use publicly "

Sparky has taken care of the integration, though. There would be legacy command concerns, but if Sparky modified his own plug-in for the commands to match, I doubt there would be any problems.

It would have been perfect for v6, as they're modifying the core 3D dll anyway. It would have been solid, fast, and would work. Sparky's done all the work already.

@Essence -
Quote: "do_collision(10,1000,5000) or something like that
Pretty handy, and also to avoid the 'need help with collision' threads. "

Just assign object 1000-5000 to a collision group. Then, run collision against that group. That's exactly what you're looking for, and the good Sparky has taken care of it for us.

Of course, such a function would be really simple do code yourself, if you don't like groups for some reason. It would just iterate between the bounds and perform collision checks. But I promise, groups are great.

Keemo1000
12
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 30th Mar 2006 10:49 Edited at: 30th Mar 2006 11:13
Great work Sparky, But how do you enable sliding collision or static (no change) collision after you use the SC_setupobject ?

Edit: Something similar to NGC's Setcollisionpro()



In DBP - 3D is easier than 2D , 2 player is easier than Single player , Dont you think life rocks .. ?
Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Mar 2006 13:06 Edited at: 30th Mar 2006 13:07
Quote: "It would have been perfect for v6, as they're modifying the core 3D dll anyway."


Currently the dll makes a copy of object data and stores it locally, if it was to be integrated you'd ideally want to use the object data already in the 3D dll.

Making such changes would risk breaking either the 3D code or the collision code, and would not be suitable for U6 since it's mostly bug fixing.

Quote: "But how do you enable sliding collision or static (no change) collision"


You can use SC_GetStaticCollisionX() or SC_GetCollisionSlideX() to position your object for a sticky collision or sliding collision respectively. The dll won't position your objects for you automatically.

Keemo1000
12
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 30th Mar 2006 22:23
OOO... Thanks.



In DBP - 3D is easier than 2D , 2 player is easier than Single player , Dont you think life rocks .. ?
DuduBaiao
11
Years of Service
User Offline
Joined: 31st Jan 2006
Location:
Posted: 31st Mar 2006 16:38
Congratulations Sparky! I'm using your dll and I'm enjoying it a lot.

There is only one thing that I'm missing: ellips slide collision.
My game is a pod racer and it will be nice if I could use ellips collision since my vehicle models are not spherical.

Are there any plans to include this feature on your roadmap?
Turoid
13
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 2nd Apr 2006 14:25
Sparky I have some questions,

I'm thinking of creating some kind of 'car' engine where the player object (car) rotates as the landscape goes up, If you drive up on a hill, that the car rotates in the correct way. I guess it has something to do with this kind of code from your examples:

+ Code Snippet

But using this method,I am unable to change the car's Y angle > which direction the car is going. I have really no idea how i can do this in a diffrent way. Maybe you can help me ?

http://www.darkbasic.nl/
.::Studying game design at the moment::.
DuduBaiao
11
Years of Service
User Offline
Joined: 31st Jan 2006
Location:
Posted: 2nd Apr 2006 19:11
@Turoid

Take a look on the Binary Moon Tutorial: http://developer.thegamecreators.com/?f=t02/bm_tutorial_33

The trick is to use two objects, one for controling the car movement, and other to control the car model angle. In my game I use the first object as the sphere collision too.
Zink
11
Years of Service
User Offline
Joined: 2nd Apr 2006
Location:
Posted: 2nd Apr 2006 20:45
Hi guys!

Am i the only one getting

"Could not define perameter of type of 'terrain 1' at line 23"

when i try to run the terrain demo (version 2)?
Freddy 007
12
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 2nd Apr 2006 22:42
No, I did as Sparky said on the last page, and now the demo works!

Really a great dll Sparky, have a cup of coffee on me :

Xarshi
11
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 3rd Apr 2006 03:53 Edited at: 3rd Apr 2006 03:57
so could you do this(in just basic principle) for shooting?:

+ Code Snippet

and the x stands for the number of body objects. it does not include any other objects like player collision spheres.

all ben needs is his band,his guitar,and his computer...
and his dead little power puff girls...
Paul Johnston
TGC Developer
14
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Apr 2006 13:37 Edited at: 3rd Apr 2006 13:44
Quote: "There is only one thing that I'm missing: ellips slide collision"


I thought about it but even if the ellipse was fixed to the major axis (not allowed to tilt) the scaling that would be involved would require more complicated methods to test against spheres and boxes.

Quote: "Could not define perameter of type of 'terrain 1' at line 23"


That's a problem with your advanced terrain functions. Make sure you have the advanced terrain dll.

Quote: "so could you do this(in just basic principle) for shooting?"


Better yet, you can do it all at once:

+ Code Snippet

bulletcol will hold the number of the object hit first, so in your case if it is less than NumBodies and greater than 0 then it has hit a body. Otherwise it has hit something else you setup (a wall maybe)

Login to post a reply

Server time is: 2017-07-23 23:30:34
Your offset time is: 2017-07-23 23:30:34