tuggyne's WML questions

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
tuggyne
Posts: 76
Joined: May 22nd, 2011, 5:52 am

tuggyne's WML questions

Post by tuggyne »

Edit: changed thread title accordingly
I've been trying to pass AI parameters to MP sides that can be either human or AI-controlled, but my approaches so far haven't worked reliably.
The first was something like this:

Code: Select all

        [ai]
            village_value=0.25
            aggression=0.1
            caution=1.0
            grouping=defensive
            recruitment_pattern="fighter,fighter,archer,mixed fighter"
            villages_per_scout=0.0
        [/ai]
But checking on it after the AI had had a turn or two using :debug and :inspect showed that the AI parameters were usually left at their defaults (although oddly it did work once in a while, I think?).
Then I tried the modify_ai tag:

Code: Select all

        [ai]
            [modify_ai]
                {AI_SIMPLE_ALWAYS_ASPECT village_value "0.25"}
                {AI_SIMPLE_ALWAYS_ASPECT aggression "0.1"}
                {AI_SIMPLE_ALWAYS_ASPECT caution "1.0"}
                {AI_SIMPLE_ALWAYS_ASPECT grouping "defensive"}
                {AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,fighter,archer,mixed fighter"}
                {AI_SIMPLE_ALWAYS_ASPECT villages_per_scout "0.0"}
            [/modify_ai]
        [/ai]
At first that seemed to fix it, but just now I was playtesting again and none of the AI sides had gotten their parameters at all :( .

Finally, I tried the event approach:

Code: Select all

    [event]
        name=start
        [modify_ai]
            [filter_side]
                side=1
            [/filter_side]
            {AI_SIMPLE_ALWAYS_ASPECT village_value "0.25"}
            {AI_SIMPLE_ALWAYS_ASPECT aggression "0.1"}
            {AI_SIMPLE_ALWAYS_ASPECT caution "1.0"}
            {AI_SIMPLE_ALWAYS_ASPECT grouping "defensive"}
            {AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,fighter,archer,mixed fighter"}
            {AI_SIMPLE_ALWAYS_ASPECT villages_per_scout "0.0"}
        [/modify_ai]
    [/event]
Not even that worked, so now I am quite baffled. (And rather shocked, too, since I'd assumed that if nothing else, I could at least fall back on the verbiage of event to take care of me.)

(The event was verified as firing by sticking a message in it.)

I tried searching for previous posts about this, but gave up when I realized that the forum search software filters out the term "ai" and splits tag names on underscores... :augh:
Last edited by tuggyne on June 25th, 2011, 5:13 am, edited 2 times in total.
User avatar
Pentarctagon
Project Manager
Posts: 5565
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: [ai],[modify_ai] tags seem to have trouble in MP

Post by Pentarctagon »

If you think you will be frequently posting with problems, then titling it "tuggyne's WML questions" would be a good title so you could ask all of the questions here instead of making a lot of separate threads.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
tuggyne
Posts: 76
Joined: May 22nd, 2011, 5:52 am

Re: tuggyne's WML questions

Post by tuggyne »

Comparing this to another MP scenario I made with functioning AI parameters, I wonder if the problem is simply that [side]s with allow_player=yes ignore any AI parameters they're passed -- which would, to say the least, be somewhat suboptimal!
Post Reply