"Initializing teams" and other slowness; horse graphics

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
Imp
Posts: 317
Joined: January 8th, 2007, 10:56 am

"Initializing teams" and other slowness; horse graphics

Post by Imp »

PROBABLE SPOILERS

32-bit Vista Home Service Pack 2.
Intel Core 2 Duo E8400 @ 3.00 GHz.
4.00 GB RAM.

Versions affected:
1.6.5
1.7.8

I tried to play 1.6.5 first but the issues made me try 1.7.8 hoping things would improve. They didn't, and 1.7.8 is what I have installed now.

Let's get the minor thing out of the way first because the other bit's lengthy: the graphics for fast-moving units like elvish scouts and horsemen seem very jerky, even at standard (non-accelerated) speed.



Now, the slowness issues.

I have only played SP so far; haven't had a chance to try MP.

I always run in Windowed mode but the problems seem to persist even in fullscreen mode.

Mainly I've been playing HttT but have noticed some of the slowness when quickly trying out other campaigns. Now, using 1.6.5:

The most noticeable part is when loading a map, the loading bar gets to "Initializing teams" and stops for an unusually long time. It starts off taking about 10 seconds for the first map in HttT (the rest of the loading screen takes about 2 seconds altogether). As the campaign continues, the time taken just for "Initializing teams" increases to the order of 2-5 minutes while the rest of the loading screen stays at around 2 seconds altogether.

I got up to the Gryphon mountain before finally quitting and switching to 1.7.8. Here are some more observations for 1.6.5:

My recall list by the end had about 30-50 units. It wasn't massive: just the standard assortment of advanced units, the loyal mers, other loyal units, and some unleveled outlaws from Isle of the Damned in case I ever want to use them, and some experienced unlevelled units. However, the "Initializing teams" issue appears even on the first map, before I have a recall list.

The slowness extends even into the game. The AI takes a noticeably long time to make its move. Perhaps 2-5 seconds. Normally the pause is at the start of its turn, sometimes it occurs partway through its turn. This became more noticeable on some maps than on others. In particular, at Crossroads, the map just after Siege of Elensefar, there were a host of problems:

After finishing Siege, and the map went dull, moving onto the next scenario took a very long time. Perhaps 5-10 minutes. It would stay on the dulled map during that time and be unresponsive. The usual "The program is not responding..." message pops up in Windows if I try to do anything. Just leaving it allows it to resolve itself eventually. This is true whenever Wesnoth slows. It also usually uses about 50% of my CPU cycles during the slow periods, whenever they occur.

Now, after the dulled map from Siege it finally moves onto the storyboard for the next mission, Crossroads (the one we have to kill the northeastern orc leader). This map gave me the most trouble. Perhaps the slow transition from the end of Siege to this map should have been a hint. Right from the very start there were long pauses everywhere. The AI would pause for about a minute at the beginning of every single turn - each AI team had its own pause - before making its moves. Right from the start. It remained exceedingly long even to the end, when they had almost no troops and no money left. My guess at the time was perhaps the scripted hidden orcs in the mountains somehow made the AI behaviour slower than normal. By the end of the mission, though, I was pretty sure I'd found every single hidden orc, and the AI still paused for a long time at the start of its turn.

After Crossroads, the AI moves returned to normal, with shorter pauses at the beginning of their turns and intermittent pauses during their turns. Most of them were back to 2-5 seconds, but something must have happened on Gryphon mountain to stop me playing, so maybe it went long again there, I can't remember.

The "Initializing teams" slowness remained in all the maps, though, and grew in duration as the game wore on. I can't remember if Crossroads had an exceptionally long duration for this particular issue.

Playing 1.7.8:

I haven't played very far into HttT on this because of fear that it will become unplayable again. The first two missions seem to exhibit the same characteristics as in 1.6.5, though. Noticeably, suspicious pauses at the start of AI turns, jerky horse movements and "Initializing teams" taking up most of the loading time. Again, with 1.7.8, I've tried the first mission of several other campaigns and noticed the same "Initializing teams" problem. I've tried disabling other programs running in the background and rebooting in safe mode, but it doesn't seem to matter.

I've tried disabling all of the options - no sound, no graphics, No to all of the miscellaneous things, including compressed saves, but it doesn't seem to affect anything. "Initializing teams" continues to take a long time.

Unfortunately, I've deleted all of the saves for 1.6.5 (some were compressed, some weren't - it made no difference) when I uninstalled it and don't have any substantial saves for 1.7.8. I'll try MP later this month when I have some time and we'll see how that goes. With no AI, MP shouldn't have those excruciating pauses, and perhaps the "Initializing teams" problem has something to do with the storyboards? Well, we'll see.

So...what do you guys make of this?



I have a friend running Vista Pro and it works fine for him with no issues.
Imp
Posts: 317
Joined: January 8th, 2007, 10:56 am

Re: "Initializing teams" and other slowness; horse graphics

Post by Imp »

Just had a quick run through the first mission of HttT. It was grueling. Sometimes the AI would recruit one unit at the start of its turn, it would pause for a few seconds, and then it finishes the recruiting and the rest of its turn quickly. The jerkiness applies to the elvish scout and the orc riders in this map.

At the end of the mission, it was stuck on "Initializing teams" for about 15 seconds before going to the next storyboard. At the start of the next mission, I pressed Esc to skip the dialog and there was about a 3-second pause before the first turn dialog appears with the victory conditions (it feels like a long time when it happens, though, but I figure it must have been about 3 seconds).
Soliton
Site Administrator
Posts: 1680
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: "Initializing teams" and other slowness; horse graphics

Post by Soliton »

It'd probably help if you post stderr.txt after running wesnoth with --log-debug=all to figure out what is taking so long.
"If gameplay requires it, they can be made to live on Venus." -- scott
Imp
Posts: 317
Joined: January 8th, 2007, 10:56 am

Re: "Initializing teams" and other slowness; horse graphics

Post by Imp »

So what do you need, exactly? Play the first two missions with --log-debug=all and post stderr.txt? Need the save files?
Imp
Posts: 317
Joined: January 8th, 2007, 10:56 am

Re: "Initializing teams" and other slowness; horse graphics

Post by Imp »

Okay, I have attached the stderr.txt log and the save file I loaded from. I had to break up the log file into two parts to make it fit into the 50 kiB forum limit. Each part contains a separate file with half of the log.

The log covers the first turn, including AI moves. I quit the game at the start of the second turn.

More specifically, it covers me loading the game, loading the save, the "Initializing teams" slowness, me skipping the storyboard, then skipping the map character dialogue, the unusual pause before the loyal horseman and turn dialog pops up, me making a normal first turn, then the two AI moves, then my turn began and I quit normally. The ally's turn was quite quick, but there was a sizeable delay when it came to the start of the orc's turn. I moved the horseman during my first turn and the jerkiness was still noticeable.

My recall list consisted of the 6 units I recruited on the first map.
Imp
Posts: 317
Joined: January 8th, 2007, 10:56 am

Re: "Initializing teams" and other slowness; horse graphics

Post by Imp »

I fired up MP. When loading a map, it's still slow on "Initializing teams" but it's fast compared to the campaign - only about 10-20 seconds. Probably because there are no complexities like storyboards and scripting, etc.

I tried to observe some games on custom maps/mods (I have no idea - not enough info) and it seems to be no-go. It just takes ages to load - I have yet to successfully get into one - and because of the way it "freezes" (just like how it "freezes" during "Initializing teams" or slow AI turns if we click the window but goes away eventually), I can't tell whether it's just loading or downloading or what.
Imp
Posts: 317
Joined: January 8th, 2007, 10:56 am

Re: "Initializing teams" and other slowness; horse graphics

Post by Imp »

Just looking at the first half of the log, building the unit types seem to take about 2 seconds each, and there are quite a few unit types, making that part last about 20 seconds. That seems to be the "Initializing teams" part by the looks of it. I guess it takes longer as the campaign progresses because there are more unit types in play?

The pause before Haldiel appears is about 1/7th of the way down the second log. Again, it was a building unit type and then "END: apply mods (took 0ms)" is a lie because it actually takes 2 seconds because the next entry, "Adding unit 86 - Haldiel to location" starts 2 seconds afterwards, which is the noticeable delay.

I'm assuming the timestamp is when the action started and not when it completed. If it's when it completed, then the delay is caused by the next entry down from what I'm reading.

I can't see why the AI turns take some time to begin. or why they sporadically pause.

It seems like all of the transitions are rather slow:

1) Any loading where it goes through "Initializing teams", i.e. loading a saved game, starting a new campaign, transition between scenarios.
2) From storyboard to map.
3) From map to next storyboard.
4) Sometimes at the start of AI turn and then occasionally, sporadically throughout.
5) Before any in-map dialogue sequence.
6) Before in-map events like creating a new unit ("Ambushed!" in Crossroads, the goblins in DID 2nd map, Haldiel).

And then there's the horse/rider graphics looking jerky. From what I can recall, gryphon riders look fine, although I might need to check that.

So it seems to me like the biggest (but not the only) thing is when it's placing units on the map, it takes about 2 seconds per unit at the point when the logs were taken. Maybe that becomes longer as the campaign goes on or maybe, for example in Crossroads where it seems to take longer, the font for "Ambushed!" adds time to it.

However, there was also a noticeable pause in DID 2nd map when the goblins appeared and there was no dialogue. But then...the "Initializing teams" appears before the storyboard, so that doesn't explain why there's a delay between the storyboard and the map itself, since I'm assuming the map is created first and the storyboard superimposed on top of it. Nor does most of the in-map dialogue require the creation of new units. And recruiting and recalling seems normal enough even though that requires unit creation. However, it's possible that it just isn't noticeable at the time because it's part of player action.
Imp
Posts: 317
Joined: January 8th, 2007, 10:56 am

Re: "Initializing teams" and other slowness; horse graphics

Post by Imp »

Just an update.

I have installed the game on a Windows XP Home Edition (latest service pack, sp3 or something) computer running a Pentium 4 3.2 GHz. Same problems exist.

Does anybody have an idea for this issue or is it completely hopeless and the will of god?
Alink
Inactive Developer
Posts: 181
Joined: March 5th, 2007, 6:45 am
Location: Belgium

Re: "Initializing teams" and other slowness; horse graphics

Post by Alink »

Did you try with 1.7.9? Because some optimizations were done on the "Initializing teams" phase. Unit creation is cheaper now and loading should scale better with the number of units. OTOH, if you have general slowness then it's possibly a more global problem with wesnoth and your system, and that change will not help you much.

Also, it could be useful to know if your problems occurs only the first time, but are less bad the second time, where some caching may help. For example, try to reload the same case and check the difference.
Post Reply