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 / what is your problem with collision????

Author
Message
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 30th Mar 2004 19:45
I make my routine like this


will that not work???!?!?!
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 30th Mar 2004 20:39
IT IS SO DAMN SLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW!




Dig a pit and poo in it
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 30th Mar 2004 20:48
hmmm, alright, my game is not an action game, so I never noticed, or does it slow the entire game? or just detects the collision slowly?
Drew Cameron
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 5th Apr 2004 12:46 Edited at: 5th Apr 2004 12:47
If you have any kind of serious models etc... then the entire game slows down and becomes sluggish, even with box collision or whatever... use math collision.

Say you had a box that was 20 by 20 then something like this:



That's pseudo code but if you want help then just post. Far better to start using maths now so you don't get dissapointed later.

The guy making The Old Remedy - coming May 2004 : 50% completed! New and improved website on the way...
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Apr 2004 13:24
you guys are not using a distance function or any methods to cull the collision until required so its going to be too many checks per loop and hence slow.


fall down seven times, stand up eight
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 5th Apr 2004 19:54
First of all, make a timer-based loop



This will make an array called "check_distance", when an object comes closer than 500.0 units it will set "check_distance(object)" to "1".

Now, you only need to check collision for objects that are close (check_distance(object)=1)



First, the camera is moved using SIN to calculate the new X position, then it checks for math-collision and when it hits something the camera is placed back on its old position. Then the same happens using COS to calculate the new Z position.
This is useful for sliding collision.

For boxes you can use a position check, but I find this one better

Quote: "
UPDATED

Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb
"
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 5th Apr 2004 21:07
?
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 5th Apr 2004 22:39
Its shows you how math collision should be used. Too many distance checks at the same time will slow your program down.

You should NOT use the build-in collision detection, if you use plenty of distance checks (round objects) and position checks (boxes) you can simulate perfect collision.

Quote: "
UPDATED

Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb
"
bibz1st
22
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 9th Apr 2004 17:25
Could you plz give a simple working bit of code that uses sliding collision against a plain, nothing fancy but easily understandable
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 9th Apr 2004 19:56
You might try looking at our collision system. It will give you excellent results and there's no limit to the speed of an object, so you won't "skip" through walls.

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com

Login to post a reply

Server time is: 2025-05-23 06:48:19
Your offset time is: 2025-05-23 06:48:19