Sign in to follow this  
Endemoniada

Works in Debug but not Release ?

Recommended Posts

Endemoniada    430

Hi guys, I made a little physics engine and when I test a moving ball hitting a still ball the response is as expected when built in Debug mode, but when I build it in Release mode the response isn't correct; it doesn't really break or lock up, it just doesn't bounce the balls correctly at all.

 

What do you think it could be ?

 

I'm using VS2012 and C++

 

Thanks.

 

Share this post


Link to post
Share on other sites
jbadams    25674

Do you initialise all of your variables properly when they are first declared?  Debug builds will often initialise variables to some sensible value for you, while release will not -- this could account for differences in behaviour.

 

If the problem occurs when balls are bouncing you might try stepping through your collision detection/response code with the debugger and examining the values of your variables to help track down the problem.

 

 

 

If neither of the above (faster time-step or uninitialised variables) are to blame could you describe the incorrect behaviour in more detail?  What do you expect to happen, and what is actually happening instead?  Are balls not bouncing at all, bouncing at the wrong angles, or something else...?  smile.png

Share this post


Link to post
Share on other sites
doeme    1189

I would guess the same causes as jbadams, but if you are using multiple threads it could also be a race-condition that just happens a lot more often in release as in debug

Share this post


Link to post
Share on other sites
IkarusDowned    291

What makes you think that multi-thread access is causing completely wacky results? Where are the multiple threads accessing shared memory? Ensure that your synchronization is set up there correctly.

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

Sign in to follow this