[avoid] nonbinding?

The place to post your WML questions and answers.

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.
kurt751
Posts: 398
Joined: June 4th, 2016, 11:17 pm

[avoid] nonbinding?

Post by kurt751 »

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:

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]
Now almost all of them do indeed respect it, but I found some Goblin Pillager who had crossed the forbidden territory. How comes? :shock:

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... :hmm:
gnombat
Posts: 1102
Joined: June 10th, 2010, 8:49 pm

Re: [avoid] nonbinding?

Post by gnombat »

Did the Goblin Pillager finish his move on one of the [avoid] locations? Or did the unit merely pass through the area?
kurt751
Posts: 398
Joined: June 4th, 2016, 11:17 pm

Re: [avoid] nonbinding?

Post by kurt751 »

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 :shock:), 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? :hmm:
User avatar
Spannerbag
Posts: 974
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [avoid] nonbinding?

Post by Spannerbag »

Are you sure the [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!
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Spannerbag
Posts: 974
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [avoid] nonbinding?

Post by Spannerbag »

kurt751 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? :hmm:
That's also possible; if there are "holes" in the [avoid]ed region the ai might find a multiturn route through...

Cheers!
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
kurt751
Posts: 398
Joined: June 4th, 2016, 11:17 pm

Re: [avoid] nonbinding?

Post by kurt751 »

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]?
Yes, first thing I checked. :)
Spannerbag 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? :)
There are 3 sides having that same [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)... :?
Spannerbag wrote: August 1st, 2026, 2:35 pm Finally, does your testing include Pillagers with the quick trait?
Good thinking. But no: I just checked, the offending unit has only "strong, resilient"...
kurt751
Posts: 398
Joined: June 4th, 2016, 11:17 pm

Re: [avoid] nonbinding?

Post by kurt751 »

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...
Except those are invisible holes... :(
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.
User avatar
Spannerbag
Posts: 974
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [avoid] nonbinding?

Post by Spannerbag »

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:

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]
Edit: also try without double quotes (shouldn't make any difference) but I can't think of many simple things to try...

Cheers!
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Spannerbag
Posts: 974
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [avoid] nonbinding?

Post by Spannerbag »

kurt751 wrote: August 1st, 2026, 3:00 pm
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...
Except those are invisible holes... :(
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.
Posted my last reply while you were posting this. :)
Sorry to be a pain but could you repost with hex coordinates (x,y values) shown - this makes referencing locations sooo much easier! :)

Cheers!
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
kurt751
Posts: 398
Joined: June 4th, 2016, 11:17 pm

Re: [avoid] nonbinding?

Post by kurt751 »

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.
:doh: :cry:

It's my 6th playthrough of this specific scenario since yesterday. It really, really starts getting on my nerves.

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?
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.

Yes, the terrain is totally static.
Spannerbag wrote: August 1st, 2026, 3:09 pm

Code: 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]
:shock: What does that cover? :?:
User avatar
Spannerbag
Posts: 974
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [avoid] nonbinding?

Post by Spannerbag »

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 pm

Code: 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]
:shock: What does that cover? :?:
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.
Like I said it's grasping at straws. :)

Cheers!
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
kurt751
Posts: 398
Joined: June 4th, 2016, 11:17 pm

Re: [avoid] nonbinding?

Post by kurt751 »

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! :)
No problem. Here you go:
AI_ExclusionZone2.jpg
I found the Goblin Pillager at 75,35. His birthing place is to the upper left.
User avatar
Spannerbag
Posts: 974
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [avoid] nonbinding?

Post by Spannerbag »

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.
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, just trying to get a picture of what's going on.

Also is the pillager always on the same side?

Cheers!
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
kurt751
Posts: 398
Joined: June 4th, 2016, 11:17 pm

Re: [avoid] nonbinding?

Post by kurt751 »

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)?
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.


Sorry, I disappeared because I just discovered another very strange (and very annoying) thing in my scenario. :shock:
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! :shock:
Where does that income come from?
And how can they possibly recruit without having a recruit list? :shock:

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? :shock:

Uuuh, I'm so deep in the rabbit hole I think I hear Chinese.
User avatar
Spannerbag
Posts: 974
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [avoid] nonbinding?

Post by Spannerbag »

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.
Thanks, that clarifies.
kurt751 wrote: August 1st, 2026, 4:21 pm Where does that income come from?
Sides have a default income in addition to whatever is set in [side].
income: additional income for this side. Default: 0. This is added to [game_config]base_income to determine the side's base income.
You need to remove 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
#enddef
Or just set income=-2
kurt751 wrote: August 1st, 2026, 4:21 pm And how can they possibly recruit without having a recruit list? :shock:
One problem at a time. :)
kurt751 wrote: August 1st, 2026, 4:21 pm Uuuh, I'm so deep in the rabbit hole I think I hear Chinese.
Know that feeling all too well!

Hopefully that resolves the income issue?

Cheers!
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
Post Reply