Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.9.1a is out! (05/10/19); Blog post: Skills and Story Points (07/08/19)

Pages: [1] 2

Author Topic: Micro stutters in campaign  (Read 4068 times)

Gothars

  • Global Moderator
  • Admiral
  • *****
  • Posts: 4152
  • Eschewing obfuscatory verbosity.
    • View Profile
Micro stutters in campaign
« on: November 26, 2015, 12:26:27 PM »

Uh, this is gonna be a pretty fuzzy report, but I though I'd make in case something similar comes up.

After having the game run for some time in background and tabbing out repeatedly, there are more and more stutters during flight. They happen about every 1.5 to 4 seconds (variable) and might be related to sensor contacts happening, i.e. I've seen them happening synchronous with a "sensor ring edge" appearing. But not always. The frame rate stayed at a constant 60 during this. Restarting the game fixed it.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 15364
    • View Profile
Re: Micro stutters in campaign
« Reply #1 on: November 26, 2015, 12:38:11 PM »

Thanks - I'll keep an eye out. Might be one of those things that going back to Java 7 will fix, too. 8 has been nothing but trouble, and since it's only required for OS X, I'll most likely leave it there and revert back for Windows/Linux.
Logged

Cyan Leader

  • Admiral
  • *****
  • Posts: 535
    • View Profile
Re: Micro stutters in campaign
« Reply #2 on: November 26, 2015, 03:45:00 PM »

I've been getting these too, I feel it is related to when I'm flying with time compression on and going through obstacles.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 15364
    • View Profile
Re: Micro stutters in campaign
« Reply #3 on: November 26, 2015, 08:09:31 PM »

Another possibility here is that tabbing out for a long time moved the game from RAM to swap space, which might cause this type of behavior. It could also be caused by editing vmparams to allocate too much memory for the game.

(I've seen similar things with other games, too, especially after a long tab-out. Not sure it's something that anything can be done about in that case, it being an OS thing.)
Logged

Baqar79

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Micro stutters in campaign
« Reply #4 on: November 26, 2015, 08:53:09 PM »

I have had a similar issue, but I don't know if it is the same problem as Gothar.

It does have similar symptoms, a stutter about every 3 seconds.  I have two computers (one running older hardware), that this is more pronounced on, but it does happen on my main PC as well.  It may have something to do with how busy the system is, or how far through the campaign is, since it seems to be better on starting a new game.

It also might be because of the alt-tabbing that i'm seeing this on my main PC, but the stutter is there on the older machine regardless. 

Just to clarify..the framerate on the older machine is 60FPS, but every 3 secs it seems to pause for a fraction of a second and the FPS counter drops then returns to normal.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 15364
    • View Profile
Re: Micro stutters in campaign
« Reply #5 on: November 26, 2015, 09:03:56 PM »

Just to clarify..the framerate on the older machine is 60FPS, but every 3 secs it seems to pause for a fraction of a second and the FPS counter drops then returns to normal.

Does it get better after an application restart, or is it persistent for that save? If it's the latter, it might be that some calculation it does later on in the campaign, periodically, is causing this. If so: I'd love to borrow the save to take a look.
Logged

Baqar79

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Micro stutters in campaign
« Reply #6 on: November 26, 2015, 10:06:05 PM »

Hmm, no it doesn't get better with an application restart.  To be honest this is happening quite a bit on my main PC, an unfortunate consequence of releasing an extremely enjoyable alpha is that you ignore these things, because you are too busy playing. :)

Transferring the save to the older machine and it also has the same problem.  The stutter isn't happening exactly every 3 seconds, it does vary a bit (sometimes every second, sometimes a bit longer); I certainly notice it more when I'm accelerating time, but it still happens if I don't do this.

I started a new game and now that i'm looking for it, I noticed it there as well, but it is a lot less frequent (basically unnoticeable if you don't accelerate time). 

If you think you might need the save, is it ok to email it (I don't have a dropbox or similar)?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 15364
    • View Profile
Re: Micro stutters in campaign
« Reply #7 on: November 26, 2015, 10:11:42 PM »

Yeah, if you can email me the save, that'd be great.

fractalsoftworks [at] gmail [dot] com

Thank you!
Logged

Kzanu

  • Ensign
  • *
  • Posts: 40
    • View Profile
Re: Micro stutters in campaign
« Reply #8 on: November 27, 2015, 04:00:50 AM »

I'm also having this issue after about 30 hours of gameplay, though I can 100% confirm that at the start of the game, it was frame capped at 60 all the time, no stutter. I can confirm I alt+tabb-ed a lot during these 30 or so hours.  Also I'm having huge space battles with no drop in framerate (old PC but works fine).

@Alex If you need another set of saves just mention and I will send them.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 15364
    • View Profile
Re: Micro stutters in campaign
« Reply #9 on: November 27, 2015, 01:56:32 PM »

@Kzanu: thank you for offering - much appreciated, but looks like it won't be necessary.

Managed to reproduce this and eventually narrowed it down to market procurement mission creation, of all things.

Turns out it was creating new people, and if a mission wasn't accepted, it was still keeping them around forever, so the list of people grew and grew. Then when creating new missions, it'd look through the list (which, in Baqar's save, had grown to 2400+ people) trying to find a matching person to use. Which wouldn't be that bad by itself (2400 isn't too long of a list to iterate over), but it was also running in quadratic time for... reasons. It'd try to create new missions/prune existing ones every couple of seconds, which is where the stutter would happen.

So, anyway, long story short: this is all fixed. Thank you all for your help! Took a while to track down, but would've been way more time-consuming without a save.
Logged

Gothars

  • Global Moderator
  • Admiral
  • *****
  • Posts: 4152
  • Eschewing obfuscatory verbosity.
    • View Profile
Re: Micro stutters in campaign
« Reply #10 on: November 27, 2015, 02:43:22 PM »

Well, that report was worth it, after all :)  ... now I have to resist the impulse to put this post in parenthesis...
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 15364
    • View Profile
Re: Micro stutters in campaign
« Reply #11 on: November 27, 2015, 02:45:57 PM »

(Oh no!) ((OH NO!!!))

... ok I'll stop.
Logged

SCC

  • Admiral
  • *****
  • Posts: 1511
    • View Profile
Re: Micro stutters in campaign
« Reply #12 on: November 27, 2015, 02:56:36 PM »

I don't get why wouldn't you have the right to get sneaky beaky like sometimes. That's nothing wrong, after all, and I bet everybody want cool admin/game-developer! Just don't go overboard with it ;)

Baqar79

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Micro stutters in campaign
« Reply #13 on: November 27, 2015, 05:05:49 PM »

Woohoo..Ahem.

I actually expected you to turn around and say 'Sorry no, I don't see the problem'.  It's great to have been a little bit helpful, though many here would of been more than happy to do the same.  Also glad it wasn't just my machines.  I swear every time I purchase new PC parts (I build all my own), it doesn't quite work as well as other peoples, despite my endless tweaking and configuring.

Hmm..I tried to figure out where those people are.  Is that the MPM_mission_contact entries I see in campaign.xml? I see 2410 entries in the save I sent you, but it has now grown to 2611 entries now  ;D

What happens if I delete them..lets see...



Pretty much what was to be expected - when you have no clue what you are doing (which is another reason I should be catching up on my compsci homework!)  :D
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 15364
    • View Profile
Re: Micro stutters in campaign
« Reply #14 on: November 27, 2015, 05:19:03 PM »

Hmm..I tried to figure out where those people are.  Is that the MPM_mission_contact entries I see in campaign.xml? I see 2410 entries in the save I sent you, but it has now grown to 2611 entries now  ;D

Yep, that's them. Removing them might not be possible (well, not without an unreasonable effort) since they're likely referenced from several places. So if you remove them from the spot they're in, references to them elsewhere in the savefile may still exist.

Pretty much what was to be expected - when you have no clue what you are doing (which is another reason I should be catching up on my compsci homework!)  :D

Have fun with that :)
Logged
Pages: [1] 2