Question: Can The AI Be Manipulated?
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.
Question: Can The AI Be Manipulated?
I would like to know if you can set certain parameters for the ai, for example can I make it more aggressive or more defensive? Also it it possible to tell it to split its troops to attack two different points on the map and maybe define a ratio of fighters, scouts and archers that will be sent to each location?
I have tried a search but I couldn't see anything useful.
Thanks in advance!
I have tried a search but I couldn't see anything useful.
Thanks in advance!
Continuing Siege of Soradoc
Re: Question: Can The AI Be Manipulated?
All that and more can be yours for two easy payments of $19.99!
But wait if you call within the next ten minutes, because we can't do this all day, we'll throw in Formula AI Functions List for free!
If whoever wrote FAI were german this joke would be a million times funnier.
But wait if you call within the next ten minutes, because we can't do this all day, we'll throw in Formula AI Functions List for free!
If whoever wrote FAI were german this joke would be a million times funnier.
-
- Retired Developer
- Posts: 1086
- Joined: September 16th, 2005, 5:44 am
- Location: Hamburg, Germany
Re: Question: Can The AI Be Manipulated?
I think this is more like what the OP had in mind: http://wiki.wesnoth.org/AiWML
There are a couple of tricks you can try. It will be difficult (if not impossible) to control things like splitting into two forces, those switches rather control the general behaviour of the AI. I am also not sure, how rigorously they have been tested. You might find that certain tags don't have the influence you expect from them (and sometimes it is difficult to find meaningful ranges for certain parameters).
Hope that helps you get along.
There are a couple of tricks you can try. It will be difficult (if not impossible) to control things like splitting into two forces, those switches rather control the general behaviour of the AI. I am also not sure, how rigorously they have been tested. You might find that certain tags don't have the influence you expect from them (and sometimes it is difficult to find meaningful ranges for certain parameters).
Hope that helps you get along.
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
Re: Question: Can The AI Be Manipulated?
Thanks both of your for your posts. Would I be able to apply these tags to the different ai leaders. For example to make one really defensive and the other really offensive?
Thanks in advance
Thanks in advance
Continuing Siege of Soradoc
Re: Question: Can The AI Be Manipulated?
The [ai] tag goes inside of [side], so unless your question is asking for multiple leaders on the same side, then yes.
Re: Question: Can The AI Be Manipulated?
Thank you again Gambit. Another question I have is can I force the ai to send its units along a preset route?
Thanks in advance
Thanks in advance
Continuing Siege of Soradoc
Re: Question: Can The AI Be Manipulated?
By storing the units you want to move and then looping through them and setting
stored_unit[$i].goto_x="24"
and
stored_unit[$i].goto_y="25"
You could make them go to point 24, 25. Then when they get there you'd store them again and set the next waypoint. But goto_x and goto_y are kinda buggy. They tend to forget their behaviour if you don't remind them every krifing turn.
You could also try move_unit_fake. I can't explain it because I've never used it, so maybe someone else can chime in. It's probably the easiest way, I just don't know much about it.
Or you could try the formula AI.
stored_unit[$i].goto_x="24"
and
stored_unit[$i].goto_y="25"
You could make them go to point 24, 25. Then when they get there you'd store them again and set the next waypoint. But goto_x and goto_y are kinda buggy. They tend to forget their behaviour if you don't remind them every krifing turn.
You could also try move_unit_fake. I can't explain it because I've never used it, so maybe someone else can chime in. It's probably the easiest way, I just don't know much about it.
Or you could try the formula AI.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Question: Can The AI Be Manipulated?
This is a current bug being worked on by Crab. It's intended to be kept until the destinations are reached (It does for a human player if no new commands are given).Gambit wrote:But goto_x and goto_y are kinda buggy. They tend to forget their behaviour if you don't remind them every krifing turn.
I don't see how move_unit_fake could be helpful here.You could also try move_unit_fake. I can't explain it because I've never used it, so maybe someone else can chime in. It's probably the easiest way, I just don't know much about it.
Formula ai is cryptic for me.
You can also try "ai herding". Basically, you would create a unit of type=lure at the destination position which is only there during the ai's turn and set a very high [target]type=lure.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Question: Can The AI Be Manipulated?
Ok, thank you. What I am trying to do is create a tower defense scenario for my campaign but I am starting to see that it is going to be quite hard!
Continuing Siege of Soradoc