Source Code Project Mantis - FSSCP
View Issue Details
0002446FSSCPgraphicspublic2011-05-29 12:492011-05-30 14:48
Assigned ToThe_E 
PlatformOSOS Version
Product Version3.6.13 
Target VersionFixed in Version3.6.13 
Summary0002446: Particle generation when game is paused
DescriptionIf you pause the game by pressing either esc, pause or alt-tabbing (same as pause) while FSO is generating particles, resuming the game will take really long time by seemingly freezing FSO to halt until it slowly starts recovering from really low fps to normal fps. This problem can be replicated by either tabling options or any script that produces particles.

This problem isn't new and has been around since at least 3.6.11.

I suggest trying this script to trigger the problem.
TagsNo tags attached.
Attached Filespatch mantis2446-patch.patch (2,340) 2011-05-30 13:35

2011-05-29 12:50   
Forgot to say that the recovery from pause is slower the more particles were generated when game was paused.
2011-05-30 12:38   
I further tested the pause problem and I have to correct myself. This doesn't occur with pause, only with esc menu.

You see, if you press pause, you get Got event GS_EVENT_PAUSE_GAME (6) in state GS_STATE_GAME_PLAY (2)
If you press it again, you get Got event GS_EVENT_PREVIOUS_STATE (7) in state GS_STATE_GAME_PAUSED (3)

But if you press esc instead, game state does not change. I suspect this means all scripts are left in running state and when you resume the game, everything that your scripts have been working while esc menu was on, is getting thrown in at once. No idea at this time if this is limited to scripts or whether it does affect tabled particle generation too.
2011-05-30 13:36   
I traced the code responsible for the popup and it calls gr_flip() which causes the CHA_ONFRAME scripting hook to be run. Disabling this hook as long as the popup is shown fixes the problem.
Patch is attached.
2011-05-30 14:47   
Patch committed to trunk in revision 7219

Issue History
2011-05-29 12:49FuryNew Issue
2011-05-29 12:50FuryNote Added: 0012695
2011-05-30 12:38FuryNote Added: 0012699
2011-05-30 13:35m_mFile Added: mantis2446-patch.patch
2011-05-30 13:36m_mNote Added: 0012700
2011-05-30 14:47The_ENote Added: 0012701
2011-05-30 14:48The_EStatusnew => resolved
2011-05-30 14:48The_EFixed in Version => 3.6.13
2011-05-30 14:48The_EResolutionopen => fixed
2011-05-30 14:48The_EAssigned To => The_E