Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

Works in Debug but not Release ?

This topic is 2158 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

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
Advertisement

How does your timing/stepping work? It could just be that the release version is running faster, and thus running a more detailed simulation (more steps of a smaller size)?

Share this post


Link to post
Share on other sites

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

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

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
Sign in to follow this  

  • 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!