Announcement

Collapse
No announcement yet.

Help with Aip and Fli files

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

  • #16
    This is simplified to make it easier to understand. The DLL's are an extension to the executable. Instead of having a 6 million line straight top-to-bottom, go-to executable, the code is broken up into segments. Each segment (DLL) is capable of 'calling' (executing) other segments (EXE, DLL's) directly. The main executable is basically the controlling program that starts the whole process. The API (Advanced Programmers Interface) is simply a pre-made interface that was created to make it easier to access low-level functions. For example, say you want to write a file to disk. You simply call the 'WriteFile' API and pass it the information on the file you want written. Without API's, you would have to access the low-level (assembler) functions required to write a file. This would include allocating handles, allocating disk space, moving the memory contents, writing the file, moving file pointer, etc, etc. It actually gets very complicated. API's give you one, easy function to call which handles all the dirty work for you (talking to the operating system). Another example would be opening a new window. You simpy call an 'OpenNewWindow' API in your program. The API does the dirty work of telling the operating system HOW to open the new window. This is comparable to the old days of calling DOS INT functions. It just does the dirty work for you.

    Daniel is right. The AI API's *could* be very valuable in modifying the AI behavior, depending on what API's they release. The problem is, the time required to learn and write new code will probably surpass the release of CtP2. Thus rendering it pretty much a waste at this point. However, if we ever actually get the info, there might be parts which could be implemented fairly fast. It all depends on what Activision releases. UPDATE: To make sure you understand, let me say this. Joe Blow doesn't call API's from a modified text file like the mod makers currently do. API's are used by executables only. This means writing and compiling new code. That is why Steve mentioned a "Developer" was interested. It is not meant for the normal user.

    The AIP's are not computer related thus the reason computer people don't fully understand them. Fuzzy Logic is purely mathmatical in nature. The computer only comes to play in regard to how the fuzzy logic is called and executed. Fuzzy logic has been upgraded and refined since I last worked with advanced mathmatics. I understand the basic principle but that is about it.

    UPDATE: In reading back over this, I realized I didn't answer the question of what to expect. Unfortunately, I will have to see what API's they give us before that will be known.

    ------------------
    Don,
    CtPMaps (Hosted by Apolyton)
    [This message has been edited by skorpion59 (edited April 08, 2000).]
    Don,
    CtPMaps (Hosted by Apolyton)

    Comment


    • #17
      Locutus,

      I haven't any specific address, it as been a while I looked at that.

      If you do a simple search from Yahoo with +fuzzy +logic you will find many many sites, some are for beginners and some are directed more toward researchers and others are in between.

      Comment


      • #18
        Thanx anyway, I did just that and there's a lot out there but as I expected a lot of it is useless IMO (but some of it is very useful indeed!). Luckily I don't have to go through most of it because I received a great explanation about fuzzy logic (in a CtP context) by Peter Triggs.
        Great work Peter, very useful, especially placing it in a CtP context helps a lot!
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • #19
          I have another question: can you add personality types to the game? I don't mean replacing one of the existing ones but as an extra type. Normally I'd say this should be possible but so many things in CtP are hard-coded, maybe this is too? Anyone succesfully tried this?
          Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

          Comment


          • #20
            Hi Locutus, Yes it is possible to add new personalities, I have added 8 new personalities for my scenario.

            Let's say you want to add a new personality called "gemini"

            These files will have to be added.

            beginturngemini.fli
            def_personality_who_gemini.fli
            maingemini.fli
            personalitygemini.fli

            Inside these files you'll have to change a few lines to include your new file. For example in personalitygemini.fli you'll have to make sure it says.

            #include "maingemini.fli"

            And I think a line in maingemini.fli will have to be changed but it'd be good just to check the other two files as well just incase you have to change them as well to include your new files.

            Now make sure you go into civilisation.txt and add your new personality to one of the civs. for example.

            CIV_PERSONALITY_MALE "gemini"

            Now, the hard part is defining your new personality in the aiploader but how the game defined it's personalities is pretty simple.

            It revolves around a combination of these variables.

            output warrior[0.0, 2.0] =1.0
            tri yes_warrior(warrior, 1.0, 0.1)

            output scientist[0.0, 2.0] = 0.0
            tri yes_scientist(scientist, 1.0, 0.1)

            output slaver[0.0, 2.0] =0.0
            tri yes_slaver(slaver, 1.0, 0.1)

            output cleric[0.0, 2.0] =0.0
            tri yes_cleric(cleric, 1.0, 0.1)

            output barbarian[0.0, 2.0] = 0.0
            tri yes_barbarian(barbarian, 1.0, 0.1)

            and whether it settles densely or loosely as defined in the beginturn files.

            So that's basically how they defined the personalities for eg.

            if(yes_warrior and yes_settle_dense)
            {
            yes_warmany
            }

            The hard part I think is adding in all your new statements so you can have a new personality. What I did for my new 8 personalities was just add this line in each beginturn file.

            action load("british.aip") when (num_cities < 100.0)

            and I excluded for it to include the aiploader file.

            So it will load my british.aip when the cities are less than 100. Same as how the barbarians do it. And I used the same settings for each nation as far as setting production and stuff like that. The main thing I was really concerned about was that each nation had a specific aip build list. So I never really added a new personality, just specific aip for 8 of the civilizations. So adding a new personality for specific aips isn't that hard, but adding a new personality would be probably alot of work.

            Anyway, hope this helps and if you have anymore questions just ask.

            This is all from memory so I hope I got everything right.

            I did do extensive testing though and it does all work.

            Cya!!



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

            Comment


            • #21
              gemini,

              I'm at my university right now so I can't test anything out but I can already tell that that is very useful. Thanx a lot, man!
              Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

              Comment


              • #22
                Don, thanks for that very thorough explanation. It certainly cleared things up for me.

                I seem to recall that you were asking for suggestions about what sort of maps people might want. How about a 'Mod Maker's Testing Map'?
                What I've got in mind is a gigantic map divided up into eight identical blocs. It could be completely artificial and unlike anything the CTP generator might produce, never mind the real world. This would allow a mod maker to put one civilization for each personality type into a bloc (so one's empty) and see how they variously develop while holding their geographical backgrounds constant. As for what specific geographical features it should have, I don't know. But if anyone's got any ideas, here's the place to post them.

                Speaking of maps, has anyone modified the map generator in Const.txt and got maps that they're really happy with. I've tried this and got what can be described as improved maps but they're still not top grade.

                Comment


                • #23
                  Peter,

                  I actually have a map used for that purpose which I included with my origianl Apolyton Pack add-on. I mostly use it for testing but it can be intersting to play on for real. Seeing how every Civ has an identical continent, it is fun to see how they populate it compared to how I populate it. It is also fun to see how other humans play it compared to how I play it. I didn't think many people would be interested in it so I have not really made it available to others. Perhaps I should.

                  I have made some extensive changes trying to produce a 'good' map through the map generater program. This is an ongoing process I explore when I have the time. Like you, I have produced better maps but not good maps. I hate those 30 tile mountain ranges so that was my first priority. I no longer get them but I also don't get as many mountains as I would like. Same with hills. They have been drastically reduced. I have also increased rivers quite a bit. In some of my latest testing, I have been able to get ice, tundra (white) tiles to only occur within 2-3 tiles of the top and bottom borders. Unfortunately, most of the changable settings work off a basic setting (as compared to being the actual setting) thus it is basically impossible to get rid of regular tiles (grass, plain, desert, swamp, forest). I have changed the percentage of each type to 0 and still get way more than I care for. Basically, at this point, I create a 'better' map and then customize it for the game.
                  Don,
                  CtPMaps (Hosted by Apolyton)

                  Comment


                  • #24
                    Some one sent me this map text a couple of months ago, when I was busy with a bunch of other things, and now I don't know who sent it or what the altered settings do. If anyone can answer either of these two questions, I would appreciate it. The paste below is from the first part of the file, and seems representative of the changes made in the rest of the file.
                    MAP_SIZE 24 48 {
                    {
                    MAP_NUM_CONTINENTS 120
                    MAP_MIN_WIDTH 3
                    MAP_MIN_HEIGHT 3
                    MAP_MAX_WIDTH 4
                    MAP_MAX_HEIGHT 8
                    MAP_BUMP_SIZE 12
                    MAP_MIN_SUBCONTINENTS 2
                    MAP_MAX_SUBCONTINENTS 4
                    MAP_SUBCONTINENT_SIZE 0.6
                    MAP_SUBCONTINENT_HEIGHT 0.5
                    MAP_BORDER_SIZE 15
                    MAP_FAULT_LINES 0
                    MAP_FAULT_LENGTH 1.0
                    MAP_NS_BORDER_SIZE 5
                    }

                    Comment


                    • #25
                      I know it isn't the right forum for this, but has anyoone here tried to change what the huts can give, beyond altering the ratios? I'm thinking of changes such as giving public works points, affecting reputation, or finding a new good; something to add for variety, and to partly replace finding new advances.

                      Comment


                      • #26
                        Hi Curtkath

                        I don't think adding any new benefits to goody huts is possible at all. It's to bad cos it would be interesting to add more benefits to goody huts.

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

                        Comment


                        • #27
                          Wes, that might have been me, I have no clue, but it looks like a chunk from map.txt, right?

                          Curtkath, Gemini:

                          Hey...

                          Open up risks.txt, defeault/gamedata:

                          you'll find all that here, for the 4 risk levels for barbarian values; apparently, one could even add a level....but anyway,
                          quote:

                          RISK_RAGING_HORDES {
                          BARBARIAN_HUT_CHANCE 0.25
                          MAX_HUT_BARBARIANS 4
                          GOLD_HUT_CHANCE 0.2
                          MAX_HUT_GOLD 700
                          ADVANCE_HUT_CHANCE 0.20
                          MAX_HUT_ADVANCE_PREREQUISITES 2
                          UNIT_HUT_CHANCE 0.15
                          MAX_UNIT_PREREQUISITES 2
                          CITY_HUT_CHANCE 0.05
                          SETTLER_HUT_CHANCE 0.1
                          MIN_HUT_GOLD 350

                          BARBARIAN_CHANCE 0.10 #Chance of barbarians appearing at random

                          BARBARIAN_RANK_MAX 8
                          BARBARIAN_RANK_MIN 15
                          MAX_SPONTANEOUS_BARBARIANS 2
                          FIRST_BARBARIAN_TURN 20
                          LAST_BARBARIAN_TURN 350
                          MINIMUM_BARBARIAN_DISTANCE 5
                          }



                          I don't know about adding things...as with other test files, you can add (thru a trial-&-error system) all types of things, and if it crashes, well, take it out; if it doesn't, start testing to see if it actually works or not or is merely sitting there torpid and useless.
                          Existence is Futile.

                          Comment


                          • #28
                            Yes, the map info is from the map.txt file which is the input file to the 4 map generator plugins. However, the info in the post is the default info, nothing has been altered.
                            Don,
                            CtPMaps (Hosted by Apolyton)

                            Comment


                            • #29
                              Wasn't this thread for AIP's and fli's?
                              Not a problem anyway cause sprouts in speech are interesting.

                              Just a question, seeing as I have made all these new units for my mod I'll have to get the AI to use them. Inside each personallyties AIP file there are what units it builds for what and how often, likely it is, they will build them. For my other races I am just going to copy and change the already exsisting AIP's and fli's, setting them up with the right research ques and stuff. All I want to know is will this work?
                              I know that they use the function name, ie UNIT_WARRIOR, and not the string name, "warrior", so I think it should be O.k. Just wanted to know whether my assumptions were right.

                              Thanks for reading this overly long post,
                              Dogmatrix
                              Flying shields and no warm beer.

                              Comment


                              • #30
                                Hey Dogmatrix, if you are adding units or techs to a game, the only thing you have to worry about is adding them to your aip files. Have you seen any of cd's comments?? They are in the modification area of this site. I recommend you read the information on aip files that cd has written for more info on these files.

                                Also for adding units and techs, if you don't want a certain personality to be able to build or research certain things don't put it in that aip personality file. Also there are more aip files for different situations that override the default aip for each personality. Just so you know if you don't already.

                                Hey Nordicus I see you made your way back to us. Welcome back man.

                                Oh Ya, your assumptions on the UNIT_WARRIOR and not using the string name "warrior" are correct.
                                ------------------
                                Gemini
                                [This message has been edited by gemini (edited May 05, 2000).]

                                Comment

                                Working...
                                X