AI village grab

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.
Post Reply
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

AI village grab

Post by Velensk »

In a scenario I'm working on, I've been trying to tweak the AI so that it will prioritize village grabbing, particuarly for it's scout units. I've tweaked the AI values for illage value and scout village targeting and tried giving them extremely high numbers however it seems like the AI always evaluates who it can attack with units before anything else. As such, although the AI does head towards villages when not close to a fray, it will still prioritize using it's scouts in the fray over village stealing.

Is there a way to effectively change this?
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
JaMiT
Inactive Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: AI village grab

Post by JaMiT »

I would guess it's because the combat CA's score is higher than the village grabbing CA's score. Take a look at [wiki]General RCA AI Howto[/wiki] and see if that explains the score well enough. If you set the village-grabbing CA's score higher than the combat CA's score, your AI should prioritize villages over combat. If you create a new village-grabbing CA for just scouts grabbing villages, your AI should still prioritize combat for non-scouts (and allow non-scouts to grab villages after combat).

Or wait until mattsc stops by (probably) with a prepackaged answer. :)


One thing to consider: sometimes combat will free up a village to grab, so grabbing villages before combat might not always be the right option. But I wouldn't worry about this at first.
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: AI village grab

Post by mattsc »

JaMiT wrote:Or wait until mattsc stops by (probably) with a prepackaged answer. :)
Nah, what you wrote is exactly what I would have said too. :)

Well, I guess, the one prepackaged thing you could use if you wanted to have scouts go for villages preferentially over attacking, but not other units, is the Goto Micro AI. Set [filter_location] to unowned village terrain and [filter] to your scouts. I haven't tested that, but I think it should work.
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: AI village grab

Post by Velensk »

If I set the village grab value to 400 and the scout village target thing to 8000 would that not be enough to convince them that it's more important to grab villages than to fight? Am I not using big enough numbers or am I going about it the wrong way?
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
JaMiT
Inactive Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: AI village grab

Post by JaMiT »

Velensk wrote:Am I not using big enough numbers or am I going about it the wrong way?
You are going about it the wrong way.
Post Reply