Jump to content
  • Advertisement
Uttam Kushwah

undefined behavior of bullet objects.

Recommended Posts

Hello everyone i am trying to make some simpleton game but having trouble with bullet objects behavior.

in my game scene there is terrain shape for open world(which are nasty for now) and i am shooting some balls to check how terrain is doing. But some balls hit 

the terrain and some phase through so i don't know what to do or where exactly to dig.

 

you can see the problem here 

i know video quality is bad but bare it for now please i still newbie for uploading.

i guess you will get some clue what i am going through.

Thanks in advance.

 

Share this post


Link to post
Share on other sites
Advertisement

Basic debugging starts with making a reproducible test case that you can run over and over and over again, and it fails each and every time. A second property of the testcase is that it is as simple as you can make it. Currently you have a very complicated shape and it fails. Does simpler shapes exist that have the same problem?

This pretty much rules out interactive trying. You can of course print the exact starting parameters of each ball, and then use one of those values to get it reproducible.

Once you have that, you can start digging. check the trajectory of the ball, check how it (not) interacts with the world. At exactly that point, find the part of the world it is supposed to hit, and find out why it doesn't. You may want to use a debugger, and step through the code statement by statement until you find the spot where a "false" is created where a "true" should have been created.

Since it is reproducible, you can endlessly try to catch the bug. If you moved past the point, or get confused what is happening, think what happened, and try again.

Share this post


Link to post
Share on other sites

Thanks Alberth, 

So I need a solid test case which always fails, in that case my first ball always hit the plane but go through every other object that makes it(the case). Now I need to check the properties of the plane and the ball what making them interact to each other. By which i can find which thing having trouble the ball or other Non-planar object

I will try this. 

Share this post


Link to post
Share on other sites

Thanks lawnjelly, 

I have gone through the post you mentioned. 

But I am not sure that this is the problem with my simulation because that particular sphere also fails the raytest.  As I know raytest don't need time stamp to calculate the collision between the object and ray cause bullet and other physics engine checks collision when all the object are static at any instant. And also the size too is big. 

Although i will try to make it clear by reducing the velocity of the balls and then check it again and let you know

 

Share this post


Link to post
Share on other sites

i tried decreasing down the ball's velocity it is not working.

2 hours ago, Uttam Kushwah said:

Thanks lawnjelly, 

I have gone through the post you mentioned. 

But I am not sure that this is the problem with my simulation because that particular sphere also fails the raytest.  As I know raytest don't need time stamp to calculate the collision between the object and ray cause bullet and other physics engine checks collision when all the object are static at any instant. And also the size too is big. 

Although i will try to make it clear by reducing the velocity of the balls and then check it again and let you know

 

 

Share this post


Link to post
Share on other sites

If you are sure you can confirm it is not tunneling (you've tried continuous collision detection, you are sure of your stepping etc), then you will probably need to use detective work as Alberth suggests, I agree with the advice on using simple tests.

Share this post


Link to post
Share on other sites

Since you can log the initial position, velocity, etc. of each bullet and detect reliably which bullets tunnel through (they reach the boundaries of the scene), you can easily recover test cases from log files. Are you able to run scripted tests that launch one of the problem bullets without user input?

Edited by LorenzoGatti

Share this post


Link to post
Share on other sites

No they all are generated by user input. 

And I don't know how to do logging with bullet and scripting stuff too. But I am doing it by simply printing it to console , then close the application and find what happened - 😊simple. 

But after messing around debug drawer I found the terrain triangles all have normals in the negative y axis.  Is this can be the reason behind the problem ?

May be the ball hitting the back face of the triangle of terrain. If is it so then what should I do. 

Thanks for your attention. 

Note: I am a newbie but some day I'll learn how to do that fancy stuff. 

 

Share this post


Link to post
Share on other sites

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!