Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Works in Debug but not Release ?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
4 replies to this topic

#1 Endemoniada   Members   

429
Like
0Likes
Like

Posted 16 January 2013 - 10:10 PM

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.

 



#2 Hodgman   Moderators   

50886
Like
0Likes
Like

Posted 16 January 2013 - 10:45 PM

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)?



#3 jbadams   Senior Staff   

25575
Like
2Likes
Like

Posted 16 January 2013 - 11:59 PM

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


- Jason Astle-Adams


#4 doeme   Members   

1189
Like
0Likes
Like

Posted 17 January 2013 - 01:54 AM

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



#5 IkarusDowned   Members   

291
Like
0Likes
Like

Posted 18 January 2013 - 02:58 AM

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.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.