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.

Author
Message
gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 31st Oct 2002 21:14
Does anyone have any simple collision examples for DBPro?

gbuilder.
Life is a game.
AMD900mhz,256mb Ram,64mb Shared SiS Video.
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 31st Oct 2002 22:57
um, your gonna have to be more specific, what type of collision are you after?
DB's built in collision?
Mathematical Collision on boxes?
etc

Alex Wanuch
aka rapscaLLion
Get the DB Weekly Newsletter at www.dbwn.cjb.net
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Oct 2002 23:15
There is a simple collision example that comes with DB Pro. Go to "help", "examples", then "collision functionality" and have a look at the example code.

Mike
gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 1st Nov 2002 02:19
Ok, well maybe I'm thick but Mike that "collision functionality" example is anything but simple. In my opinion the examples need to be separate. Sorting through that is bloody nightmare...Each type of collision needs it's own example. It's OK for you guys, you wrote the program but we have to pull it all apart and apply it. You could make the language so much easier to learn with simple, specific examples.

rapscaLLion, here's half the problem that people are facing with DBPro.. There is no real dialog to explain which type of collision or any Command would be best in a particular situation. Having a list of wonderful commands is useless unless there is sufficient explanation about their uses.

In my case I have made a single room house with doors and windows and need to be able to move through the door and but not through the walls. I've tried mucking around with Camera Collision but cannot get it to work. At this stage I'm not wanting to use BSP.

gbuilder

Life is a game.
AMD900mhz,256mb Ram,64mb Shared SiS Video.
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 1st Nov 2002 11:18
I posted a bug complaint with a simple collision detection routine here:-

http://www.darkbasicpro.com/apollo/view.php?t=1284&b=1

it might help.
gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 1st Nov 2002 20:58
Thanks Ratty Rat,
I noticed that you are not moving an object but expanding it in size. Still, I'll adapt your code and see if I can get collision to work with it.

gbuilder

Life is a game.
AMD900mhz,256mb Ram,64mb Shared SiS Video.
gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 2nd Nov 2002 00:11
Well I've been playing around with 'Automatic Camera Collision'. The camera will stop at an object but gets stuck to it. Here is my code, can anyone see why I am unable to bounce off the object and continue moving around.



gbuilder.

Life is a game.
AMD900mhz,256mb Ram,64mb Shared SiS Video.
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 4th Nov 2002 15:03
Sorry, it does not happen for me when I run this code.

In the patch 2 fix list it says 'AUTOMATIC CAMERA COLLISION no longer sticks on some shapes ', have you installed patch 2?
gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 4th Nov 2002 22:20
Hi Rat thanks for trying that. Well, I had installed patch 2 but it hadn't updated properly, so I did it again and went into The DBPro folder to update it.

Now, when I run the above code the camera comes to a halt at the cube, then goes through it. I don't think it's meant to be like that.

gbuilder.

Life is a game.
AMD900mhz,256mb Ram,64mb Shared SiS Video.
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 5th Nov 2002 15:11
Thats what it does for me too, having never used automatic camera collision I assume thats what its supposed to do.

Looking at it the camera stops until the position value once again places it outside the object, at which point it jumps to that position, which makes sense.

What did you want it to do?
gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 5th Nov 2002 16:59
I've worked it out, the mouselook\mousemove code is the problem. When I replace it with 'control camera using arrow keys' it works as normal collision, try the following code. It's not sliding collision but at least it works.



I think it is a possible bug (mouselook\mousemove code should work with automatic camera collision) and I have emailed Lee about it.
BTW. what sort of collision do you normally use Rat, do you have a snippet?

gbuilder.

Life is a game.
AMD900mhz,256mb Ram,64mb Shared SiS Video.
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 5th Nov 2002 19:22
Yes, that works nicely.
I`m still not convinced its a bug (the original code), in that one you were telling the camera where to be, if the system detected that the new position was in collision with an object it would leave it where it was. But your position numbers would still be at the new position, so when the position you set the camera to was again outside the object the camera correctly moved to that position.

In the new code I suspect that the system simply resets the camera position to the last point before it collided, so it never gets set to a point on the other side of the object.

Sorry I don`t have a code snippet that can be easily untangled from the rest of the game its in. I can tell you that in DB (which had no automatic camera collision) I used to use static collision to set up areas where the camera should not be, you don`t even need an object to detect a collision with a static area, just use the command 'get static collision hit(,,,,,,,,,,,)' on any rectangular area (IE the surrounding area of the camera).

Here is a code snippet (OK I lied.... actually, I just went off and did this), its basically your original code with static collision used instead of automatic camera collision. I preferred your original code as it tracked a point (like a 3rd person game) I added a sphere to act as the player (it does not collide, but it could) and I smoothed the camera motion, as it looks more professional.

Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 5th Nov 2002 19:25
ARSE!

Sorry missed out a big chunk of that code, here it is again (complete this time!)

gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 7th Nov 2002 08:41
Ok, that works but I think the sphere is a little too far advanced from the camera. It takes a while for the command to kick in when you back off from the cube. I'll play around with it.

gbuilder.

Life is a game.
AMD900mhz,256mb Ram,64mb Shared SiS Video.

Login to post a reply

Server time is: 2024-04-20 15:35:47
Your offset time is: 2024-04-20 15:35:47