PezzA Posted November 17, 2009 Report Share Posted November 17, 2009 (edited) It's not because its taking to long to do something, but because it's doing stuff too fast (or possibly not doing it at all)! When you get the game freeze, it's actually reporting 0.0001ms between frames. Game time is advanced using the time between frames as a multiplier. close to zero frame ms period means close to zero game-time advancement. I did a quick if(ms But why the I've attached a patch for the hack i did to get over the freeze in lieu of having an actual fix. Hopefully this will make the game a bit more playable untill then. gamefreezetempfix.zip Edited November 17, 2009 by PezzA Link to comment Share on other sites More sharing options...
Darkhomb Posted November 17, 2009 Report Share Posted November 17, 2009 Great news, Good work. Link to comment Share on other sites More sharing options...
kafros Posted November 17, 2009 Report Share Posted November 17, 2009 (edited) Hahaha, hear hear! Nice catch So, is it a XNA issue, or just a default behaviour which should be changed? Edited November 17, 2009 by kafros Link to comment Share on other sites More sharing options...
[Mad] Posted November 17, 2009 Report Share Posted November 17, 2009 Good work - this explains why this problem is more severe on faster machines than on slower machines... Link to comment Share on other sites More sharing options...
PezzA Posted November 17, 2009 Author Report Share Posted November 17, 2009 (edited) This sounds like our problem it has some possible solutions as well. Which do people think is best? Edited November 17, 2009 by PezzA Link to comment Share on other sites More sharing options...
kafros Posted November 18, 2009 Report Share Posted November 18, 2009 We should wait for dteviot's opinion on this one. Link to comment Share on other sites More sharing options...
[dteviot] Posted November 18, 2009 Report Share Posted November 18, 2009 (edited) We should wait for dteviot's opinion on this one.Firstly, PezzA, thanks very much for tracking down the problem. Now that you've pointed it out, I can recall that I had a lot of problems with ElapsedRealTime vs. ElapsedGameTime. However, that was back with XNA 1.1.My opinion is ask one the people suffering from the slowdown to try using ElapsedGameTime in GeoData.PumpUpdate (file Source\Model\Geoscape\GeoData.cs)e.g. public void PumpUpdate(GameTime gameTime) { // get elapsed time plus any leftover time from last iteration double gameMilliseconds = GeoTime.RealTimeToGameTime(gameTime.ElapsedRealTime) + leftoverTimeStep; leftoverTimeStep = 0.0;becomes public void PumpUpdate(GameTime gameTime) { // get elapsed time plus any leftover time from last iteration double gameMilliseconds = GeoTime.RealTimeToGameTime(gameTime.ElapsedGamelTime) + leftoverTimeStep; leftoverTimeStep = 0.0; And checking that RealTimeToGameTime() in GeoTime (file Source\Model\Geoscape\GeoTime.cs) does NOT have your tempory fix. i.e. Function should look like this: public double RealTimeToGameTime(TimeSpan timespan) { return timespan.TotalMilliseconds * timeRatio; }If this fixes the problem, then it's the simplest solution. If it doesn't work, then we're going to need to do the time measuring ourselves. Probably using a Stopwatch as suggested. Edited November 18, 2009 by dteviot Link to comment Share on other sites More sharing options...
PezzA Posted November 18, 2009 Author Report Share Posted November 18, 2009 I could reliably recreate the issue, and elapsedgametime appears to resolve it. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now