AI passive when surrounded


Moderators: Forum Moderators, Developers

Forum rules

AI passive when surrounded

Postby doofus-01 » December 7th, 2013, 7:13 pm


An example:



Reported in Gna:
User avatar
Art Contributor
Posts: 2906
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: AI passive when surrounded

Postby mattsc » December 8th, 2013, 12:58 am

Wow, this is a good one. Apparently, it has been around since the RCA AI was introduced in Wesnoth 1.7. Well, I don't actually know that for sure, but I tested it with Wesnoth 1.8.4 in an MP game where you can choose between the old default AI and the RCA AI (which is now the default). The bug occurs with the RCA AI, but not with the old default AI.

This should be fixed in commit e7f17412378bd81d2c89c0f391d97894c2cc80d2 and should work correctly in Wesnoth 1.11.8.

And for those interested in the underlying reason, the attack rating contains a multiplicative factor "support", which is (roughly speaking) the "power" other AI units can provide to help the attacking AI unit. For a surrounded unit, no other AI unit can get there, support is zero, and thus the attack rating is zero. This meant that the unit never attacked (attack rating >0 is required for that). I changed that by only multiplying by support if the unit is not surrounded (there are already some other exceptions when it's also not done).
UMC Pioneer
Posts: 806
Joined: October 13th, 2010, 6:14 pm
Location: Canada

Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests