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 / Collision detection problems please help!

Author
Message
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 29th Jul 2005 16:04
I am Making an Fps and I have a building in my world but have no idea on how to set up a collision between the camera and the building.
If anyone has any suggestions it would be great.

Our aim is to keep the loo's clean, your aim can help.

Attachments

Login to view attachments
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 29th Jul 2005 17:47
Try using :

Sparky's collision DLL - FREE! On this site: keyword - sparky

Nuclear Glory's Collision DLL - moderately priced - sold on tgc

I'd recommend sparky's dll, as i've used it and am using it right now for a game.

Cheers,

Metrion

If practice makes perfect and nobody is perfect, then why practice?
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 29th Jul 2005 17:49
Good luck

If practice makes perfect and nobody is perfect, then why practice?
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 29th Jul 2005 18:21
Metrion
where do I type the keyword?

Our aim is to keep the loo's clean, your aim can help.
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 29th Jul 2005 21:11 Edited at: 29th Jul 2005 21:12
Um, never mind. The keyword doesn't work ehehehe. Try this link though.

http://developer.thegamecreators.com/?m=codebase_view&i=d71183f50e9a2d3d7dcec986ff7dbd76

It should even enable you to climb stairs (not ladders). And the zip file should help as well

EDIT:

I found it in the CodeBase and was using that example for my FPS...

If practice makes perfect and nobody is perfect, then why practice?

Attachments

Login to view attachments
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 29th Jul 2005 21:34
I gave it a try but I dont understand it, do you know how to do it in code. I just want the camera to stop when it hits an object.

Our aim is to keep the loo's clean, your aim can help.
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 29th Jul 2005 22:10 Edited at: 29th Jul 2005 22:20
Well, it's pretty simple. All you have to do is put the DLL in the same folder as the project file. Then include the file 'DBCcollisions.dba' in the top of your project. Then, use the 'setupObjectDBC' command to set collision to that object, in this case, your level. You can also use the 'setupComplexObjectDBC', which runs a bit faster but unnoticeably inaccurate. Use the 'setupComplexObjectDBC' for objects with over 40 polygons. So, it would be like this:



Then, to see what happens if something collides with your level, use the 'intersectObjectDBC' command.

In your case, do this:



P.S. the PLAYERSPEED command is how fast the player is moving

Place the first piece of code before the main loop and the second in the main loop. So the FINAL PIECE OF CODE should look like this:



Hope I helped
Btw, you can create bullet holes similarly by using the 'getStaticCollisionX','getStaticCollisionY', and 'getStaticCollisionZ' commands. Like this:



If practice makes perfect and nobody is perfect, then why practice?
r333
19
Years of Service
User Offline
Joined: 18th Jul 2005
Location:
Posted: 1st Aug 2005 23:08
Hey, I've got a solution that's a little simpler...


Hope that helped you a little!

Thanks!(for..whatever it is you did...)
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 2nd Aug 2005 04:48
Do I have to post this again? Here's some code from my Tank Game, Slayer: Battle Tanks 2:


Under that, keep in mind, that the code is using object 1 and 2, which are changeable.


---------------
Vote for Excelsis on the Puzzle Game Compo

__________________________________________
<<<<<Check out my sites>>>>>
www.rhettgames.tk | www.slayerbattletanks.tk
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 10th Aug 2005 20:06
Right where do I start
The commands for the dll do not seem to work in my program so I'll scrap that idea.

Master programmer is your program in DBC and is it a first person shooter??
same question to you r333

Thanks for your time.

Our aim is to keep the loo's clean, your aim can help.
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 10th Aug 2005 23:26


gives a simple sticky collison, if you want sliding collision then you need to position some small plains around your location (hidden) and then when one of them or more hits an obstruction then you move to the nearest one from the centerline of your line of travel thats NOT in collision, this makes you slide along obstructions, thats more difficult to do though and I don`t have time to do that right now, I will check this post tommorow and if you want further elaboration then I will run up an example.

Hop a long
21
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 11th Aug 2005 02:32
If I use a building that is a single x file, I put hidden box primitives inside for sliding collision. I do a series of checks using the DBC collision command. You can visit my site for a better look. Click below. Follow the link to Shuttle Dock.
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 11th Aug 2005 06:02
@Hop a long:

Nicee

If practice makes perfect and nobody is perfect, then why practice?
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 11th Aug 2005 06:25 Edited at: 11th Aug 2005 06:29
@Bigman,
No mine is for an object (usually 3rd person) colliding with another. To change it so the camera doesn't collide, you probably need to find the xyz position value of building. Sp, the code should look something like this


Or some code like that. It is pretty tricky, but, the key (as so I believe) is to find the xyz of the objects your don't want to collide with. Which, proves challenging. The part in my code that has the buildz#-20 thing, you probably need to change that accordingly, as well as add in the x values as well. Doing so should create an air wall around where ever you choose.....a building, a mountain face......whatever you choose.

And, the buildz# code, will only work if that value is the z position value of the building. Which, can be found using buildz#=object position z(OBJECT NUMBER).

Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 11th Aug 2005 18:42
Thanks master programmer!

Our aim is to keep the loo's clean, your aim can help.

Login to post a reply

Server time is: 2025-05-22 17:25:28
Your offset time is: 2025-05-22 17:25:28