Jump to content
XCOMUFO & Xenocide

Game slowdown issue


PezzA

Recommended Posts

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 by PezzA
Link to comment
Share on other sites

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 by dteviot
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...