slow ai (v1.17): source of problem possibly located

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
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

slow ai (v1.17): source of problem possibly located

Post by Helmet »

I created a battle scenario in development version 1.17 between the player's 35 units and the ai's 20 or so units. Although the armies aren't that big, the ai was painfully slow during its turn. I'm not used to seeing the spinning beachball in Wesnoth, nor the hourglass. Wesnoth's ai has always been super-fast on my computer.

The ai would spend around 10 seconds to calculate each unit's move -- sometimes much longer than 10 seconds.

I think I discovered why, by accident. The culprit appears to be the new "gulch" tile.

When the ai was slow, the map had around a dozen gulch tiles with lava at the bottom. (They look awesome, by the way. I like the mist over the lava.)

Well, I recently replaced all the gulch+lava tiles with regular lava tiles and suddenly the ai is fast again!

I hope this observation was helpful toward stabilizing 1.17. :)

Thanks for working on this game.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: slow ai (v1.17): source of problem possibly located

Post by Helmet »

Sorry, I spoke too soon. The slow ai has returned. I guess the removal of the gulch+lava tiles was a coincidence. I have no idea why the ai was fast for a one single game and then slow again.

I'm on an M1 Mac, OS Ventura. I just checked the Activity Monitor. It said that The Battle for Wesnoth was taking 100% of the CPU.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Pentarctagon
Project Manager
Posts: 5565
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: slow ai (v1.17): source of problem possibly located

Post by Pentarctagon »

Did you get Wesnoth from Steam or from elsewhere?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: slow ai (v1.17): source of problem possibly located

Post by Helmet »

I downloaded it from the website.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Pentarctagon
Project Manager
Posts: 5565
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: slow ai (v1.17): source of problem possibly located

Post by Pentarctagon »

Huh, alright. And in the Activity Monitor under the Kind column for Wesnoth it says "Apple", right?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: slow ai (v1.17): source of problem possibly located

Post by Helmet »

Pentarctagon wrote: December 22nd, 2022, 12:30 am Huh, alright. And in the Activity Monitor under the Kind column for Wesnoth it says "Apple", right?
Yes.

See attachment.
activity monitor-crop.jpg
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Pentarctagon
Project Manager
Posts: 5565
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: slow ai (v1.17): source of problem possibly located

Post by Pentarctagon »

Can you provide an example save file where the AI is taking a long time?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: slow ai (v1.17): source of problem possibly located

Post by Helmet »

Pentarctagon wrote: December 22nd, 2022, 2:58 pm Can you provide an example save file where the AI is taking a long time?
Sure.

I'm play testing a new faction of snow golems in scenario 2. You might take a look in scenario 2 at the special powers used by certain snowgolem units to make sure that I didn't do something bad with a filter. But I didn't experience any slow-down when play testing scenario 1, and the units didn't change much from scenario 1 to scenario 2.

Good luck finding the problem.
Attachments
New_Units_17.zip
(3.55 MiB) Downloaded 29 times
NU-My Scenario 2 Turn 4.gz
(29.21 KiB) Downloaded 32 times
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Post Reply