[avoid] nonbinding?
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
[avoid] nonbinding?
I've several groups of orcs who are prohibited from leaving the battle and go climb a mountain instead. They all use this pretty basic AI setting:
Now almost all of them do indeed respect it, but I found some Goblin Pillager who had crossed the forbidden territory. How comes?
The Wiki states "The AI never moves a unit to these locations except for trying to move its leader to a keep or toward [leader_goal]s, and thus applies to all CAs except move-leader-to-goals and move-leader-to-keep."
While there is indeed a keep (and some villages) on top of that mountain, that Goblin Pillager was a bog-standard recruited unit, not a leader in search of a keep, and yet there he was...
Code: Select all
[ai]
aggression=0.8
caution=0.2
village_value=0
[avoid]
x="63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84"
y="32-34,31-33,31-34,30-34,30-34,29-34,29-35,28-37,28-38,28-37,28-38,27-38,27-40,27-40,28-40,27-39,28-39,28-38,29-38,30-37,31-37,34-36"
[/avoid]
[/ai]
The Wiki states "The AI never moves a unit to these locations except for trying to move its leader to a keep or toward [leader_goal]s, and thus applies to all CAs except move-leader-to-goals and move-leader-to-keep."
While there is indeed a keep (and some villages) on top of that mountain, that Goblin Pillager was a bog-standard recruited unit, not a leader in search of a keep, and yet there he was...
Re: [avoid] nonbinding?
Did the Goblin Pillager finish his move on one of the
[avoid] locations? Or did the unit merely pass through the area?Re: [avoid] nonbinding?
I don't know for sure, but to get where he was he had to cross the forbidden area, it's the only way. And the area is big. Even disregarding the mountains (frozen or not), it's over 9 hexes to cross. He had to make a stop in the forbidden area. That's why I wonder.
--Edited to add:
Confirmed: Second playthrough, saving each turn, then removing shroud and fog, and in one save I see a Goblin Pillager sitting smack in the middle of the forbidden zone. He did enter, and he did end his movement there.
It's always a Goblin Pillager, so it must have something to do with speed (as for some strange reason they don't seem to be slowed down by frozen mountains
), but there is only one, so it must be a special, rare occurrence.
Unless the selection tool is totally broken (it already wasted 3 days of work for me) and leaves invisible holes in that exclusion area?
Holes a Goblin Pillager might use to "jump" through?
--Edited to add:
Confirmed: Second playthrough, saving each turn, then removing shroud and fog, and in one save I see a Goblin Pillager sitting smack in the middle of the forbidden zone. He did enter, and he did end his movement there.
It's always a Goblin Pillager, so it must have something to do with speed (as for some strange reason they don't seem to be slowed down by frozen mountains
Unless the selection tool is totally broken (it already wasted 3 days of work for me) and leaves invisible holes in that exclusion area?
Holes a Goblin Pillager might use to "jump" through?
- Spannerbag
- Posts: 974
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [avoid] nonbinding?
Are you sure the
Is the Pillager on the same side as the
Also, I think a side can only have one
Finally, does your testing include Pillagers with the
Cheers!
[avoid] applies to the Pillager?Is the Pillager on the same side as the
[avoid]?Also, I think a side can only have one
[avoid] in force at any time, so if you have several [avoid]s it might be worth doing a quick sanity check? Finally, does your testing include Pillagers with the
quick trait?Cheers!
- Spannerbag
- Posts: 974
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [avoid] nonbinding?
That's also possible; if there are "holes" in thekurt751 wrote: August 1st, 2026, 12:17 pm ...Unless the selection tool is totally broken (it already wasted 3 days of work for me) and leaves invisible holes in that exclusion area?
Holes a Goblin Pillager might use to "jump" through?![]()
[avoid]ed region the ai might find a multiturn route through...Cheers!
Re: [avoid] nonbinding?
Yes, first thing I checked.Spannerbag wrote: August 1st, 2026, 2:35 pm Are you sure the[avoid]applies to the Pillager?
Is the Pillager on the same side as the[avoid]?
There are 3 sides having that sameSpannerbag wrote: August 1st, 2026, 2:35 pm Also, I think a side can only have one[avoid]in force at any time, so if you have several[avoid]s it might be worth doing a quick sanity check?
[avoid], but no side has more than that specific [avoid] (in force or otherwise).In other words: Several sides with the same
[avoid], no other [avoid]s in the scenario.Besides it clearly works, since I see units piling at the border of the zone.
Except for that lone Goblin Pillager who slips in somewhere around turn 20-some (no, nothing special happens at that time)...
Good thinking. But no: I just checked, the offending unit has only "strong, resilient"...Spannerbag wrote: August 1st, 2026, 2:35 pm Finally, does your testing include Pillagers with thequicktrait?
Re: [avoid] nonbinding?
Except those are invisible holes...Spannerbag wrote: August 1st, 2026, 2:43 pm That's also possible; if there are "holes" in the[avoid]ed region the ai might find a multiturn route through...
Here is what that selection area (created initially in the editor as a time zone) looks like in the editor: The orcs come from the upper left, there is a "deep water" river separating the map (bottom of the pic), so they can't come from the south.
The offending unit was on the mountain hex 2 hexes below the keep hex. In the next turn it had crossed the bridge on the bottom and was capturing villages.
- Spannerbag
- Posts: 974
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [avoid] nonbinding?
Hmm... the only easy(ish) thing I can think of is to undroid an ai side then as player highlight reachable hexes for a pillager on the edge of the avoided area to show how far a pillager could penetrate the avoided area and see if there's anything suspect within that region.
Does this always happen after a certain number of turns?
I assume that terrain is static in this scenario?
You could also check the logs (once the pillager has done its thing) tho' I doubt there'll be anything there...
Clutching at straws here but you could try:
Edit: also try without double quotes (shouldn't make any difference) but I can't think of many simple things to try...
Cheers!
Does this always happen after a certain number of turns?
I assume that terrain is static in this scenario?
You could also check the logs (once the pillager has done its thing) tho' I doubt there'll be anything there...
Clutching at straws here but you could try:
Code: Select all
[ai]
aggression=0.8
caution=0.2
village_value=0
[avoid]
x="63-63, 64-64, 65-65, 66-66, 67-67, 68-68, 69-69, 70-70, 71-71, 72-72, 73-73, 74-74, 75-75, 76-76, 77-77, 78-78, 79-79, 80-80, 81-81, 82-82, 83-83, 84-84"
y="32-34, 31-33, 31-34, 30-34, 30-34, 29-34, 29-35, 28-37, 28-38, 28-37, 28-38, 27-38, 27-40, 27-40, 28-40, 27-39, 28-39, 28-38, 29-38, 30-37, 31-37, 34-36"
[/avoid]
[/ai]Cheers!
- Spannerbag
- Posts: 974
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [avoid] nonbinding?
Posted my last reply while you were posting this.kurt751 wrote: August 1st, 2026, 3:00 pmExcept those are invisible holes...Spannerbag wrote: August 1st, 2026, 2:43 pm That's also possible; if there are "holes" in the[avoid]ed region the ai might find a multiturn route through...![]()
Here is what that selection area (created initially in the editor as a time zone) looks like in the editor:
AI_ExclusionZone.jpg
The orcs come from the upper left, there is a "deep water" river separating the map (bottom of the pic), so they can't come from the south.
The offending unit was on the mountain hex 2 hexes below the keep hex. In the next turn it had crossed the bridge on the bottom and was capturing villages.
Sorry to be a pain but could you repost with hex coordinates (x,y values) shown - this makes referencing locations sooo much easier!
Cheers!
Re: [avoid] nonbinding?
Spannerbag wrote: August 1st, 2026, 3:09 pm Hmm... the only easy(ish) thing I can think of is to undroid an ai side then as player highlight reachable hexes for a pillager on the edge of the avoided area to show how far a pillager could penetrate the avoided area and see if there's anything suspect within that region.
It's my 6th playthrough of this specific scenario since yesterday. It really, really starts getting on my nerves.
Well, at least in 2 playthroughs it was about the same time. But as I said nothing special happens at that time, so I think it's a coincidence: The AI always chases my leaders, and as my leaders advance, at some point the shortest route to them is through that exclusion zone.Spannerbag wrote: August 1st, 2026, 3:09 pm Does this always happen after a certain number of turns?
I assume that terrain is static in this scenario?
Yes, the terrain is totally static.
Spannerbag wrote: August 1st, 2026, 3:09 pmCode: Select all
[avoid] x="63-63, 64-64, 65-65, 66-66, 67-67, 68-68, 69-69, 70-70, 71-71, 72-72, 73-73, 74-74, 75-75, 76-76, 77-77, 78-78, 79-79, 80-80, 81-81, 82-82, 83-83, 84-84" y="32-34, 31-33, 31-34, 30-34, 30-34, 29-34, 29-35, 28-37, 28-38, 28-37, 28-38, 27-38, 27-40, 27-40, 28-40, 27-39, 28-39, 28-38, 29-38, 30-37, 31-37, 34-36" [/avoid]
- Spannerbag
- Posts: 974
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [avoid] nonbinding?
It just makes both elements ranges, in earlier versions of BfW I did sometimes have problems with lists of ranges where one was a proper range and the other an integer.kurt751 wrote: August 1st, 2026, 3:22 pm burnt sausage on bbq fork) - or should that be fire?Spannerbag wrote: August 1st, 2026, 3:09 pmCode: Select all
[avoid] x="63-63, 64-64, 65-65, 66-66, 67-67, 68-68, 69-69, 70-70, 71-71, 72-72, 73-73, 74-74, 75-75, 76-76, 77-77, 78-78, 79-79, 80-80, 81-81, 82-82, 83-83, 84-84" y="32-34, 31-33, 31-34, 30-34, 30-34, 29-34, 29-35, 28-37, 28-38, 28-37, 28-38, 27-38, 27-40, 27-40, 28-40, 27-39, 28-39, 28-38, 29-38, 30-37, 31-37, 34-36" [/avoid]What does that cover?
![]()
Like I said it's grasping at straws.
Cheers!
Re: [avoid] nonbinding?
No problem. Here you go: I found the Goblin Pillager at 75,35. His birthing place is to the upper left.Spannerbag wrote: August 1st, 2026, 3:15 pm Sorry to be a pain but could you repost with hex coordinates (x,y values) shown - this makes referencing locations sooo much easier!![]()
- Spannerbag
- Posts: 974
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [avoid] nonbinding?
Thanks - are these units recruited or spawned on map?kurt751 wrote: August 1st, 2026, 3:28 pm No problem. Here you go:
AI_ExclusionZone2.jpg
I found the Goblin Pillager at 75,35. His birthing place is to the upper left.
Where was the pillager on the previous turn (i.e. did it move from or where was it created)?
Sorry, just trying to get a picture of what's going on.
Also is the pillager always on the same side?
Cheers!
Re: [avoid] nonbinding?
Recruited, the classical way. As I said his birthing place (i.e. the castle he was recruited in) is to the upper left of the picture.Spannerbag wrote: August 1st, 2026, 3:41 pm Thanks - are these units recruited or spawned on map?
Where was the pillager on the previous turn (i.e. did it move from or where was it created)?
Sorry, I disappeared because I just discovered another very strange (and very annoying) thing in my scenario.
A couple sides are supposed to be "dormant", i.e. they have gold=0, income=0, village_gold=0, village_support=0, and no recruit list. They are supposed to get all that later, after a trigger "wakes" them, giving them an income and recruit lists.
Now while un-shrouding all my turn end saves, I spotted one of those sides without a recruit list actually recruiting a unit! I checked the status table, and it tells me it that all those dormant, income-less sides have actually an income of 2!
Where does that income come from?
And how can they possibly recruit without having a recruit list?
For the record, they get set "income=4, village_gold=4" and a recruit list by (respectively) a last breath and a sighted event, none of which had happened at that point. That income of 2 doesn't fit anywhere. Welfare?
Uuuh, I'm so deep in the rabbit hole I think I hear Chinese.
- Spannerbag
- Posts: 974
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [avoid] nonbinding?
Thanks, that clarifies.kurt751 wrote: August 1st, 2026, 4:21 pm Recruited, the classical way. As I said his birthing place (i.e. the castle he was recruited in) is to the upper left of the picture.
Sides have a default income in addition to whatever is set in
[side].
You need to removeincome: additional income for this side. Default: 0. This is added to[game_config]base_income to determine the side's base income.
income=0 and use {NO_INCOME} instead.
Code: Select all
#define NO_INCOME
# Used to specify when a side should not have any income
# every turn.
income=-2
#enddefincome=-2One problem at a time.kurt751 wrote: August 1st, 2026, 4:21 pm And how can they possibly recruit without having a recruit list?![]()
Know that feeling all too well!kurt751 wrote: August 1st, 2026, 4:21 pm Uuuh, I'm so deep in the rabbit hole I think I hear Chinese.
Hopefully that resolves the income issue?
Cheers!