UFO:Alien Invasion

Technical support => Bugs in stable version (2.5) => Topic started by: SoftwareSimian on March 14, 2013, 02:53:08 am

Title: Load saved game very slow
Post by: SoftwareSimian on March 14, 2013, 02:53:08 am
In v2.4 the Load Game function worked pretty quickly, just a couple seconds to load a game. Now with v2.5 (2013mar11,win32) it takes a very long time (20-40 seconds) to load a game. Is this a known issue?
Title: Re: Load saved game very slow
Post by: ShipIt on March 14, 2013, 06:23:39 am
Uploading the save for somebody to check this would help a lot here.

I tried and didnĀ“t encounter something like this.
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 14, 2013, 02:13:16 pm
I'm not certain, but it seems to take longer to load the further into the game I get. Possibly more data on bases, soldiers, equipment, etc to load, but still I don't think it should take nearly that long to load. Saving is near-instantaneous.

The attached savegame takes exactly 20 seconds to load on my system (v2.5-2013mar11, Win7.64, i7-3930K, GTX570)
Title: Re: Load saved game very slow
Post by: H-Hour on March 14, 2013, 02:43:42 pm
Tried it here and didn't have any delays...
Title: Re: Load saved game very slow
Post by: jffdougan on March 15, 2013, 02:02:39 am
I'm having similar issues, although it had been a while since I'd played 2.4, so wasn't in a position to make the immediate comparison.
Title: Re: Load saved game very slow
Post by: ShipIt on March 15, 2013, 06:17:20 am
I could save & quickload without problems.
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 15, 2013, 02:46:35 pm
I'm not sure if there's any internal difference between quickload and regular load, but since I hadn't tried a quickload I tried that now -- makes no difference. Still takes about 20 seconds to load any game. And the computer is blocked while loading -- the UFOAI cursor is "stuck", and I get the Windows "busy" cursor (spinning blue circle on Win7) while the game loads.

Are there any debug options I can turn on to help try and figure out where this slowdown is occurring? And why it affects me and jffdougan but not H-Hour and ShipIt?  Is it perhaps platform-specific? Is everyone here trying it on Windows?
Title: Re: Load saved game very slow
Post by: H-Hour on March 15, 2013, 03:11:59 pm
ShipIt and myself are both Windows (me Win7).

Could it be rendering delays from loading the models into the system? Try turning shaders and other options off in the video settings...
Title: Re: Load saved game very slow
Post by: ShipIt on March 15, 2013, 03:53:06 pm
Iirc the delay when switching the time was caused by the models precaching option. Maybe turning this off in the options menu helps.
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 15, 2013, 04:39:21 pm
Try turning shaders and other options off in the video settings
Iirc the delay when switching the time was caused by the models precaching option. Maybe turning this off in the options menu helps.
I have been running at highest detail settings, and with pre-caching enabled.

However, I just tried both Medium and Low video presets, and I tried disabling options:overall:precache_models. None of those changes (restarting the game for each) made any appreciable difference to load times.
Title: Re: Load saved game very slow
Post by: jffdougan on March 15, 2013, 08:32:43 pm
Oddly, my save times aren't affected - just loading.
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 15, 2013, 10:00:15 pm
Oddly, my save times aren't affected - just loading.
Same here -- saving is near-instantaneous, but loading is a 20-second ordeal. Loading a saved game takes approximately the same amount of time as initially loading the game.  I'm not sure what kind of preloading/caching is (or can be) done during the loading process, but it seems a likely candidate for the slowdown. But having disabled what options I could see to no effect, combined with H-Hour and ShipIt not having problems, leaves me confused.
Title: Re: Load saved game very slow
Post by: geever on March 18, 2013, 03:49:20 pm
Saving the game is just saving the game. Loading however: shutdown campaign, start campaign, load game, render world. It should not (and for most of us it doesn't) take much time either but comparing save and load times makes no sense.


Have you compiled the game for yourselves?

Tips:
- set pre-cache enabled (slower boot time but more smooth model loading later)
- make sure you have models compiled (mdx files via make models)

May worth a try: Exclude savx extension from your antivirus? Do you have the same kind?


Other than that, a profiling log from the loading process is welcome...

-geever
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 18, 2013, 05:05:04 pm
Have you compiled the game for yourselves?
No, I'm just using the provided nightly Windows build (http://ufoai.org/snapshots/ufoai-latest-win32.exe). Updating the binaries with the nightly binaries only (http://ufoai.org/snapshots/ufoai-latest-win32.zip) made no difference positive or negative.

set pre-cache enabled (slower boot time but more smooth model loading later)
Is this the same "pre-cache models" option under Options->Overall->Precache Models? If so, I've tried that and either enabled or disabled makes little visible difference in game boot or load game times.

make sure you have models compiled (mdx files via make models)
I don't see any .mdx files anywhere in the installation director. Where should they live?

May worth a try: Exclude savx extension from your antivirus? Do you have the same kind?
I disabled my antivirus entirely (Panda Cloud) and it made no difference.

Other than that, a profiling log from the loading process is welcome...
And how do I make you one?
Title: Re: Load saved game very slow
Post by: geever on March 18, 2013, 06:22:53 pm
No, I'm just using the provided nightly Windows build (http://ufoai.org/snapshots/ufoai-latest-win32.exe). Updating the binaries with the nightly binaries only (http://ufoai.org/snapshots/ufoai-latest-win32.zip) made no difference positive or negative.
Is this the same "pre-cache models" option under Options->Overall->Precache Models? If so, I've tried that and either enabled or disabled makes little visible difference in game boot or load game times.
I don't see any .mdx files anywhere in the installation director. Where should they live?
I disabled my antivirus entirely (Panda Cloud) and it made no difference.
And how do I make you one?

If you use the installer there isn't really much I think you can do without big efforts (learning how to build and debug) unfortunately. :(
( mdx files are packed in case of the installer. And for profiling you need a special build... )

-geever
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 18, 2013, 06:55:31 pm
Presumably those for whom the load time are working fine are all self-compiled, and those of us who are simply play-testing with the precompiled binaries have the slow load times?

If that's the case, can one of those who have no problem loading try installing a copy of the latest installer and see if slow load times are reproducible that way?
Title: Re: Load saved game very slow
Post by: DarkRain on March 18, 2013, 09:49:27 pm
Is the nightly compiled in release mode? I so this might be a release-only bug, like the the slow air combat one
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 19, 2013, 06:35:06 pm
Is the nightly compiled in release mode? I so this might be a release-only bug, like the the slow air combat one
Not sure if that question was directed at me. The version I'm using shows:
Quote
UFO: Alien Invasion 2.5-dev IA-32 Mar 18 2013 Win32 DEBUG
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 21, 2013, 04:29:50 am
I've entered this into the tracker as issue #4936 (http://ufoai.org/bugs/ufoalieninvasion/issues/4936).
Title: Re: Load saved game very slow
Post by: ShipIt on March 21, 2013, 07:25:38 am
I checked this. As DarkRain said, it seems to be a problem of the installer.
Title: Re: Load saved game very slow
Post by: Mattn on March 21, 2013, 08:24:49 am
i will try to update the buildchain on the buildbot server.
Title: Re: Load saved game very slow
Post by: jffdougan on March 21, 2013, 09:30:19 pm
Let us know when it's done and I'll try to install the new build & see if it fixes the problem.
Title: Re: Load saved game very slow
Post by: ShipIt on March 21, 2013, 09:41:45 pm
The fix is in place. You can check it out with the next nightly build.
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 22, 2013, 04:30:07 pm
I just tried
Quote
UFO: Alien Invasion 2.5-dev IA-32 Mar 22 2013 Win32 DEBUG
from both the EXE-only and full installer nightly builds, and load times are unchanged. Loading a relatively young game (08-May-2084) takes 9.5 seconds; loading a late game (20-May-2085) takes 31.5 seconds.

slot4.savx = May-2084
slot7.savx = May-2085
Title: Re: Load saved game very slow
Post by: ShipIt on March 22, 2013, 05:32:00 pm
Please report any updates for this also in the tracker item (http://ufoai.org/bugs/ufoalieninvasion/issues/4936).
Title: Re: Load saved game very slow
Post by: jffdougan on March 27, 2013, 02:37:18 am
Any progress at squishing this? (Checking while looking to see if anybody else has had issues with the bug I reported last night.)
Title: Re: Load saved game very slow
Post by: Nokim on March 27, 2013, 06:54:37 am
Can be this memory allocation issue? On save loading it happens a lot. And a later save - more to parse (and make small memory allocations).

How many RAM have affected users?
Title: Re: Load saved game very slow
Post by: geever on March 27, 2013, 12:33:12 pm
Can be this memory allocation issue?

I don't think so.

-geever
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 27, 2013, 01:41:41 pm
How many RAM have affected users?
I have 64GB in my machine, so that's extremely unlikely.
Title: Re: Load saved game very slow
Post by: jffdougan on March 27, 2013, 04:15:42 pm
My laptop (which machine is the one that runs UFO: AI) is a 2.00 Gb RAM machine. That certainly might explain why my load times are longer than SS's.
Title: Re: Load saved game very slow
Post by: SoftwareSimian on March 27, 2013, 06:48:40 pm
My laptop (which machine is the one that runs UFO: AI) is a 2.00 Gb RAM machine. That certainly might explain why my load times are longer than SS's.
But are they? What are you load times like? Despite my high-end machine I'm getting 20-40 second load times.
Title: Re: Load saved game very slow
Post by: jffdougan on March 27, 2013, 08:50:48 pm
I think it was about 120 sec the last time I thought to try to clock it.
Title: Re: Load saved game very slow
Post by: SoftwareSimian on April 15, 2013, 05:02:11 pm
Looking at ufoconsole.log I see where the delay is occurring:
The whole load process should take about one second, except for this:
Quote
2013/04/15 10:41:05 ...Running subsystem 'employee'
2013/04/15 10:41:29 ...subsystem 'employee' - loaded.
24 seconds to load "subsystem 'employee'".


Full load log for reference:
Code: [Select]
2013/04/15 10:41:04 Loading savegame xml (size 69190)
2013/04/15 10:41:04 Loading savegame
...version: 4
...game version: 2.5-dev
...xml Size: 810624, compressed? y
2013/04/15 10:41:04 Shutdown gametype 'Campaign mode'
2013/04/15 10:41:04 Change gametype to 'Campaign mode'
2013/04/15 10:41:04
--- save subsystem initialization --
2013/04/15 10:41:04 added campaign subsystem
2013/04/15 10:41:04 added research subsystem
2013/04/15 10:41:04 added base subsystem
2013/04/15 10:41:04 added hospital subsystem
2013/04/15 10:41:04 added market subsystem
2013/04/15 10:41:04 added employee subsystem
2013/04/15 10:41:04 added aliencont subsystem
2013/04/15 10:41:04 added aircraft subsystem
2013/04/15 10:41:04 added alien base subsystem
2013/04/15 10:41:04 added interest subsystem
2013/04/15 10:41:04 added installation subsystem
2013/04/15 10:41:04 added mission subsystem
2013/04/15 10:41:04 added ufostores subsystem
2013/04/15 10:41:04 added production subsystem
2013/04/15 10:41:04 added messagesystem subsystem
2013/04/15 10:41:04 added stats subsystem
2013/04/15 10:41:04 added nations subsystem
2013/04/15 10:41:04 added transfer subsystem
2013/04/15 10:41:04 added xvirate subsystem
2013/04/15 10:41:04 added messageoptions subsystem
2013/04/15 10:41:04 added triggerevents subsystem
2013/04/15 10:41:04 Campaign data loaded - size 663400 bytes
2013/04/15 10:41:04 ...techs: 217
2013/04/15 10:41:04 ...buildings: 16
2013/04/15 10:41:04 ...ranks: 16
2013/04/15 10:41:04 ...nations: 8
2013/04/15 10:41:04 ...cities: 456
2013/04/15 10:41:04
2013/04/15 10:41:04 Load 'slot3' 21 subsystems
2013/04/15 10:41:04 ...Running subsystem 'campaign'
2013/04/15 10:41:05 ...subsystem 'campaign' - loaded.
2013/04/15 10:41:05 ...Running subsystem 'research'
2013/04/15 10:41:05 ...subsystem 'research' - loaded.
2013/04/15 10:41:05 ...Running subsystem 'base'
2013/04/15 10:41:05 ...subsystem 'base' - loaded.
2013/04/15 10:41:05 ...Running subsystem 'hospital'
2013/04/15 10:41:05 ...subsystem 'hospital' - loaded.
2013/04/15 10:41:05 ...Running subsystem 'market'
2013/04/15 10:41:05 ...subsystem 'market' - loaded.
2013/04/15 10:41:05 ...Running subsystem 'employee'
2013/04/15 10:41:29 ...subsystem 'employee' - loaded.
2013/04/15 10:41:29 ...Running subsystem 'aliencont'
2013/04/15 10:41:29 ...subsystem 'aliencont' - loaded.
2013/04/15 10:41:29 ...Running subsystem 'aircraft'
2013/04/15 10:41:29 ...subsystem 'aircraft' - loaded.
2013/04/15 10:41:29 ...Running subsystem 'alien base'
2013/04/15 10:41:29 ...subsystem 'alien base' - loaded.
2013/04/15 10:41:29 ...Running subsystem 'interest'
2013/04/15 10:41:29 ...subsystem 'interest' - loaded.
2013/04/15 10:41:29 ...Running subsystem 'installation'
2013/04/15 10:41:29 ...subsystem 'installation' - loaded.
2013/04/15 10:41:29 ...Running subsystem 'mission'
2013/04/15 10:41:29 ...subsystem 'mission' - loaded.
2013/04/15 10:41:29 ...Running subsystem 'ufostores'
2013/04/15 10:41:29 ...subsystem 'ufostores' - loaded.
2013/04/15 10:41:29 ...Running subsystem 'production'
2013/04/15 10:41:29 ...subsystem 'production' - loaded.
2013/04/15 10:41:29 ...Running subsystem 'messagesystem'
2013/04/15 10:41:30 ...subsystem 'messagesystem' - loaded.
2013/04/15 10:41:30 ...Running subsystem 'stats'
2013/04/15 10:41:30 ...subsystem 'stats' - loaded.
2013/04/15 10:41:30 ...Running subsystem 'nations'
2013/04/15 10:41:30 ...subsystem 'nations' - loaded.
2013/04/15 10:41:30 ...Running subsystem 'transfer'
2013/04/15 10:41:30 ...subsystem 'transfer' - loaded.
2013/04/15 10:41:30 ...Running subsystem 'xvirate'
2013/04/15 10:41:30 ...subsystem 'xvirate' - loaded.
2013/04/15 10:41:30 ...Running subsystem 'messageoptions'
2013/04/15 10:41:30 ...subsystem 'messageoptions' - loaded.
2013/04/15 10:41:30 ...Running subsystem 'triggerevents'
2013/04/15 10:41:30 ...subsystem 'triggerevents' - loaded.
2013/04/15 10:41:30 File 'slot3' successfully loaded from compressed xml savegame.
Title: Re: Load saved game very slow
Post by: Kemlo on April 15, 2013, 07:06:20 pm
Looking at ufoconsole.log I see where the delay is occurring:
The whole load process should take about one second, except for this:24 seconds to load "subsystem 'employee'".
I have the same issue, only this has been the case for as long as I can remember so I just assumed it was normal. Checking my log shows that the employee subsystem takes 23 second to load.
I compiled 2.5dev myself on 25/3/2013.  Running Win7 64bit, Phenom II X3 720, 8GB RAM, AMD 7850 graphics card.
Title: Re: Load saved game very slow
Post by: Conan on May 17, 2013, 10:00:20 am
Hi, I also have the same issue with 15.May full install version, load time is 35s. I also had slow air combat in stable 2.4 version, but never slow load time before (started to play AI from stable 2.1).

Anticipation was too great to wait for a stable 2.5 :)


Win 7 64bit, RAM 4GB, VGA 1GB, CPU Q6600
Title: Re: Load saved game very slow
Post by: jcjordan on May 17, 2013, 11:37:49 pm
I've seen the same thing in my very late game version & it's at the point that SoftwareSimian mentions - in mine it's about a 2-4+min wait on the  employees. I assume it's the loading of all the employee info in the hire pools. I've got alot of unused soldiers, workmen & scientists that I'll never use. Would just having a pool that says you've got X  number of this type & not give them names/stats until actually hired work to alleviate the problem or maybe a way to dismiss/cull people from the pool?
Title: Re: Load saved game very slow
Post by: Conan on May 21, 2013, 05:16:52 pm
Now I am in the later game and load time has increased to 45s.
Title: Re: Load saved game very slow
Post by: DarkRain on May 21, 2013, 09:01:11 pm
@jcjordan: Can't right-click the checkbox to remove characters from the employee pools? I don't know if it will help, but trying shouldn't hurt.
Title: Re: Load saved game very slow
Post by: jcjordan on May 21, 2013, 11:26:49 pm
@jcjordan: Can't right-click the checkbox to remove characters from the employee pools? I don't know if it will help, but trying shouldn't hurt.

I didn't know about that, I'll give that a try to see what it does.
Title: Re: Load saved game very slow
Post by: SoftwareSimian on May 22, 2013, 01:58:24 am
Can't right-click the checkbox to remove characters from the employee pools? I don't know if it will help, but trying shouldn't hurt.
It does affect load time.

I took my worst-case end-game savefile and purged all the not-hired employees (I lost count, but there were several hundred of them, maybe 300-500 or so?, including soldiers, pilots, workers, scientists). I left the 151 active/hired employees as-is.

Before, load time with all employees (both active and inactive):
Code: [Select]
2013/05/21 19:30:45 ...Running subsystem 'employee'
2013/05/21 19:31:21 ...subsystem 'employee' - loaded.
= 36 seconds to load "employee" subsystem

After with inactive employees deleted:
Code: [Select]
2013/05/21 19:50:47 ...Running subsystem 'employee'
2013/05/21 19:50:55 ...subsystem 'employee' - loaded.
= 8 seconds to load "employee" subsystem
The "hurt", of course, is that I no longer have those employee candidates in the pool to choose from if I want to hire more employees.

Load time seems directly related to number of employees: I eliminated about 75% of my labour pool and reduced load time by about the same amount.
Title: Re: Load saved game very slow
Post by: Conan on June 16, 2013, 10:26:14 am
OK, finished the 2.5-dev (jun-7-2013) and at the end load times were around 2min, hope you can fix it in stable release.
Title: Re: Load saved game very slow
Post by: Spacey on July 23, 2014, 09:01:13 pm
I have this exact problem with 2.5  =(
Title: Re: Load saved game very slow
Post by: Garibaldi on August 29, 2014, 09:29:47 pm
i'm playing on Win, v2.5. My laptop is *seriously* old, but the game ran fine for the first 'game year'. By now, halfway through the next, it is taking over 5mins to load - i can tell, because my screen-saver kicks in at around the same time.

OK, having read the above thread, it seems that deleting some of the un-hired potential staff can speed things up considerably - i have pages of pilots, for instance. I'll never need 50+ pilots!

whilst i miss the legibility of Ubuntu, i have graphics-card issues with the linux drivers (its an excuse, but its also true. Winblows bleh! But its better than nothing). My question is this - how can i remove those extra persons from the hiring list, on the Windows version? What file do i look for - or is it in-game, and i'm just being dumb??
Title: Re: Load saved game very slow
Post by: Internecivus on August 30, 2014, 01:17:51 am

My question is this - how can i remove those extra persons from the hiring list, on the Windows version? What file do i look for - or is it in-game, and i'm just being dumb??


Click your right mouse button on hire checkbox. It will delete them.
Title: Re: Load saved game very slow
Post by: Garibaldi on August 30, 2014, 04:30:06 pm
TY!

i'd tried that on the name. :/

>>dumb<< 8)
Title: Re: Load saved game very slow
Post by: geever on September 02, 2014, 09:50:37 pm
FYI: Yesterday I committed a change into 2.6 that reduces loading time of the employees subsystem to about two-third of the original code.

-geever