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.

Newcomers DBPro Corner / Simple collision escaping me

Author
Message
Jaleho
20
Years of Service
User Offline
Joined: 15th Jan 2004
Location: Olathe, KS - USA
Posted: 5th Feb 2004 19:04
I can't figure it out - what am I doing wrong? I've read all the tutorials and documentation and I still get nothing. All I want to do is have it tell me if it is colliding and with what. Do I have something in the wrong place? It's got to be something simple that I'm just missing.
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 5th Feb 2004 19:24 Edited at: 5th Feb 2004 19:25
I found some errors, here's an improvement:




Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
Jaleho
20
Years of Service
User Offline
Joined: 15th Jan 2004
Location: Olathe, KS - USA
Posted: 5th Feb 2004 19:38 Edited at: 5th Feb 2004 19:39
Actually, that didn't help at all. It just overlapped my other data and only let me see if I was hitting object 30. I cleaned it up a bit, but I still get 0 and FALSE for everything - it won't register that it's colliding with anything.

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 5th Feb 2004 19:49
When creating collision box you have to do the bottom left corner first, i.e.

make object collision box 1, -50,-50,-50, 50,50,50, 0

Then everything works

Boo!
Jaleho
20
Years of Service
User Offline
Joined: 15th Jan 2004
Location: Olathe, KS - USA
Posted: 5th Feb 2004 21:41
Whew! Thanks! I'm finally getting some true statements! Ok, now that I've got that working, I seem to be finding a dozen different ways to do collision, and none of them are compatable:

set object collision to boxes, make object collision box, set collision on and off, global collision, hit vs collision, if object collision, static objects, and just telling an object if it's x or z is above a number, reset that number.

Any suggestions how I can clear up all this mess and explain what does what and which is the best to use and why one doesn't work with the other? I'm working on a curriculum to teach middleschoolers programming in dbclassic, and I'm working on "collision" now.
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 5th Feb 2004 22:55
There are only a few way of doing collision

-Real Collision with Boxes/Spheres/Polygons
Boxes is the fastest, but inaccurate with round objects (ex: characters)
Spheres is a bit more accurate but slower.
Polygons is the slowest (real slow) but its very accurate.

-Position Check
Very fast, but works for square objects only,
If player x > object x - (object size x / 2)
If player x < object x + (object size x / 2)

etc.

-Distance Check
Very fast, but works for round objects only,
Distance# = sqrt((player x-object x)^2+(player y-object y)^2+(player z-object z)^2)
If Distance# < 10.0 then text 5,5,"Closer than 10 units"


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
BearCDPOLD
20
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 6th Feb 2004 03:23
NGNGNGNGNGNGNGNGNGNGNGNGNGNGNGNGNGNGNG
NuclearGlory has free advertisers..... NuclearGlory's dll makes collision so much easier and accurate. And there is a demo:
http://www.nuclearglory.com

Juvenile Industries
Current Project: KillZone(FPS)
Soon to come:An rts, and a snowball fight game
walaber
20
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 6th Feb 2004 06:08
I'm all for the NG people and their nice DLL, but you really should try and code some of the solutions for yourself. For examply write your own collision system, and THEN switch to the NG DLL if it's better.

try using Emperor Baal's examples for write a simple collision routine. You'll be really proud of yourself when it actually works!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia Ti4200 AGP 8x 128MB

Login to post a reply

Server time is: 2024-09-21 21:06:10
Your offset time is: 2024-09-21 21:06:10