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 / .X Models reacting differently to collision, PLEASE HELP!

Author
Message
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Feb 2005 09:21
When I have my player's object (object 1) set to a simple box made in DBP using the make object box command, my collision code works perfectly and the player stops when they hit dense objects.
However, when I load a model I made in 3DS that's been converted to .X, I am able to move the model around ABOVE my map (the map is a bunch of .x files aswell) but when I go close to my map the user just stops, like there's some huge invisible box around the entire thing disallowing me to move into it. Ill post the collision code incase anyone needs it, thanks in advance to any help provided.

Collision Code:

There is ofcourse other code inbetween the variable code and the if/then code. If you need to see the rest of the code just ask and I'll post it right away. Thanks again!

Causin' RUCCUS whereva' I go.
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 25th Feb 2005 09:32
Yep your right, there is a huge invisable box around your level. This is the way that DBP nativly handles collision...you could set the collision on the level to polygons as this means the collision would behave as you want it to (colliding with walls and such) however this is very slow.

The main way people have been dealing with this is by using plugins to handle their collision:

Newton: An amazing plugin which handles not only the collision but fantastic physics...its a lot of stuff to learn but it seems to be worth it for alot of users (I havnt used it yet, i didnt fancy all the new learning as i didnt need physics that advanced!)

Nuclear Glory: A very popular plugin which specialised in collision between complex objects at great speed, accurate and fast...the only downside is if i remember rightly you have to buy it/

Sparky's Collision Dll: Now this is just a replacment of the DBP intersect object command...but a very powerful one (I am a little biased as i use it for all my collision codes) it allows you cast a ray from one point to another and check if an object is in the way.
The use of this ? imagine you cast a ray down from your charcter, you can find the distance to the floor and thus if he is standing on it...you can cast one infront when you walk to see if there is an object in the way...basically you write the collision routine yourself, what i also like about it is that there are only a few commands to learn.

for further reading have a look here, this is a list of popular plugins for DBP

http://forum.thegamecreators.com/?m=forum_view&t=39033&b=5

Good luck!
TravisP
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location: Behind you, with a knife!
Posted: 25th Feb 2005 09:39
You could also convert the .x into a .bsp using the tool that came with DBP.

Note: The above I didn't say, your just crazy.

Not a ripoff of The Twilight Zone
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Feb 2005 10:05
Thank you a lot, both of you. Ill look up the BSP command aswell.
Oh and sorry for posting in the wrong thread I could have sworn I was in the newcommers corner but I guess I clicked the Code Snippets one instead.

Causin' RUCCUS whereva' I go.
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 25th Feb 2005 19:46
...Nope this is the newcomers corner !
Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 26th Feb 2005 08:17
Quote: "However, when I load a model I made in 3DS that's been converted to .X, I am able to move the model around ABOVE my map "


You should also load the converted model into a 3D modeling program and see if it's centered on (0,0,0) there. The behavior you're describing is exactly what I see if I build something in GameSpace and accidentally leave it say, 5 or 10 units above "ground level" when I save it. It seems that as far as DarkBasic is concerned, the bottom of the object includes that space between the bottom of the object and zero elevation. I get a collision exactly that many units above the ground.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 28th Feb 2005 09:47
I figured that out a while ago but that didnt seem to be the problem. In 3dsmax I've position the object exactly at the 0,0,0 coords. Meh.

Wait, I didnt read that msg right above before...You're saying DB COMES with a built in .BSP converter? How would I convert my map into .bsp then? That would help a hell of a lot.

@blaggers: Oh lol, I thought I posted in code problems. Well no problem there then.

Causin' RUCCUS whereva' I go.

Login to post a reply

Server time is: 2024-09-23 13:19:16
Your offset time is: 2024-09-23 13:19:16