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 / Collision coming up short

Author
Message
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 5th Oct 2007 13:14
Hey everyone,

I'm working on a 3rd-person view type of game, and got a fair few things in place. One thing that I can't get in place is collision. I've read the tutorials, and i'm using code which I know works, so I suspect my problem is something to do with:

a) Collision box for the model, currently I have none in place
or
b) Something's wrong with the model
or
c) My code is inefficient/isn't working properly.

Anyway, the problem is that whenever I collide with the object I specified collision for, the player object collides with thin air, much before it hits the actual object.

The code i'm using is this:



I tested this code using simple cubes as object 10 and 13, and the collision worked perfectly, which makes me suspicious of it being a problem with the model(s) i'm using in the collision.

Here's a screenshot showing the problem in-game, where i'm using the .X models.

Here's the code, but using simple cubes, and it's compilable, so you can see the effect I want. It also proves that the problem isn't with my current code.



And a screen of the cube collision effect for those who can't/don't want to compile:

All help is appreciated, thanks in advance.


pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 5th Oct 2007 13:41
Try to use this.
SHOW OBJECT BOUNDS Object Number
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 5th Oct 2007 14:51
Thanks for the quick reply pcRaider.

Tried the above, and the bounds for the two objects are MASSIVE! That's almost certainly the cause of the problem.

Is there any way to decrease the size of the bounds for each object? A quick search of the manual didn't reveal any obvious commands for doing so.

Screenshot of the object bounds:


pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 5th Oct 2007 18:03
I do not know your hero character.
If a collision definition of a model is so, it will show the range.

If it is me, I look from another thought.
An animation model and a collision model,
Must it be same?
And the cube made a move definitely.
Profit
18
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 6th Oct 2007 02:13
Give Paul Johnston's DLL a shot; it'll save you some headaches in regards to collision detection.

common people are walking in line.

Mitsu Fly Ride.
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 6th Oct 2007 05:57
Yeah, I gave Sparky's DLL a go, played around with it a few days ago, but no luck there either. The problem isn't with the collision detection though, it's the problem with the bounds of the model. I'll take a look at Sparky's help files, and see if there is anything regarding the bounds of an object.


Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 8th Oct 2007 16:44
Alright, i've advanced a fair bit it what i've gotten done on this.

I'm using Sparky's DLL now, and it's detecting the collision fine. What happens is that upon collision, the whole game freezes. It just totally stops. The player can't move, the game music is still playing, but I just have to exit it by pressing <ESC>, because there's nothing to do with it anymore, totally frozen.

This is the code i'm using:


Thanks for all the help again guys, it's appreciated.


Login to post a reply

Server time is: 2024-11-25 12:48:03
Your offset time is: 2024-11-25 12:48:03