Announcement

Collapse
No announcement yet.

Creating AI superpowers

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

  • Creating AI superpowers

    This thread is a continuation of one in the general forum. The idea is to breathe new life into a game where the human player is clearly winning. To achieve this we try to combine a number of the weaker civs to make new bigger ones. Here are some suggested ways in which this might be done.

    Firstly a trigger is needed. I suggest that a suitable trigger is when the human player achieves certain milestones. For example, when 'Gunpowder' is researched the the event is triggered. The next check might be when 'Industrialisation' has been achieved.

    So, if the human player isn't winning then nothing need be done. If there are fewer than 4 AI civs then nothing useful can be done either. We will try to boost AI civs with rankings 2,3,4. (Rank 1 is the human of course.)

    What happens next depends on whether it is possible to determine which civs are next to each other.

    If it is...
    See if there are any civs other than 3,4 next to 2. Next check to see what government is being run and how many more cities are allowed. Lets suppose that the government limit is 50 and civ 2 has 30 cities. Lets suppose civ 6 next door has 10 cities. Fine, civ 6 gets 'united'. This still leaves us 10 cities short. We don't, however, want to give civ 2 its full alotment of cities since this will probably cause it to stop expanding. Lets suppose civ 7 next door has 10 cities also. So we may 'steal' the nearest five cities and add them to civ 2. Repeat this process for civs 3 and 4.

    If it is not...
    Do something similar but instead eliminate the weakest civs.

    Does this make sense?

  • #2
    Hello!

    I've written some code.
    Due to the playability and likely situations for civs needing or wanting to merge or whatever, I have come up with two ways of it happening:

    1 - The human is on an all-out killing spree. Every time he takes a city, a function fires to see whether or not the conditions are right for a merge. It checks the top 3 non-human civs. If any pair of them (1,2 1,3 2,3) are both at war with the human (likely), at peace with each other (likely) and have less cities in total than the maximum needed under the more powerful of the pair's government, they then have a chance of merging. This chance is presently defined as (the game year divided by 50)%, though this may change.

    2 - The human is going for a science victory, or diplo victory, and hasn't taken a city for a while. It is, quite frankly, coasting. If it does not take a city for 35 turns, there is a (year/200)% chance of a merge between a random two adjacent civs. If the human does not take a city for 75 turns, there is a (year/100)% chance of a merger. (all this providing the two random civs are at peace and have few enough cities)

    Because of the nature of this code, the SLIC is very hard to playtest, so if anyone is about to begin a game, I would be very happy if they unzipped this SLIC into the ctp2_data folder beforehand . It does not give any errors on startup, but who knows what the future may hold

    File attatched.

    Ben
    Attached Files
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

    Comment


    • #3
      Count with me. I would love test a code can that boosts the weaker AIs.
      I will start it today.
      PS: Yet i am also testing a lot of other stuff i changed. So another person is going to be more indicated than me.

      Keep you informed
      Last edited by Pedrunn; January 28, 2002, 06:33.
      "Kill a man and you are a murder.
      Kill thousands and you are a conquer.
      Kill all and you are a God!"
      -Jean Rostand

      Comment


      • #4
        Re: Hello!

        Originally posted by Immortal Wombat
        Every time he takes a city, a function fires to see whether or not the conditions are right for a merge. It checks the top 3 non-human civs. may change.
        Shouldnt we have a code for the 3 worst civs instead of the 3 top.
        Those are the ones that really could use help.
        Last edited by Pedrunn; January 28, 2002, 07:51.
        "Kill a man and you are a murder.
        Kill thousands and you are a conquer.
        Kill all and you are a God!"
        -Jean Rostand

        Comment


        • #5
          The top 3 are the only ones with a chance to beat the human.
          Concrete, Abstract, or Squoingy?
          "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

          Comment


          • #6
            Hi how about making the production on this supper power go throw the roof for a few turns as well as science and technicians can swap stories and ideas etc. . Blame it on the scientist

            What about modernising the other civs some may be in the ancient age and the rest in the middle.
            There cities would be rubbish
            "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
            The BIG MC making ctp2 a much unsafer place.
            Visit the big mc’s website

            Comment


            • #7
              Good point.
              The stronger civ should have all the advances already, but I'll run a check if I can.

              (tries to post for the fourth time...)
              Concrete, Abstract, or Squoingy?
              "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

              Comment


              • #8
                I have had a slight rethink here. The government maximum cities can vary a lot depending on which version of the setup files are being run. Additionally it also depends critically and the land/water ratio and the number of civs being played. Rather than targetting the government maximum instead perhaps the number of cities that the human player has is more appropriate. The AI gets an eneormous research advantage anyway. If it has anywhere near the human number of cities it should rock along nicely anyway.

                In the last game I played the AI was keeping up until about 1300 AD before falling away badly. At this point I had 30 cities but the largest AI had only 10 !!! It is at a time such as this that intervention is required.

                I also don't think that these amalgamations should occur more than once or twice during a game. If it's a regular event then the game will lose all continuity. That's why I suggested checking only when certain 'milestones' have been reached.

                Comment


                • #9
                  Hi I remember I will ago now I was trying to make my first slic coding the barbarian terrorists.
                  I remember messing the AI some were and it sent it on a right one it was building new cities like a good one. It was in a scenario I tweak it the civ already had about two cities after the tweak in no less then a bout then turns they had five they had all the advances and were building cities in very small spaces I will dig out my old file and send it to you.

                  Ps wombat love the new avatar
                  "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                  The BIG MC making ctp2 a much unsafer place.
                  Visit the big mc’s website

                  Comment


                  • #10
                    Originally posted by Lou Wigman
                    I have had a slight rethink here. The government maximum cities can vary a lot depending on which version of the setup files are being run. Additionally it also depends critically and the land/water ratio and the number of civs being played. Rather than targetting the government maximum instead perhaps the number of cities that the human player has is more appropriate. The AI gets an eneormous research advantage anyway. If it has anywhere near the human number of cities it should rock along nicely anyway.
                    I don't think this is a problem. I have not used the maximum number of cities as a determining factor of how much merging is to go on, I have just set it as an upper limit as to whether the civs should merge at all. (Thats if I can find a workaround to a small government problem...)
                    I also don't think that these amalgamations should occur more than once or twice during a game. If it's a regular event then the game will lose all continuity. That's why I suggested checking only when certain 'milestones' have been reached.
                    Given the small chances of any merge happening at all, I don't think this wil ccur too often, and it is easily changed to personal preference anyway. However the chance of merging gets larger througout the game. I can put in a routine to disable it after two or three merges if it is desired...

                    Ps wombat love the new avatar
                    ta
                    Concrete, Abstract, or Squoingy?
                    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

                    Comment


                    • #11
                      If anything, what would help the AI is to prompt it to peacefully expand more during the course of the game. I believe that the AI has an almost unhealthy respect for borders in regards to settling, so as the map is filled up with cities/borders, the AI settlers end up wandering around, or worse yet, sitting in a military stack taking up valuable combat slots. (not that settlers sitting in a stack is a bad thing - as long as they end up settling somewhere.)

                      Still, I think if this piece of SLIC could be pulled off, it will add an exciting dynamic to the game (almost an EU2 feel) and would also reflect aspects of actual history - something that I think cannot be duplicated in civ2 or civ3, though correct me if I am wrong (the rise of new civs).

                      This type of effect should be limited to a late game occurance when the AI starts to lag.

                      It seems to me that the AI is doing alright in science and is usually in the same type of government that the human player is in for the bulk of the game in 'Cradle' - the problem, as Lou says, is in empire size based on number of cities which means that the human player can eventually outproduce the AI.

                      I see the max city setting for governments as the only potential problem - but the main reason the AI civs do fall behind is that they are not anywhere near the max city setting in the later game, so the numbers can be adjusted up slighly for the later governments to compensate - and a unification should greatly help the AI - even a unification between the 2nd place civ and the weakest civ will most likely benefit the AI.

                      Is it possible to overwrite the max city setting code via SLIC that will kick in when the unification process starts?

                      And Lou's point regarding the need to limit this event in the game is a very valid one, as there is the possibility that the game could eventually boil down to a 2-civ game without those limits. It could be triggered by researching a certain advance (and the advance would have to be one that is not a dead-end advance either) or something along those lines like turns - but I agree that it may be better to tie it into the number of cities - (possibly if the game is on turn 500 and the human civ has 150% more cities, then the SLIC file triggers a peaceful unification between 2 other civs.)

                      Using this type of SLIC in conjunction with an altered NumPlayers and MaxPlayer setting in userprfile.txt will ensure that the game will have a constant influx of new and changing civs. (I can see the message that civA and civB have united due to a royal marriage - and this type of thing adds immensely to in-game atmosphere)

                      The bottom line is to get a game that continually challenges a player during the course of the game - if this accomplishes this goal, then I'm all for it, and this will be a part of Cradle.
                      Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
                      ...aisdhieort...dticcok...

                      Comment


                      • #12
                        Originally posted by hexagonian
                        This type of effect should be limited to a late game occurance when the AI starts to lag.
                        Its current setting means it could has a 1% chance of happening if you take a city after 100 turns, or if you have had 35 turns of peace after turn 500. However, this is very, very unlikely. The chance increases through the game. How many turns are there? 1000 in the whole game? That would give a 10% chance of a merge every time you take a city after then. I will add a line to limit it to 2 merges I think. Or possibly to 1/4 of the number of players.
                        I see the max city setting for governments as the only potential problem - but the main reason the AI civs do fall behind is that they are not anywhere near the max city setting in the later game, so the numbers can be adjusted up slighly for the later governments to compensate - and a unification should greatly help the AI - even a unification between the 2nd place civ and the weakest civ will most likely benefit the AI.
                        Peter has informed me that the function I was using to get the number of cities available under the player's government will not work. Unless I can find a workaround, the city limits are a problem. There is a way to use SLIC to compensate for the unhappiness for the AI, but I think perhaps a better way to do it would be to set city limits really high in the text files, and then simply use SLIC to punish the human for any extra cities over the limit.
                        Is it possible to overwrite the max city setting code via SLIC that will kick in when the unification process starts?
                        Yes.
                        And Lou's point regarding the need to limit this event in the game is a very valid one, as there is the possibility that the game could eventually boil down to a 2-civ game without those limits. It could be triggered by researching a certain advance (and the advance would have to be one that is not a dead-end advance either) or something along those lines like turns - but I agree that it may be better to tie it into the number of cities - (possibly if the game is on turn 500 and the human civ has 150% more cities, then the SLIC file triggers a peaceful unification between 2 other civs.)
                        I'll start a poll...
                        The bottom line is to get a game that continually challenges a player during the course of the game - if this accomplishes this goal, then I'm all for it, and this will be a part of Cradle.
                        Lets hope it will
                        Concrete, Abstract, or Squoingy?
                        "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

                        Comment


                        • #13
                          Update:

                          Conditions:
                          Human Cities = (AI1 Cities + AI2 Cities) * 1.5
                          Game Turn > 400 (500 for peacetime merges)

                          Triggers:
                          BeginTurn: Fires after lengthy peace
                          CaptureCity: Fires when the human takes a city
                          Advances: (lazy me)
                          Code:
                          if(AdvanceID == AdvanceDB(ADVANCE_GUNPOWDER)
                          	|| AdvanceID == AdvanceDB(ADVANCE_INDUSTRIALIZATION)
                          	|| AdvanceID == AdvanceDB(ADVANCE_TANK_WARFARE)
                          	|| AdvanceID == AdvanceDB(ADVANCE_ADVANCED_INFANTRY_TACTICS)
                          	|| AdvanceID == AdvanceDB(ADVANCE_FLIGHT)){
                          Fires on those... I'm open to suggestions of more, but I'm not in the mood at 2am to go searching the tech tree.

                          Think thats it...
                          Attached Files
                          Concrete, Abstract, or Squoingy?
                          "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

                          Comment


                          • #14
                            I'm still getting the 'this is not a valid zip file' window. (The setup you had last time with the 'Hurricane' file seemed to work, where you had uploaded it to another website)
                            Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
                            ...aisdhieort...dticcok...

                            Comment


                            • #15
                              Damn. Ok, try here:

                              Concrete, Abstract, or Squoingy?
                              "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

                              Comment

                              Working...
                              X