[avoid] clarification
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.
- Spannerbag
- Posts: 759
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
[avoid] clarification
Hi,
Here's a grab of the bottom right part of the map of a scenario I'm playtesting: In the south west area of forest I randomly scatter side 7's units with this
This avoid clause is intended to force these units to stay in that lower right quadrant.
Yet one side 7 unit crossed the water and headed north (I can't see exactly what happened because these units have the
Before I start digging further, am I doing anything stupid here?
This side doesn't use any
I've used avoid terrain before, but only without wildcards as far as I can recall.
As the terrain to avoid is only 1 hex deep I'm wondering if the ai only looks at start and end hexes when considering whether to avoid somewhere and these units can cross the avoided terrain in one move (i.e. they start and end in allowed terrain even tho' they traverse terrain they should avoid)?
Any thoughts/comments greatly appreciated.
Cheers!
--Spannerbag
Here's a grab of the bottom right part of the map of a scenario I'm playtesting: In the south west area of forest I randomly scatter side 7's units with this
[avoid]
clause:
Code: Select all
side=7
no_leader=yes
controller=ai
recruit=
[ai]
aggression=0.9
caution=0.1
[avoid]
terrain=W*^*
[/avoid]
[/ai]
Yet one side 7 unit crossed the water and headed north (I can't see exactly what happened because these units have the
[ambush]
ability).Before I start digging further, am I doing anything stupid here?
This side doesn't use any
[micro_ai]
s tho' a lot of others do.I've used avoid terrain before, but only without wildcards as far as I can recall.
As the terrain to avoid is only 1 hex deep I'm wondering if the ai only looks at start and end hexes when considering whether to avoid somewhere and these units can cross the avoided terrain in one move (i.e. they start and end in allowed terrain even tho' they traverse terrain they should avoid)?
Any thoughts/comments greatly appreciated.
Cheers!
--Spannerbag
Re: [avoid] clarification
Correct, avoid is only about stopping there.
-
- Posts: 1456
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: [avoid] clarification
Spannerbag wrote: ↑July 1st, 2024, 10:28 pm (I can't see exactly what happened because these units have the[ambush]
ability).
Code: Select all
wesnoth --log-info=ai/ca/move_to_targets
Code: Select all
wesnoth --log-info=ai/ca/move_to_targets,ai/attack
Code: Select all
wesnoth --logdomains
Code: Select all
wesnoth --logdomains ai/
Code: Select all
wesnoth --log-info=ai/*
Oh, and in recent versions you can add --no-log-to-file if you want the messages to go to the console and not a file.
Speak softly, and carry Doombringer.
- Spannerbag
- Posts: 759
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [avoid] clarification
Thanks for the explanantion, very helpful.
A quick unit could traverse 7 forest hexes in one move, so one way, I guess, to prevent them crossing water is:
Code: Select all
[avoid]
terrain=W*^*
radius=3
[/avoid]
Thanks again for your help, much appreciated.
Cheers!
-- Spannerbag
- Spannerbag
- Posts: 759
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [avoid] clarification
Thanks for all the advice, hopefully I won't need to dig that deep in this case but good to know if I do.white_haired_uncle wrote: ↑July 1st, 2024, 11:55 pmWould probably show you exactly what's going on...Code: Select all
wesnoth --log-info=ai/ca/move_to_targets
Your time and trouble are much appreciated.
Cheer!
-- Spannerbag