Announcement

Collapse
No announcement yet.

Help with Aip and Fli files

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

  • Help with Aip and Fli files

    Hey...

    Well, it seems as though more people are getting into the aips and flis, so I thought that instead of this info being seen only thru emails, it would be a better idea to have it out for anyone to see.
    So, if you have any questions about these types of files, please post them here. Odds are that someone will know the answer.

    Later.

    Tom.
    Existence is Futile.

  • #2
    Well the first thing to start with would be what each of the files refers to in the AIDATA directory.
    I know that default, barbarian, scifew, scimany, milfew, milmany and slaver refer to these type of AI's but I haven't a clue what the others refer to or even what the few and many mean.

    Also I was thinking about starting up a page devoted to these files on my Uni account which I may do once this page gets going.

    Comment


    • #3
      Well, I don't think I have time right now to get into all of them, but for starters, we have the fli files.

      aiploader.fli
      has a file beside it with lots of info, but generally speaking, it's responsible for loading all the aip files--any additional aip files one creates must be included in here.
      beginturn.fli
      files have a text file as well, summarizing what it does--it's responsible for loading the appropriate fli files for each aip.
      def_personality_who...
      files I have never adjusted, don't know much about them; they seem to lay down a few default (output) setting for each aip. Wes did more work with the outputs department, so I'll leave this one.
      Ah, the 17 diplomacy files are next--my favorite, but I'll have to get back to that...gotta run here.

      Tom
      Existence is Futile.

      Comment


      • #4
        Most of what I know I learned from CD's comments texts. I then figured out other things from trial and error and careful study of the texts.
        Get CD's comments, which are in the aidata folder with the Apolyton Pack, and probably the Med mod as well. Put this together with the AAips readme, and you will have a pretty good overview of the files.
        I hesitate to say much more, because most of my work was trial and error- change something and see what happened. Half the time, it came down to "Well, this *might* help the game, and I am pretty sure it doesn't *hurt* anything, so I will keep the changes."
        I marked many of my changes with "//WW", or something similar, so you can open the AAips readme, and scroll down through the individual aidata files as you read, noting the "//", and figure out what I mean. There were some files I didn't do this, if I changed entire lines, or altered an AI-specific setting to that of another AI (I did a lot of this in the set_settle density fli). For these files you could compare the original files to mine to see the specific changes.

        Comment


        • #5
          Well, I had a slightly sillier approach: I did the trial and error first, then read some of CD's comments.

          Ah, have to get into the dip flis another time, running late right now.
          Existence is Futile.

          Comment


          • #6
            Yeah fellows, I think we've all been forced down that route. It was real nice of Activision to give us access to all these files, but it would have been even nicer if they'd given us even the slightest clue as to what was going on in them. As it is I've spent the last two months reading about Fuzzy Logic and trying to see how they've used it in CTP. Here's a very brief sketch of what I've come up with:

            What we've got here is a Fuzzy Logic Inferencing System. First, a few key definitions:

            the set of fuzzy truth values = [0,1], i.e., the set of all real numbers between (and including) 0 and 1.

            a linguistic variable is a variable that ranges over the set of fuzzy truth values.

            a membership function is a function from the set of real numbers into the set of fuzzy truth values; so given a specific real number a
            membership function will return a fuzzy truth value.

            A FLI system uses inference rules to transform inputs into outputs. By the way, Fuzzy logic includes Boolean logic so a lot of the inferencing the system performs is just standard Boolean stuff but done in a rather more complicated framework..

            Anyway, not all the inputs and outputs in the aidata files are used in fuzzy inferencing. The ones that are used are the ones that are immediately followed by one or more left, right or tri statements. These statements serve to associate a linguistic variable with that input or output and also to associate a membership function with that variable. I guess it's time for an example; consider the input:

            input distance_to_nearest_human_capitol
            tri human_capitol_ten_or_less(distance_to_nearest_huma n_capitol, 5.0, 4.5)//aiploader
            tri human_capitol_ten_to_fifteen(distance_to_nearest_h uman_capitol, 11.5, 4.0)//aiploader right human_capitol_twenty_or_more(distance_to_nearest_h uman_capitol, 20.0, 1.0)//unused


            Here there are three linguistic variables associated with the input, namely human_capitol_ten_or_less, human_capitol_ten_to_fifteen, and human_capitol_twenty_or_more. Now take human capitol_ten_or_less. It's membership function has the shape of a triangle with the vertices:

            (1,5)
            / \
            / \
            / \
            / \
            /________\
            (0,.5) (0,9.5)

            In the case of human_capitol_twenty_or_more the membership function has the shape of a right hand trapezoid:


            (0,1) (0,21)
            _______
            /
            /
            ___________/
            (0,0) (0,19)


            So, what happens is that given a specific numeric value for the input the game engine plugs this number into the above functions and then assigns the resulting fuzzy truth values to the associated variables. In aiploader, there are some inference rules in which these linguistic variables, and others, occur in the antecedents. The game engine performs some calculations (depending on fuzzy interpretations of 'and', 'or', and 'not') and passes on the resulting fuzzy truth value to the linguistic variables occuring in the consequents of the rules. These linguistic variables, which have their own membership functions, are associated with outputs and the game engine now uses this data (the fuzzy truth values of the linguistic variables and the membership functions associated with those variables) to calculate, in a not obvious way, the numeric values of the outputs. (Actually, the example I started is essentially Boolean; it's the general case where the output is associated with a string of
            linguistic variables as in:

            output production_tax[0.0, 1.0]=0.99
            tri super_zero_production_tax(production_tax, 0.001, 0.1)
            tri zero_production_tax(production_tax, 0.0, 0.00025)
            tri low_production_tax(production_tax, 0.10, 0.00025)
            tri med_production_tax(production_tax, 0.30, 0.00025)
            tri high_production_tax(production_tax, 0.50, 0.00025)
            tri super_high_production_tax(production_tax, 0.80, 0.00025)
            tri max_production_tax(production_tax, 1.0, 0.00025)

            where the calculation of the numeric output value can be rather complicated.)

            Anyway, I realize that this hardly counts as an explanation but I'm working on a proper one and as soon as I get it done I'll send it to Apolyton.

            Comment


            • #7
              Sorry about the diagrams, fellows. I see they didn't work.

              Comment


              • #8
                Good idea for a thread, Tom, I (among others) can use the help. I got one question for you now and probably a lot to come later on.

                If you have a line like output production_tax[0.0, 1.0]=0.99
                what do the 0.0 and the 1.0 stand for?
                I couldn't find any explanation on these numbers anywhere. Of course I could be overlooking something obvious...

                Locutus
                [This message has been edited by Locutus (edited April 03, 2000).]
                Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                Comment


                • #9
                  Might be the minimum and maximum values at a guess. A nice programming tricks so you can quickly change the minimum and maximum values without editing all your source code.

                  Comment


                  • #10
                    Hi Locutos, I have spent quite some time going through the aip and fli files. To answer your for eg.

                    Output production_tax [0.0, 2.0] = 1.9

                    The default value for production_tax is set to 1.9 and the [0.0, 2.0] are just ranges.

                    If you look at the tri statements usually underneath they set the true value of production_tax.

                    So a tri statment for eg.

                    tri yes_production_tax ( production_tax, 1.0 , 0.5)

                    Would set production_tax value at one.

                    So if there was a statement like this

                    if(yes_warrior and yes_settle_dense)
                    {
                    yes_production_tax
                    }

                    So if the arguments were true then production_tax is set to a value of one.

                    There you go, this is just my best guess, I am inexperienced when it comes to any kind of programming. So I could be wrong about this. If you want more information on inputs and outputs search up those two words on the forum and I came up with a really good thread I think started by Cd. Also I do believe cd did talk about this in his comments. Thanks Cya


                    ------------------
                    Gemini

                    Comment


                    • #11
                      Thanx guys, that helps a lot!
                      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                      Comment


                      • #12
                        I can see now why I went into Industrial Engineering rather than Computer Engineering. Peter, that was painful to read. I'm a junior level engineering student, and that was painful.
                        I can see that you guys are probably going to laugh your asses off when you go through my work with the AAips, because I had no idea about how that stuff worked. I did spend many hours, though, trying to get a handle on it.

                        Anyway, when you do get it straightened out, I have a few specific areas I would like for you guys to look into. These are things that would really improve the game, but that I was unable to do anything with (not surprising since most of my work was trial and error guesswork).

                        Comment


                        • #13
                          Wes, I'm not a computer expert either. My background is logic/mathematics and that's the angle I've approached this from. (So I could be wrong, but I'm pretty confident that I'm not.)

                          Anyway, as far as your other comments are concerned, I don't see how anyone could have proceeded in any other way than by trial and error. Until recently that's what I've been doing too. Apparently, this stuff is more than a little obscure. Before Christmas I met a guy who turned out to be a lecturer in Computer Science at my local university (Oxford, no less). I hastily scribbled down some left, right, and tri statements and asked him what he could tell me about them. "Looks like some sort of functions, but it's nothing I'm familiar with." So, we've been in good company.

                          As far as the fuzzy logic program is concerned, I've e-mailed you and Nordicus copies of what I've got so far but I've sort of put it one the back burner. When this API for the AI DLL comes out, hopefully there'll be some useful information in it.

                          Speaking of which, like I say I'm not a computer expert so, as I understand it, the AI DLL is what runs these files and the API (which stands for *something* programmer's interface) is the programmer's notes on how it works. Could someone who knows more about this (Skorpion59, maybe) tell us more about this and what we can expect?

                          Comment


                          • #14
                            I have a degree in computer science and I understood nothing when I first looked at the .aip and .fli files.

                            It is only when somebody made the first findings (I don't remember who it was) that I understood the basics. Then I went through a couple of web sites that talks about "fuzzy logic" and I understood a lot more.

                            If I would have an advice to anyone interested in the .aip and .fli it would be to learn more about "fuzzy logic" that should give a much more solid understanding of CTP's inner workings to anyone interested.

                            The possibilities behind the release of the AI's DLL headers are huge but the amount of work that will be involve in making an other DLL will also be probably huge and with CTP II coming I don't know if it will be worth it.

                            Comment


                            • #15
                              quote:

                              Originally posted by Daniel Frappier on 04-08-2000 11:38 AM
                              Then I went through a couple of web sites that talks about "fuzzy logic" and I understood a lot more.


                              You don't happen to have a few URL's for me, do you?

                              Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                              Comment

                              Working...
                              X