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
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 22nd Aug 2004 01:31 Edited at: 22nd Aug 2004 01:32
Here's the new version with multiple collision points.

There are several new commands:

multipleIntersect - to record all the collision points along a ray, ordered by distance.

setMaxCollisions - sets the maximum number of points that can be recorded by the above command, default is 50.

getCollisionDistance() - returns the distance to the collision point.

getObjectHit() - returns the object hit by the collision point.

getRayCount() - returns the number of rays checked by the dll since this command was last called.

getObjectcount() - returns the total number of objects checked since this command was last called.

(see 'commands.txt' for more details)

I've implemented the multipleIntersect just like your example, it will return the number of collisions and you can cycle through them and pass the index to the return commands (static, normal, bounce, etc) to get individual collision points. The points are ordered by distance so index=1 is the closest point.

If the number of collisions returned is equal to the maximum set then there were probably more but it is unknown which points were returned and which were left out.

Please post any comments/bugs/suggestions you may have, or e-mail me (email button below)
eat much pie
19
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 22nd Aug 2004 02:09
Excellent job Sparky! Very cool!

One questoin: does setting the maximum number of collisions to a high number slow down the intersect checks?

Cheers!


[href]Checkpoint Router[/href]: My AI Routing Program
Sam Wright
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 22nd Aug 2004 02:24
Thanks

It shouldn't, setting it higher just increases the size of the array to hold the collision points, what will slow it down is if there are actually a high number of collision points along the ray, regardless of how many of them it can store.

So it should be safe to just set it as high as you think you need and leave it.
eat much pie
19
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 22nd Aug 2004 04:11
Alright, cheers!


[href]Checkpoint Router[/href]: My AI Routing Program
Sam Wright
Hepy
19
Years of Service
User Offline
Joined: 16th Apr 2004
Location: United Kingdom
Posted: 22nd Aug 2004 07:01 Edited at: 22nd Aug 2004 07:03
Hi, thanks for all the gd stuff
hepy

Hepy
Cydvok
19
Years of Service
User Offline
Joined: 22nd Aug 2004
Location:
Posted: 23rd Aug 2004 04:49
When I downloaded the Terrain Demo, I got an error saying the compressed zip folder was corrupt or invalid. Any help?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Aug 2004 05:32
Try downloading it again, sometimes downloads can get corrupted. The file itself appears to be fine.
eat much pie
19
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 5th Sep 2004 20:55 Edited at: 5th Sep 2004 20:55
Hey Sparky, if you're looking for another idea for your plugin, I think I may just have one:

Would it be possible to add a function that returned the UV coords of the collided face? It'd be very useful for things like colouring dust from tires when driving. And maybe the image index number of the texture that was used on that face, eg:

the beginning of an x file:



So another function would maybe return the phrase "mat_1" or just "1", whichever's easiest.

Cheers!


[href]Checkpoint Router[/href]: My AI Routing Program
Sam Wright
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 6th Sep 2004 12:42
It's certainly a possibilty, but there are a few things I would have to work out.

Firstly I would have to store the uv co-ordinates for the faces, something I don't do at the moment, which can be complicated by multiple textures and/or objects with a different fvf. I know that terrains have two sets of uv coords, one for the detail map and one for the texture map, but their fvf comes out at 578 which suggests only one texture... (a possible bug?) I haven't looked at how it works with .x objects yet.

Secondly once I have a collision point I can get the uv coords of the 3 vertices in the face, but then I'd need some way of interpolating them to get the uv coords of the point, something I'm not familiar with. I'll have to find some infomation on it.

I'm currently working on another project so I've neglected this for a bit. If I have time I might be able to get some of these things sorted and implement it, but at the moment it's still an 'if'.
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 6th Sep 2004 12:53
Sparky, I just downloaded your dll. Looks nice . I've got a question though, is there any way I can use this for collision inside a level? I'm a bit new to collision stuff, but if I built my map in like Cartography Shop or something and exported to .x (and it has an interior), could I use ur dll to do collision inside? Also if its possible, would you mind posting smoe example suorce code? Thanks, and great dll again!!!

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 7th Sep 2004 01:43
If you're talking about player/level sliding collision then no it's not particularly suited to that, it's designed mainly for bullet style or ray tracing collisions.
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 7th Sep 2004 05:42
Lol yeah I was playing with it and realized that... . Thanks anyway!

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
Kohaku
19
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 7th Sep 2004 10:43
Quote: "If you're talking about player/level sliding collision then no it's not particularly suited to that"


I beg to differ.

Infra-Dark
Bring the 20 liners back!
#coding, like coding, but with a #
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 8th Sep 2004 02:18
Yes, I hear you are working on something that will use ray collisions for sliding

I'm interested to see how well it turns out.
harggood
20
Years of Service
User Offline
Joined: 9th Apr 2003
Location: the forest
Posted: 15th Sep 2004 03:52
I've been playing with sparkycollision, making sliding collision. I haven't got it going up ramps yet. It goes down them. If you press the object up against a wall and spin around several times, sometimes it will slip through the wall Otherwise, for what I'm doing, it works great.

Awfuldark Forest
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 17th Nov 2004 03:36
Hi,

I have DBP 5.7 running on W98SE, and the compiler crashes when I try your demo...

DBPCOMPILER caused an invalid page fault in
module <unknown> at 0000:00000001.
Registers:
EAX=00000000 CS=0167 EIP=00000001 EFLGS=00010246
EBX=0000ffff SS=016f ESP=0069f5d4 EBP=0069f5e0
ECX=00000000 DS=016f ESI=00000001 FS=4e5f
EDX=00000000 ES=016f EDI=00000000 GS=0000
Bytes at CS:EIP:
00 00 00 65 04 70 00 16 00 88 05 65 04 70 00 65
Stack dump:
67f14657 00000003 00000001 0069f600 67f14712 00000001 0000ffff 008b635c 008b635c 67f1c370 67f1c370 0069f610 67f14867 008b63d0 819a0e0c 0069f620

Any ideas?

Thanks
IanG
19
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 17th Nov 2004 05:52
buy xp

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
Zero Blitzt
20
Years of Service
User Offline
Joined: 18th Jan 2004
Location: Different Stages
Posted: 17th Nov 2004 07:35
Quote: " buy xp"


Yeah, like thats a mature answer. Nice contribution, dipsnap.


"And C++ has 2 version Microsoft visual C++ and Bordland C++."
Philip
20
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 17th Nov 2004 20:06
Lampton, are you running in debug mode? I get the same crash when I try compiling in debug or single step mode. Its because both modes were broken in v5.6.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 17th Nov 2004 22:13
Wow. This dll is very fast. I only lose 1 fps. Using NGC I lose half my fps if I call the ray cast every loop. Great job!

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Nov 2004 05:42
I don't have any windows 98 computers to test on, so unfortunately I can't help you out there. It still seems to work here with version 5.7 and XP.

Thanks for the comment, I was actually considering changing the dll to be called RayCast DLL, since that's really what it is... collision is perhaps too general.

Maybe when I get some time during christmas holidays I can release the next (and possibly the last) version which will include returning individual polygons that are hit, it's pretty much the last thing I had planned for it.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 28th Nov 2004 16:41
How are you getting the terrain information into your dll? I am using this method for NGC.
http://forum.thegamecreators.com/?m=forum_view&t=42114&b=6

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Nov 2004 02:44
You seem to use roughly the same method that I do, I get the number of limbs and cycle through each one making an object out of them, except I don't bother making them exactly 21000, or so, polys.

I wrote a special function in my dll that would collect all the vertex information from all the objects and then pass it all at once to the collision routines. Therefore avoiding the error in the DBP mesh commands but still allowing me to deal with large models as a whole object.

Also a better way to get the number of limbs is to use 'Perform Checklist For Object Limbs <terrain Obj>' and 'limbs = Checklist Quantity()'
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 29th Nov 2004 05:37
Ah cool. I thought there was a command for that but didn't see it lol. Thanks.

Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 21st Dec 2004 17:48
Hello Sparky,
I've got a little question : do your DLL take it in account the animated models ?

(nice work for your dll )
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 30th Dec 2004 19:39
Quote: "Hello Sparky,
I've got a little question : do your DLL take it in account the animated models ? "


I don't believe it does at the moment, but it sure would be good if it did (hint hint ).

Isn't it? Wasn't it? Marvellous!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 31st Dec 2004 08:33
Hamish is quite right, at the moment it only takes a copy of your object when you call the setup and there isn't an easy way around this.

But I hear upgrade 5.8 adds direct vertex access! If this is true then it opens a few more options and I think it's definately possible.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 31st Dec 2004 11:27
nice, and just to let you know my compo entry silent strike(3rd) used sparkys collision for collision detection on the terrain as intersect object was far to slow for doing those calculations on a 40k poly map .

id love to see it working on animated object but it may screw with peoples collision code a bit :p ie: elevators moving up n down may make the player fly through them, maybe you could add support for fps style player collision, just a though :p.

anyways glad to know your still working on it.


Dom
19
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 13th Jan 2005 03:59
Ive just downloaded the DBPro version. Ive put all the files in the right places but when I try to compile one of the examples in DBPro or BLUE IDE it comes up with an DB Compiler has performed an illegal error! Then when I hit run It flashes up and then goes back to the editor! Whats wrong?


Thanks to Animeblood for the Logo!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Jan 2005 04:25 Edited at: 13th Jan 2005 04:27
Are you running windows 98 by any chance? I heard a few people had this problem, but I have no win98 machine to test on so I can't try it out.

If not then more specifics about your DBPro version and which commands casue the error may help.
Dom
19
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 14th Jan 2005 00:51
Yes I am using win 98 SE (second edition) Ive downloaded all the latest patches and IDE Upgrades.


Thanks to Animeblood for the Logo!
White Devil
19
Years of Service
User Offline
Joined: 21st May 2004
Location: Just where ur imagination cant go
Posted: 18th Jan 2005 05:26
Hi sparky, i'm kind of newbie in DBPro and i saw your dll, and i love it hehe, can i use it in a project please?? (of course i'll give you the whole credits and i'll email you for sending you the finished game ) and if i can, can you please tell me how can i include it without copying it to the plugins-users folders? (so if somebody without darkbasic download my game the collision and the dll can work) any suggestion please??

(btw, if you have msn and if you want can you please add me? so we can talk a little better because i have dial up conection and this forum takes a little while loading hehe) my msn is Javisperez@hotmail.com..

Thanks

"I'm you, you're me, he's she.. oh god"
P4 2.26 Ghz, 256 kb Cache, 512 DDR PC2100, 80 Gb HD, ASROCK MoBo, Asus GeFORCE FX5200 v9520 128 mb, WinXP Pro services pack 2
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 18th Jan 2005 06:25
Sure, you can use it in a project, and the dll is included in the exe by default so other people should be able to run it fine.

I've added you to my msn, but I don't use it much.
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 15th Apr 2005 01:50
Hi,

Where can I download the latest version? I thought you might have a web site Sparky

Cheers in advance.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Apr 2005 02:52
On page 1 of this thread

Lover of games
18
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 15th May 2005 05:53
it doesn't work. The dLL doesn't work for me, in DBC it says it can't be used because i don't have the full version of the prog and in pro it just crashes. Sorry, but I also made a post to another section consering this topic. if it's the same thing. I apoligise

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Xenocythe
18
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 10th Aug 2005 05:18
Bad news. Whenever I click the mouse button it crashes giving me an error report and turning of DBC. Yes, its the DBC version. Sparky, if you can help, I'd love it.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 16th Aug 2005 14:51
@Xenocythe - got you email

Sorry guys I haven't been watching this thread recently, if you have a problem email me and I'll help you as best as I can.
The 1nteger
18
Years of Service
User Offline
Joined: 30th Mar 2005
Location: United Kingdom
Posted: 7th Oct 2005 04:04
Hey all, Thanks for the dll Sparky, am i right in thinking this dll doesn't work for object to object collision checking? (all the examples use a clicking/camera collision check)

Forgive me for my ignorance if i'm wrong

If this isn't the case, could someone show an example (two cubes colliding / character objects or something of the like)

Thx in advance!

Leroy Frederick - Director / Lead Designer - ETERNAL SYNDROME™ ONLINE: www.ETERNALSYNDROME.com ETERNAL SYNDROME™ - “Play Your Emagination!”™
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 16th Oct 2005 18:55
@The 1nteger - You're right, it only handles ray intersections similar to shooting a bullet through your scene.

However, I have been working on methods for checking object collision, and have gotten quite far. But instead of releasing a replacement DLL for commands already in DB Pro, I'm talking to Mike about the possibility of using it to fix the object collision command instead. I think this would be best for users.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 19th Oct 2005 14:13
When they mentioned it, I knew it was you who was working on it Could you also see if they will replace the intersect object command with yours

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 19th Oct 2005 18:18
lol, I like to help where I can

I sent Mike source code that included my intersect object command as well, he said he would try to add everything so I guess it's down to if he has time to include it all before release.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 19th Oct 2005 22:39
Awesome, if not in 5.9 then it will probably be in U6. Either way I am very much looking forward to it.

Maleck
19
Years of Service
User Offline
Joined: 12th May 2004
Location: US
Posted: 19th Oct 2005 23:11
Great work helping us out, Sparky
Turoid
20
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 23rd Oct 2005 12:57 Edited at: 23rd Oct 2005 12:57
Is it possible to create like uuh you have a cube and you control it using the arrowkeys, camera behind it. You want the cube to walk on a .x object, is it possible to create colision for it ? Or is this just a dumb question ? I don't know anything about intersect etc.. that's why im asking

.::Studying game design at the moment::.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Oct 2005 17:26
It is possible to do this with the intersect object command, but it will not result in perfect sliding collision.

Here's a quickexample



The media is attached to this post.

In thirdperson view it is obvious that the sphere tends to cross parts of the level, and you would also be able to fit through very small gaps, created by low ceilings or narrow alleys.

Also you might want to check out some of the sliding collision examples on the code snippets board.

Attachments

Login to view attachments
Turoid
20
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 24th Oct 2005 14:40 Edited at: 24th Oct 2005 14:44
Thanks for your code, I like it

btw.. why you make a third object?

What kind of collision system does the open source community fps use for the basic 'walk' collisions?

.::Studying game design at the moment::.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Oct 2005 15:00
Ignore the third object, I usually make a plain for bullet collisions but I removed that part of the code for this example and missed that bit

I don't know how fpsc does collisions, I haven't looked through the code properly yet.
Kohaku
19
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 24th Oct 2005 15:59 Edited at: 24th Oct 2005 16:00
I think FPSC uses ODE for it's collision detection, but back to Turoids question, I think the open source community fps uses Newton for it's collision detection.

Anyway, Sparky, it's great to hear that you have given your code to Mike for DBP. I remember using your dll for an fps many moons ago, and it was super quick. I really hope they add it.


You are not alone.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Oct 2005 18:56
Sorry, I seem to have mistaken fpsc for the open source fps!

I should start reading other boards.

Login to post a reply

Server time is: 2024-03-29 12:49:59
Your offset time is: 2024-03-29 12:49:59