How to force AI with no leader to play defensively
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.
How to force AI with no leader to play defensively
I'm designing a multiplayer scenario, and it includes some neutral monsters. I would like the monsters to stay near their points of origin, attack anyone who wanders too close to their start point, and perhaps occupy the occasional nearby village. Instead, the monsters all immediately charge toward the human players' units, very aggressively. I don't notice any difference at all in the ai's behavior no matter how I set the "aggression" and "caution" values. I don't think I want to use the micro_ai because there are about 20 neutral monsters and I'd like all of them to follow essentially the same behavior.
I figure I must be doing something completely wrong and that my code is just failing to update the ai's instructions. I've read the standard guide on RCA AI and modifying AI components, but I don't yet see where I'm messing up. The relevant part of my scenario CFG file is below, along with a couple of example units -- does anyone have any suggestions? (Thank you!)
I figure I must be doing something completely wrong and that my code is just failing to update the ai's instructions. I've read the standard guide on RCA AI and modifying AI components, but I don't yet see where I'm messing up. The relevant part of my scenario CFG file is below, along with a couple of example units -- does anyone have any suggestions? (Thank you!)
Code: Select all
[multiplayer]
[side]
side=7
team_name=2
controller="ai"
allow_player=no
fog=no
gold=0
hidden=no
income=0
no_leader=yes
share_vision="none"
shroud=no
faction=Custom
[ai]
aggression=0.01
caution=0.99
grouping = defensive
[goal]
name=protect_location
[criteria]
x,y=42,5
[/criteria]
protect_radius=5
value=1
[/goal]
[/ai]
[unit]
facing="n"
type="Cuttle Fish"
x=46
y=1
[/unit]
[unit]
facing="s"
type="Giant Spider"
x=53
y=6
[/unit]
[/side]
[/multiplayer]
Re: How to force AI with no leader to play defensively
add leader_value=0.0 to the [ai] block. This might not work on wesnoth 1.15 or with experimental ai.
Re: How to force AI with no leader to play defensively
Works great! Thank you.
- lhybrideur
- Posts: 369
- Joined: July 9th, 2019, 1:46 pm
Re: How to force AI with no leader to play defensively
You can also use ai_special=guardian in the [unit] tag