Massive slowdown in AI processing in 1.9.9.. not in 1.9.8

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
User avatar
PorkSol
Posts: 56
Joined: August 23rd, 2011, 2:10 am

Massive slowdown in AI processing in 1.9.9.. not in 1.9.8

Post by PorkSol »

There is a massive and crippling AI turn processing slowdown in 1.9.9. This is not present in 1.9.8.

I've attached a turn 3, 1.9.9 save from THoT - Invaders.

In ThoT - Invaders, there are bandits that pop out of villages when you or the AI takes the villages. In the attached save game, the AI will trigger some of these ambushes if you hit end turn a couple times.

In 1.9.9, once the Orc AIs have triggered several large packs of bandits, each Orc AI will take several minutes to think about his turns. Wesnoth will start using far more CPU than normal during this time. The cursor will turn into an hour glass and nothing will happen for a few minutes, then the AI will move a few units.

Switching back to 1.9.8, loading the same save (even though it is a 1.9.9 save), the Orc AIs will process their turns normally with no slowdown, despite triggering the same ambushes and spawning just as many bandits. The Orc AIs will start making their moves immediately, as normal.

Versions used: 1.9.9, Windows, downloaded from the front page. 1.9.8, Windows, downloaded from the front page.

Computer: Pentium 1.7Ghz, 768 mb of RAM, Windows XP service pack 3, plenty of free HD space. (Wimpy computer, but it runs scenarios much bigger than this one without anything like this kind of slowdown. I've never see the AI take anywhere near this amount of time to think about its turns).
Attachments
THoT-Invaders-Auto-Save3.gz
THoT - Invaders - Turn 3 - 1.9.9
(57.39 KiB) Downloaded 226 times
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Massive slowdown in AI processing in 1.9.9.. not in 1.9.

Post by zookeeper »

If it only happens on the orc turns, then there's the possibility that the bandit-spawning code goes into an infinite loop when an orc captures a village (which still terminates after a while since WML loops have a maximum number of iterations) due to some WML-related function having gotten broken in the engine. A WML bug sounds very unlikely since the scenario hasn't been touched in over a year.

Does anything similar happen in other scenarios?
User avatar
PorkSol
Posts: 56
Joined: August 23rd, 2011, 2:10 am

Re: Massive slowdown in AI processing in 1.9.9.. not in 1.9.

Post by PorkSol »

zookeeper wrote: Does anything similar happen in other scenarios?
Not entirely sure if it is related or not, but I do recall a similar but less reproducible and less severe issue in Delfador's Memoirs - Scenario 2: "This Valley Belongs to Me" under 1.9.9. I believe it just manifested as a turn or two slowed AI processing with the hourglass mentioned above. It was much slower than anything I'd seen under 1.9.8, but no where near as bad as in THoT - Invaders. I don't believe it showed up reliably every time like it does in Invaders either.

I've only played a few scenarios under 1.9.9. though. THoT 1 - At the East Gate, THoT 3 - Strange Allies and THoT 4 - Troll Bridge didn't have the issue.
User avatar
doofus-01
Art Director
Posts: 4128
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: Massive slowdown in AI processing in 1.9.9.. not in 1.9.

Post by doofus-01 »

For what it's worth, I've noticed this slowdown too, in several places, though I'm not sure yet that it is not WML bugs. However, it does seem to be new to 1.9.9.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
User avatar
averyimaginativename
Posts: 245
Joined: August 21st, 2010, 12:40 pm
Location: /dev/null

Re: Massive slowdown in AI processing in 1.9.9.. not in 1.9.

Post by averyimaginativename »

May or may not be related, but this appears to happen when there are no good ai moves. Mostly in UMC, but the final scenario of DiD has a similar problem if you move Mal Keshar advanced to an ancient lich, with no recruits towards an Elvish foolish hero. The delay here was only six or seven seconds per unit, but noticeably slower than other scenarios. The elves also refuse to attack (though they will attack, and the slow down doesn't happen if Mal Keshar is just a level 3 lich).
UMC Story Images web gallery

On an indefinite Wesbreak for health reasons - please only try to get my attention for UMC story images website issues.
User avatar
Crab
Inactive Developer
Posts: 200
Joined: March 18th, 2009, 9:42 pm

Re: Massive slowdown in AI processing in 1.9.9.. not in 1.9.

Post by Crab »

Thanks for the report, I'll take a look
User avatar
Crab
Inactive Developer
Posts: 200
Joined: March 18th, 2009, 9:42 pm

Re: Massive slowdown in AI processing in 1.9.9.. not in 1.9.

Post by Crab »

AI attacks involving leader were taking too long to calculate. Should be fixed by [rev]52543[/rev]
Post Reply