Announcement

Collapse
No announcement yet.

AI : Army Movement

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

  • #91
    For those investigating the changes calvitix made, I attach diffs for each of calvitix's submitted alterations (at least, that's what they should be, assuming the version control worked out properly ). There is one file here for each complete submission, in the relatively readable diff format.
    Attached Files

    Comment


    • #92
      John is there an option for the diff creation of ignoring white space changes? Unfortunatly the code files of the first 3 diffs submissions contain heavey white space changes, that makes difficuilt to find the real changes.

      -Martin
      Civ2 military advisor: "No complaints, Sir!"

      Comment


      • #93
        Well, I can do it like the one I attach here, which should ignore changes to the whitespace on any given line, but it can't ignore whole additions or removals of blank lines, because that would change the line numbering. Also, this isn't in such a readable format.
        Attached Files

        Comment


        • #94
          Originally posted by Martin Gühmann
          What about this:
          [...]
          By the way I didn't understand for what this nb_transport variable is and why Calvitix checks whether m_transport > 0 and transport_nb > 0, the first check should be included in the second one.
          I think it is anti-symmetrical now. And also difficult to understand. From what I understand of it, the m_transport value is the number of free transport slots, and the extra guard (both values > 0) is used to prevent using this condition when comparing a transport army against a non-transport army. But I think that mixing 4 different concepts (remaining transport capacity, battle strength, shield cost, #of agents) in a single operator does not work well. It is probably better to define a specific operator for each concept.

          Comment


          • #95
            Originally posted by Fromafar
            And also difficult to understand.
            That's why I wanted to hear another opinion.

            Originally posted by Fromafar
            From what I understand of it, the m_transport value is the number of free transport slots, and the extra guard (both values > 0) is used to prevent using this condition when comparing a transport army against a non-transport army.
            OK, then it isn't needed in the current version. As it leaves the function if the transport capacity is unequal.

            Originally posted by Fromafar
            But I think that mixing 4 different concepts (remaining transport capacity, battle strength, shield cost, #of agents) in a single operator does not work well. It is probably better to define a specific operator for each concept.
            Well the concepts are at least in a hirachy. First the transport capacity and if it is euql in both stacks then the strength is compared and if the strength of both stacks is zero then the sizes are compared.

            J just don't see the shield cost part, maybe the m_value but for that I have to take a closer look. And if it is this then we should reconsider it.

            - Martin
            Civ2 military advisor: "No complaints, Sir!"

            Comment


            • #96
              Originally posted by Martin Gühmann
              Another thing I noticed is the settling behaviour, but actual I already noticed this in a game without your modifications calvitix, the AIs don't settle aggressivly enough. I was able to fix this in GoodMod for ApolytonPack with some text file modifications and I thought by adding those modifications to the startegies.txt I would fix it here as well, but in fact I see here in that game a settler that is obviously waiting for doomsday or whatever. Actual I think the Germans will release a settler from that ship and fill the gap, that should have been filled by the Incians ages ago. And I don't see that the too many cities strategies should be in effect here either as the Incians never hit the city limit. Another thing is that the Incans in the 2 res game have 6 settlers even if the strategies.txt tells them to have only at most 4 settlers.

              Martin,
              I know I'm digging this up from the past but a consistent problem I've seen in a few games I tested are the "frozen" settlers. they either fortified or if i remove the entrench flag the just just freeze at a position.

              I dont know if they aretrying to cross the sea (then tend to be on the cost) or if its because I made mountains unsettleable or they are treating settlers with regular unit strategies.

              Where would a good start be. Basically I'd like to add something like if settle = false it moves or if it doesnt move for 5 turns then it just settles there.
              Formerly known as "E" on Apolyton

              See me at Civfanatics.com

              Comment


              • #97
                E, the first thing I would check is whether the AI is at the city limit. I put it on the main tab panel with the number of cities, so that you can check it easily.

                -Martin
                Civ2 military advisor: "No complaints, Sir!"

                Comment


                • #98
                  I always felt two aspects of AI settling to be extremely annoying:

                  - that I have to expel their settlers from my territory each and every year for centuries
                  - and that they just stop settling at some point of the game.

                  Once I had a funny situation in a game, where the AI for some reason built lots of settlers, sent them wandering through my territory, I expelled them as usual. Once, surveying my borders, I spotted a huge "army" of refugees who got no employment by their government and stranded at the edge of my empire.

                  So I tried several things to improve their human rights situation .

                  To a certain extent modifcations in the textfiles may help, like:

                  - settling priority (also in relation to exploration priority: IIRC the AI, if peaceful, uses settlers for exploration, and if they are finished with that they just hang around).
                  - settling score (the AI won't settle on tiles with a score below this value -- I think it's the sum of terrain values, but I don't remember exactly).
                  - city limit, as mentioned by Martin G.

                  If you restrict the AI's settling opportunities, It may very well happen that their settlers get somewhat lost (settling score, but also movement and settling attributes of the units).

                  However, I got as far as making the AI settle a bit more "aggressively" in my attempts, but not necessarily more intelligently. So I decided to SLIC them. If you want to try Better Settling 1.0 beta you might need to take out the player.government-stuff (the "MOD_MAXCITIES[]"-array), since I don't know for sure if it would break the current playtest version. In this case you obviously need an alternative method for figuring out the AI's city limit. Or just take a look at the code for inspiration .
                  The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

                  Comment


                  • #99
                    Thanks Bureaubert,

                    (Nice website by the way )

                    i see how we can "break" the AI's will to settle by values but should we look into adding the code a way for the AI not to form refugees?

                    Seeing them as refuggees adds a degree of realism but a disadvantage to the AI which should be continuing to look for places to settle or disband or add the settler to an existing city.

                    Another option is that afterno mvmt for 5 turns have the settler automatically disband and become a fort or something but that is a slic thing.
                    Formerly known as "E" on Apolyton

                    See me at Civfanatics.com

                    Comment


                    • Well I can just tell what "Better Settling 1.0 beta" does to fit my taste:

                      - First it's based upon textfile settings, most importantly on a set of corresponding strategies
                      - The SLIC itself determines an AI's "settling condition (SETCON)" considering it's government specific city limit, the "avarage" HUMAN player's number of cities, the current "era" (in my own Mod I like to see the AI expanding by settling in the early game, later a bigger portion of their "city ration" is reserved for conquest), selects an according settling strategy from strategies.txt and uses SETCON in it's own logic.
                      - Settling strategies mostly determine how many settlers the AI will build. The SLIC always takes complete control over the first three settlers , directs them to good settling locations and forces them to settle there. The remaining settlers are just semi-controlled (forced to move to better tiles before we take over complete control). The evaluation and selection of settling locations is in the SLIC.
                      - "Geographical awareness": First of all I have introduced an event handler to stop the AI from settling on foreign territory (which is also disabled for the HUMAN player, of course). Basically the entire SLIC-logic is designed for compact settling, but there is a "settling frustration"-factor: Whenever the AI tries to settle on foreign territory (which it unevitably does by default if sorrounded by other civs), settling frustration rises. The AI "learns by failure", after a while they "know" they are surrounded by concurring civs and need an alternative strategy for expansion. This strategy could be worked out better -- currently the script just allows settling far away beyond a certain "settling frustration" (some skilled SLICer could think of settlers boarding ships and colonizing other continents ...).

                      More details can be found in the comments ...

                      Different ideas like settlers building forts or colonies, and settlers "migrating" to other cities maybe interesting in the context of particular Mods. Therefore I like the idea of SLICing the whole stuff instead of implementing a particular concept into the "hard code". For my need & taste getting supplied with functions and variables like player.government or access to the database values is a lot more interesting. But on the other hand I am not against an improvement of the default behaviour in the hard code if it can be easily overridden by SLIC
                      The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

                      Comment


                      • Originally posted by BureauBert
                        you might need to take out the player.government-stuff (the "MOD_MAXCITIES[]"-array), since I don't know for sure if it would break the current playtest version. In this case you obviously need an alternative method for figuring out the AI's city limit. Or just take a look at the code for inspiration .
                        There is no need for an alternative way to figure out the player's government we have it in the playtest. And also city limit depending strategy change is in.

                        -Martin
                        Civ2 military advisor: "No complaints, Sir!"

                        Comment


                        • There is no need for an alternative way to figure out the player's government we have it in the playtest.
                          It's up to whoever wants to experiment with the SLIC which method to use -- I just meant it could be a good idea to take out the playtest-specific stuff in case it breaks the playtest or the script won't run with the playtest at all (something in my SLICs does break it completely -- CTD -- and I could not yet figure out which one, also I currently don't have the time to care)

                          city limit depending strategy change is in
                          Sounds promising, but what does it mean ???
                          The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

                          Comment


                          • Originally posted by BureauBert
                            Sounds promising, but what does it mean ???
                            Simply it does something that is burried deeply somewhere in my BettarAI.slc. Simply it figures out the government, by a much more elegant way than Dale does it. And than loads an appropiate strategy that reduces the priority of settling, settler building and conquest, so that the AI doesn't increase the number of cities. And this without slic but inside the code, of course the startegy selection is exposed in personalities.txt.

                            -Martin
                            Civ2 military advisor: "No complaints, Sir!"

                            Comment


                            • stankarp
                              The AI declare war event is tied to the following.
                              1) It only triggers once the human reaches a number 1 ranking in something after turn 200.
                              2) The chances of the ai declaring war vary based on your frenzy level, whether you have a peace treaty with the ai and it's personality.

                              It was designed to stop a situation where the human gets on top and just picks and chooses where and when he might attack and the ai sit there. Some declarations don't mean much, but if you have a powerfull ai on your border and are being aggressive to others, there is a chance it might join in, adds uncertainty to the game.

                              It also prevents the situation that happened in my last 2 civ 4 games where I just steam rolled the map in one direction and the other ai just st there and watched.
                              this was a response that stan had over in his AoM site. AFAIK, nothing like htis exists in the AE. I think it makes good sense considering the late game tedium we sometimes get as well as th human ability to really master modern and future war.

                              Is there something in strategy we can use, probably as a difficulty option, where we identify if the human gets to rank #1 and have the AI get really hostile for world war? I think something where it could trigger or switch the AI to all out attack. I guess it could be a maxed out integer that gets added to the strategy attack value but is only 0 if the human is not #1.

                              We could probably add a second difficulty option that is linked to it that triggers the AI to "mobilize" giving it the noUnit Shield cost flags and gold bonuses to make the AI gte really strong. Basically give the AI heaps of advantages until the human is no longer #1.

                              any thoughts on this?
                              Formerly known as "E" on Apolyton

                              See me at Civfanatics.com

                              Comment


                              • Many good ponits!

                                In a post a while back for 619 playtest I had the same thoughts. First off the game was a toe to toe battle, Was the most enjoyment I have gotten of out playing Civ.
                                Around the 400 to 500 mark I was getting the upper hand and could back down the AI even when some went over 40 cities.
                                I feel its because the AI has threats all aournd and this might bog it down so it might not want to use its army to capture your cities.Just play defense. Even when I declared war with more than one AI faction.This is only true in the end game.Do this aound the 200 turn mark and the AI will drive at you with 10 and 12 stacks using build 619.
                                You could make ajustments using the DiffDb file .In the modern age where AI is a little behind the humand player and where AI is a little ahead tweak the numbers up.
                                I dont feel its to much of a cheat as you can make ajustments to milatary readiness and the AI cannot.
                                Lets face it the AI needs more than one way to win than high score. A trigger event at some ponit in the game where the AI could build a wonder to gain a very high score. A merging of AI civs as a way to make them a unbeatable force might work but AI.s would have to share the same border.

                                Comment

                                Working...
                                X