The International Simutrans Forum

Development => Bug Reports => Topic started by: Diegote on October 24, 2009, 09:11:31 PM

Title: r2823 Win pak128 - random FPS drops
Post by: Diegote on October 24, 2009, 09:11:31 PM
The fps drop to 0-6 for about 20 seconds, then rise again near ~25FPS . After a few minutes (2-3) this happens again.

I tested GDI version and SDL version, new games and loading savegames, and tested it in two computers.
Title: Re: r2823 Win pak128 - random FPS drops
Post by: prissi on October 25, 2009, 07:23:42 PM
The you have something, that forbids interaction for more than 300ms. In such case simutrans will reduce the fps quickly to 5 fps to finish whatever goes on in the background of the engine more quickly. I suppose it might be the autosave though ... This shoudl be very apparent, if you run in fast forward mode, as then only very few vehicle movements will happen suddenly.
Title: Re: r2823 Win pak128 - random FPS drops
Post by: Diegote on October 25, 2009, 10:47:09 PM
Quote from: prissi on October 25, 2009, 07:23:42 PM
The you have something, that forbids interaction for more than 300ms. In such case simutrans will reduce the fps quickly to 5 fps to finish whatever goes on in the background of the engine more quickly. I suppose it might be the autosave though ... This shoudl be very apparent, if you run in fast forward mode, as then only very few vehicle movements will happen suddenly.

I downloaded the game, unzipped the files, copied the pak128 1.4.5, and started to play. With default setting, the autoSave function is disabled. I have also noticed that cpu usage drops down to 3-6% (from normal usage 20-30%)

This also happen in r2818

I watched for a while and I noticed that this drops seems to happen when a midi track ends and starting a new midi track (I'm not 100% sure that only happens when start a new midi track)
Title: Re: r2823 Win pak128 - random FPS drops
Post by: z9999+ on October 26, 2009, 06:31:10 AM
Some strange thing I found is...
Idle time sometimes shows big number, maybe 0 minus 1 ?
Although simloops shows higher number like as 8.0 or 9.0, fps doesn't increase soon.
It increased after over 10.0 simloops.
Title: Re: r2823 Win pak128 - random FPS drops
Post by: prissi on October 26, 2009, 07:31:17 PM
The fps increase is slow, to avoid changing too fast. Before also decrease was slow, so changes were less noticable.
Title: Re: r2823 Win pak128 - random FPS drops
Post by: z9999+ on October 31, 2009, 04:00:13 PM
Quote from: prissi on October 25, 2009, 07:23:42 PM
The you have something, that forbids interaction for more than 300ms. In such case simutrans will reduce the fps quickly to 5 fps to finish whatever goes on in the background of the engine more quickly.

I still hear complaining about this.
This is very annoying for the players who don't have any performance problem.
For example, it will happen just after opening minimap.

Released version of 102.2 was much more better performance than current version.


[EDIT]
Problem often happed when zoom-in, zoom-up, rotate, changing to underground view, changing slice view height, etc.
And once it happend it takes more than 30 seconds to back to normal fps.
Title: Re: r2823 Win pak128 - random FPS drops
Post by: Dwachs on November 01, 2009, 05:39:00 PM
Quote from: z9999+ on October 31, 2009, 04:00:13 PM
[EDIT]
Problem often happed when zoom-in, zoom-up, rotate, changing to underground view, changing slice view height, etc.
All this operations are quite expensive in terms of performance, since for all objects on the map a new image is calculated. Of course this can be optimized etc.
Title: Re: r2823 Win pak128 - random FPS drops
Post by: z9999+ on November 01, 2009, 05:51:33 PM
Removed these code and working well.

Quote
         if(  last_ms-last_interaction > 300  ) {
            set_frame_time( 250 );
         }
Title: Re: r2823 Win pak128 - random FPS drops
Post by: z9999+ on November 02, 2009, 07:42:20 AM
r2836

default fps=25:
During normal playing, it is a little better than before.
But after saving a game, it will go down to 2 fps, this is worse than before.

default fps=10:
No difference. Most of times only 4-5 fps.



This is only my result.
Many people stopped to play latest nightly because of fps problem, so I have not gotten any other player's feedback yet.
Title: Re: r2823 Win pak128 - random FPS drops
Post by: z9999+ on November 03, 2009, 07:55:40 AM
r2839
No difference from r2836.
Title: Re: r2823 Win pak128 - random FPS drops
Post by: prissi on November 03, 2009, 10:41:03 AM
Aparently I need more heavy save games, since all the games I have work smoothly (within the limits) and I never observe a drop of the fps below 4. If you or anybody could provide a savegame I would be greatful.