Announcement

Collapse
No announcement yet.

Diplomacy AI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Diplomacy AI

    Is anyone still looking at this?

    I have looked over the diplo files quite a bit, and all is becoming clear now.. there definitely seem to be a few things that need changing, and quite a few complaints floating around the forums.

    If nobody is working on them, I may start messing around this weekend.

    Comments?

  • #2
    All I'd like to see initially is some grovelling by countries about to get there butts kicked. Some should curse you till the death, but some should be willing to give you anything as long as it keeps them alive.



    ------------------
    Light the fuse!

    Comment


    • #3
      And when they hate you it should be for a reason (again on some of them). I realize that some will hate you/me becuse we're powerful, but other should hate me because I wiped out their capitol or other good reason.

      Haggleing over price on a traded good would be nice, too, if you can figure out how to make the AI haggle.

      Is there a way to use SLIC to add options to give or demand a unit/advance/trade consession/city?

      I don't ask much, do I?
      Respectfully,

      Big Dave
      Any flames in this message are solely in the mind of the reader.

      Comment


      • #4
        Simpson, Slax, & Big Dave:
        You bet yer butts! Inbetween doing other things, I've been through those diplomacy files--and it would be way cool if someone could do some testing. I've had some success with improving the AI civs' opinions of me in my games, specifically regarding their reactions to things I give them. Having a civ want to cut my head off when I've done nothing but say 'hi,' give them 500 gold, and offer to trade maps...is absurd, esp. when that civ is equal in power to me. I changed how AIs react in general to advance gifts, gold gifts, and general trading (depending on their personalities: there's just no pleasing some people, as you may know)...and I've had some success. As far as attempting to make them stop their ceaseless wandering on my property and trying to make them (if allied) attack a common enemy, well, I've done a lot of tweaking but very little testing yet. So, if anyone wants more info, let me know--and if anyone wants to test some of this more extensively, that would be excellent.

        N.

        (Post Script: Big Dave:
        you do ask a lot! Seriously, I don't know about haggling, but I've tried (not very hard) to 'in'-comment some of the out-commented SLIC regarding trading cities, thinking that it would add a novel and more realistic diplomatic dimension to the game, but for all my slight work I received only 'ERROR' statements after the game crashed. But like I said, I didn't try that hard and didn't check everything, so (and I still think so) it is possible. I don't have the time right now, but if someone else does (want to experiment with the dimplomacy, dip_str, etc., files regarding this), let me know whatcha find out.)
        Existence is Futile.

        Comment


        • #5
          Slax & Big Dave; Heh heh, grovelling is easy to add!
          As for the rest.. I think that it may be possible to extend the thing using SLIC, but only the programmers seem to know how, and there isn't - so far as I know- a way to alter the diplomavy interface. Probably SLIC could not handle trade, either.

          Nordicus; Sounds great! I would love to know more & try it out.. Maybe make a few humble suggestions myself

          IMHO, some things need changing immediately.. I don't know if you noticed, but the section which is meant to make the AI hate you if you attack its' friends actually uses the if_(so many times)_attacked_my_enemies flag! Big bummer with alliances.. They demand you attack an enemy. If you don't, they hate you for refusing a demand; if you do, they hate you anyway. That got the indonesians wiped out in my last game .
          Never mind the section which says (paraphrased) ' if you are stronger than someone and militaristic and hate them, *give them your maps*'.

          Anyhow, enough ranting. Post soon,


          Simpson

          Comment


          • #6
            Simpson:
            Hey.
            For more realistic (or customized) reations, go to (default, yadda-yadda) aidata, then diplomacy_accepted. I changed "like" to "love" in many instances, and "love" to "worship" in others. Too many changes to mention in diplomacy_begin. I also did similar changes in diplomacy_pre_incoming, diplomacy_pre_outgoing, and diplomacy_rejected. In addition, I tampered with dip_str (changing dozens of things, including expanding and changing many of the words and phrases that the AI uses). If you want copies of any of these (for I'd really like someone to do more testing than I've been able to do), please let me know.
            Thanks.

            N.
            Existence is Futile.

            Comment


            • #7
              Hey, I'll give it a shot!

              ------------------

              Comment


              • #8
                Sounds interesting. However, be careful not to let a human abuse the AI - it could become too easy to milk it every other turn for cash (Already is, IMHO). But I'd love to give it a shot - send it to jmoughan@hotmail.com. Cheers!

                Comment


                • #9
                  What is the language that the flis and aips are written in? Can anyone post any links to sites that explain this language?

                  I have resurrected the Dutchesse thread, and posted a bunch of questions about his changes. I sent him an e-mail Monday night asking for help with this, but I haven't received any kind of answer as yet (Wed. afternoon). If anyone could look over my questions and help me out, I would really appreciate it.

                  Comment


                  • #10
                    WesW: As far as I know, the flis and Aips are not written in a recognised language as such, it appears to be something that the programmers just made up one afternoon . I'll try to give my interpretation, but realise that I may be completely wrong.

                    First of all values are inputed from the game engine. This is done using the input command (surprise!), eg input chase_the_rabbit (if anyone knows what this does, I would love to know). Next, these are used to set some boolean (true or false) values.

                    e.g.,

                    input how_often_has_he_attacked_me
                    tri never_attacked( how_often_has_he_attacked_me, 0, 0.1)
                    tri attacked_me(how_often_has_he_attacked_me, 2, 1)
                    right often_attacked_me(how_often_has_he_attacked_me, 4, 1)

                    Note I don't have the files in front of me, so I just made that one up.
                    The tri statements define whether each of never_attacked etc. are true. In the first instance, never_attacked_me is true if the person the AI is dealing with has attacked 0 +/- 0.1 times, i.e never. Note that attacked_me could be replaced with im_on_holiday, or any other string, it's the how_often_has_he_attacked_me which is important.
                    The right statement is a bit different - so far as I understand, this sets often_attacked_me to true if how_often_has_he_attacked_me has a value greater than 4, independent of the second number.

                    Next the files can output values to the game engine. For example,

                    output unit_regard[-80,80] = 0.0
                    tri hot_war(unit_regard,-50,1)
                    tri cold_war(unit_regard, -10,1)
                    tri peace(unit_regard, 0, 1)
                    tri alliance(unit_regard, 50, 1)

                    again this is made up, but unit_regard is a real output, and the AI will actively target the person if unit_regard is less than -20.
                    The way this is used is that the flis will include the terms hot_war, cold_war etc. in some places, and the engine sets its unit regard variable to the first figure in the tri statement. The second one is again (I think) irrelevant.

                    Ok so now we put the together. For example

                    if (never_attacked)
                    { peace }

                    if ((attacked_me or often_attacked_me))
                    { hot_war }

                    Then, if you never attack the AI, it will never attack you; If you attack you, it will always attack you, regardless of wat you do. Very nice

                    I think that there are also outputs that shift a value by a certain amount, but I'm not sure of this. Also some complexities - values like how_often_has_he_attacked_me can be made to decay, check input_responses.fli for details. Sorry if this is all basic beginner stuff, it's as far as I've gotten! (ps much credit here to Mr. Babbage - see his primer some time ago)

                    As for your questions in the 'Dutcheese thread',

                    1)When you changed this line:
                    was--double attack_troops_priority = 405000.0;
                    is-- double attack_troops_priority = 16000000.0;
                    How would that differ from changing the Strike Troops Primary number in the
                    build lists?

                    - strike troops primary is different from strike troops core.. I'm not too familiar with the aips, but I think that that will make the AI build more troops all the time, not just after it has built a silo or whatever. Actually I would expect such a huge change to muck things up severely, but..

                    3)You increased the cause unhappiness and franchise priorities. Will this cause
                    more special attacks by the AI?

                    Pretty much by definition, I think. My experience is consistent with higher numbers here meaning the AI does it more. Francjise is already one of (the?) highest, I think. It certainly seems to be what the AI most want to do in life.

                    6)And this?
                    was--int captured_city_defend_turns = 3;
                    is-- int captured_city_defend_turns = 5;

                    I'm theorising that this means the AI will heavily defend a city for longer after it captures it - I don't know whether this is good because they will be harder to take back or bad because it will stunt an advance.. However, the AI has never taken one of my cities (modest cough) so I don't really know how it behaves

                    7)By setting this so high, does this leave the AI with any spare units to shift to
                    attack or strengthen a defense?
                    was--int num_city_defenders = 1;
                    is-- int num_city_defenders = 3;

                    It depends on how many it is set to build elsewhere in the flis. The AI can be set to build more troops per city, but it would drain its' resources.

                    9)In the assault troops core [max element] you have added the negative sign to
                    a couple of units. What does this do?
                    "UNIT_WARRIOR", 1.0;
                    "UNIT_SAMURAI", 0.5;
                    "UNIT_KNIGHT", 0.5;
                    "UNIT_MUSKETEERS", -2.0;
                    "UNIT_BATTLEBOT", -2.0;
                    "UNIT_SPACE_MARINES", -2.0;

                    Totally ripping off CDs' comments here, a negative number means only build this many at a time : a positive number means built this many for each city in the empire. The negatives will make the AI turn out an endless trickle of these units, like it does with lawers.

                    12)Also these changes- what do they do? Are they part of your end game
                    project fix?
                    double Miscellaneous_List_Threshhold = 0.2; // equals 1 - best_rank
                    //changed from 0.0 mc 1 aug
                    double End_Game_Object_List_Threshhold = 0.8; // equals 1 - best_rank
                    0.0; //CHANGED FROM 0.0 MC 1 AUG

                    This will mean that the AI has to have a really good reason before embarking on the end-game facilities.. actually I don't think it will make a difference, since the AI prioritises them so highly, but still.


                    I hope all of this is some help, and that I don't lead you too far astray with my babbling,

                    Simpson
                    [This message has been edited by Simpson (edited October 22, 1999).]

                    Comment


                    • #11
                      Thanks, Bart.
                      Your answers confirmed my suspicions about those topics. One thing, though, I think you got confused about my first question. The setting for "attack troops priority" is from the default aip only, I believe. Later down, you find "strike troops primary", and still later "assault troops core". If you could look at this again, I would appreciate it.

                      Also, what would you say this code block from the outputs fli does?

                      output pop_production_max[-1000,10000] = 110.0
                      tri low_pop_production_max (pop_production_max, 100, 100.0)
                      tri med_pop_production_max (pop_production_max, 450, 100.0)
                      tri high_pop_production_max (pop_production_max, 900, 100.0)

                      output pop_production_min[0,2000] = 110.0
                      tri super_low_pop_production_min (pop_production_min, 10, 100.0)
                      tri low_pop_production_min (pop_production_min, 50, 10.0)
                      tri med_pop_production_min (pop_production_min, 110, 10.0)
                      tri high_pop_production_min (pop_production_min, 200, 10.0)

                      CD thought that the first number in each line set the bonus applied to the production available on a terrain square. (i.e. for high pop production min, it would be doubled (200), while for low pop production min it would be halved (50).) This would then be used to determine where to place workers on the terrain tiles. (Those with the highest total would be used.)

                      However, look at the block regarding food:

                      output pop_food_max[0,1000] = 100.0
                      tri super_low_pop_food_max (pop_food_max, 10.0, 10.0)
                      tri low_pop_food_max (pop_food_max, 50.0, 10.0)
                      tri med_pop_food_max (pop_food_max, 100.0, 10.0)
                      tri high_pop_food_max (pop_food_max, 200.0, 10.0)
                      tri odd_pop_food_max (pop_food_max, 113.0, 100.0) // force people to move

                      output pop_food_min[0,1000] = 10.0
                      tri low_pop_food_min (pop_food_min, 10.0, 10.0)
                      tri med_pop_food_min (pop_food_min, 100.0, 10.0)
                      tri high_pop_food_min (pop_food_min, 200.0, 10.0)
                      tri odd_pop_food_min (pop_food_min, 113.0, 10.0) // force people to move

                      Except for the lowest settings, they are exactly the same. These settings are specified in the set resource desire and set food or production flis. If you could explain this too me, it would be an emormous help.

                      Comment


                      • #12
                        Wes - Yes, I was totally wrong about the attack_troops_priority flag. It's one of the 'net utility functions', isn't it? Of course it must mean the priority assigned to attacking someone elses troops - in which case it might make sense to raise it, the AI can be quite passive. Play-testing would be the thing.

                        As to the output.fli code - heh, you certainly threw a hard one at me! I've looked at it before and wondered. I think the key thing here is that pop_food_min is not the same as pop_food_max - so these two outputs do set diferent things, it isn't a straightforward priority. If you look at the usage, you find things like

                        high_pop_food_min
                        high_pop_food_max // This says, in all cities get food

                        Now, being (overly?) subtle about the wording, note the *all* part. In other sections you might have

                        med_pop_produciton_max
                        low_pop_production_min

                        or

                        very high_pop_production_max

                        on its' own. This is interesting. what I am hypothesising is that the min/max values actually define a range of priorities from which the AI selects (at random?).
                        Thus, high/high means a value between the high-max and high-min values - which for food means precisely 200. med/low means select a value in each city between med and low. very looks like it means home the value in precisely on the outputed value - used for production but not food because for production, high/high would still leave a range between 200 and 900.

                        I think the placings fit here - high/high food is used when you have one city, and can't afford a random value to muck things up. Very high_pop_production_max is used for the alien endgame, where the same applies.

                        This actually has a certain elegance about it - get your people first, then build things quicker. Or build growth building asap, then grow fast. Sounds doubtful, though. Call me a cynic, but did the programmers take the fuzzy logic textbooks too seriously? I don't know much about the subject, but this does sound like it - not being precise, leaving possibilites open.

                        Again, all of this is just guesswork - but it fits quite well, I believe. Some testing might reveal more - see if the AI does really vary things. Hmm..

                        Anyhow, hope this helps Crusher
                        [This message has been edited by Simpson (edited October 24, 1999).]

                        Comment


                        • #13
                          The diplomacy values on each of the sides are higher then the original
                          YEAH! REJOICE!! Since South Africa was given the black rule by the jews, 3% of white population has been slaughtered by the down trodden race.

                          Comment


                          • #14
                            What exactly do you mean, Joe?

                            Comment

                            Working...
                            X