Sign in to follow this  

Falling through

This topic is 4730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey i'm overly confused by the Tutorial on BSP collision on GameTutorials. Its the third one- the one with gravity included. Now, i have looked through the code and cannot see why randomly you just fall through the floor. I assume its failed collision detection but i don't see how. When I implemented the second collision detection tutorial in my engine it worked perfectly and as far as I could see there were no holes in the level. Now it just fails randomly. Also, something else that is quite interesting; it instantly fails when viewed in window mode. Has anyone else come across this little problem(s) on BSPCollision Part 3? Thanks,

Share this post


Link to post
Share on other sites
I looked at that tutorial too, but I didn't have any problems with the collision detection. I don't have a very fast computer or a good graphics card - which the site said were two of the reasons that the tutorial was not working on some machines. I believe it has something to do with framerate that the program is running at.

Did you see this post on the front page of gametutorials.com:
Quote:
Quake3 Collision 3 Tutorial Fixed (AGAIN)
We just fixed the Quake3 Collision tutorial again, since the last fix didn't work for everyone. PLEASE contact me if this is not fixed and you keep falling through the floor immediately. Apparently, many people with Radeon cards were experiencing a bug where they fell straight through the floor right away on the last collision tutorial for Quake3. (For those of you wondering what I did, I just changed camera.cpp and changed kSpeed to 200 from 300 to compensate for the 0.005f that was added to g_FrameInterval in CalculateFrameRate() to fix the floating point error/imprecision.)

Its second from bottom (back from Nov. 6), so I thought that you may not have seen it yet. I don't know if this would help you, but I thought I would show it to you if you haven't seen it yet.

Share this post


Link to post
Share on other sites
A lot of falling through problems come from the check for an intersection with a plane/triangle where it is quite regular to see collision code where the collision is only tested for an actual collision. Example being - The sphere now collides with a triangle so lets react. Less often seen and implemented is the check if the sphere crossed the triangle without touching it.

ie. frame 1 sphere is in front of the triangle, frame 2 the sphere is behind the triangle. At no stage did the sphere touch the triangle as the distance travelled was to great. This is quite often missed with high frame rates as the sphere rarely travels far enough in a single frame for this to occur.

I dont know if this is the issue you are talking about, but it is quite possible.

Share this post


Link to post
Share on other sites
Hey
thanks for the info so far.
I had a look at the news about the fix and changed the kSpeed. I'm still having a fall through problem. My rig is AthlonXP 2800+ and also have a radeon 9800 pro...So I think I might have to fiddle some variables.
I think its the same problem that Lubby was talking about.

If anyone else has found a fix...?

Thanks so far however.

Share this post


Link to post
Share on other sites
I've not looked at that specific tutorial, but I doubt its the same issue that lubby is talking about. That happens with discrete testing of position, where as most BSP collision tutorials i've seen use ray casting and as such include the distance travelled.

What is more likely though is you are hitting precision issues, where its possible for intersections to be missed. These often get worse the higher the framerate as the distance travelled per frame becomes less, thus increasing precision problems.

Try adding extra tolerance to collision checks, and always back away slightly from the collision point (before calculating collision responce) that should help.

Also you might have more luck asking this in the maths and physics forum

Share this post


Link to post
Share on other sites
That sounds like a good idea- capping the frame rate. Also if I add in a few more thresholds on the collision detection then it will make it less likely to fail.

Thanks for all the help. I'll put in some capping code now

Share this post


Link to post
Share on other sites

This topic is 4730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this