Announcement

Collapse
No announcement yet.

I love Med/Cradle mods but why AI is not attacking?

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

  • I love Med/Cradle mods but why AI is not attacking?

    I loved CTP1 and I played it countless of hours. Then CTP2 came available and I bought it but only played one game, the AI was such a big disappointment.

    Now I've read about all the mods how they have imroved the AI and decided to give CTP2 another go. I first tried Medmod with '"very hard" and yes, a lot things are much better there than in vanilla version. Wasn't too hard to beat it though but I had some great time.

    Then I installed Cradle mod and tried it as "very hard". I see a lot of improvements done with AI. For example, AI is now making a good use of their PW's and they are keeping up with science quite well. Also, they are busy sending troops to pillage my land and sea improvements. It's a lot of fun to play with.

    Unit upgrading is a great concept and it also makes AI more competitive as it gets those upgrades for free. AI is quite active at sea as well and is forcing me to build a lot of ships to guard my TI's and trade routes.

    Crade readme told that AI is now making some big stacks of units and should be aggressive to attack, especially human. I've encountered this problem however:

    AI IS building huge stacks of units but it isn't using them! For example, at my game there was a continent of Native Americans. I went there with 6 coracles (guarded with triremes) and dropped size 6 stack next to it's city. Two tiles away there was a AI stack of 10 and I was worried that it would take care of my 6 stack..

    However, it did nothing! It remained there fortified and watched me carrying more troops until I got a full stack. I got a good stack eventually and tried to capture one of it's cities. The city was guarded with 12 stack at desert terrain and didn't have a chance.

    I concluded that the only chance is catapults. I was already researching it so I started to accumulate gold and make huge amounts of the first artillery units available (don't rem the name).

    Then I started carry them one by one with my ships accumulating a full 12 unit catapult stack. This took a long time and my point here is that AI did NOTHING at all to interfere with my devious plan. It should have seen the danger of my troops getting accumulated near it's city and should have gone offensive to prevent me getting all those catapults there.

    I finally took over one of the cities and them moved to the city where this AI 10 stack sat next to. I bombarded the city and finally the defenders were weak enough I could take it. After capturing it I excepted that this 10 stack would try to recapture but.. no. Next turn I moved in my 12 catapults and bombarded that stack killing 4 of them. Then it started to flee away but got killed next turn.

    Conlusion: CTP2 is now better and challenging than ever with the aid of the mods, that's for sure. I love to organice my armies with this excellent army management tool and don't suffer from the tedium of managing all the units one by one like in Civ3. Also love the simplicity of the public work system.. and no, I don't want to handle the army of 100-200 workers every turn! Also I like the concept of roads in CTP series. Their only purpose it to make travelling faster, just like in real life. I never liked to be forced to road/railroad every square like in Civ3 to get more commerce/trade and production (with railroads). Makes the map look awful. Also I really hate chopping down all forest and especially jungles at Civ3. It's wrong environment wise and also makes the terrain look really dull with only grassland/plains/hills/mountains in the end (if u want optimize everything like I do..)

    So this big question remains: is it possible to make AI use his stacks more aggressively? Making it recognice that human player is making invasion and call all of it's troops to counter the problem? Is it possible to do with slicks or is the source-code project the answer?

    Btw, with my medmod game AI declared war and had his 12 stack closing my city next to it. My city wasn't well guarded but it never attacked it?! Just wandered there aimlessly. I also watched AI-AI war there they were quite inefficient conquering each other cities. Just bombarded it once in a while and moving units seemingly aimlessly.

  • #2
    did you use the latest playtest/patch version?
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment


    • #3
      I recall someone complaining about the AI not attacking enough before. I know you can make some changes in strategies.txt in ...\ctp2_data\default\aidata, or rather CRA_strategies.txt for cradle mod.

      Look for all the:

      Code:
          GoalElement { Goal GOAL_ATTACK              Priority   405000  MaxEval  25  MaxExec  25 }
      under each strategy. If you increase the priority the AI will attack rather than keep pillaging or seiging.

      Someone else could probably give you a good idea of what numbers are best.
      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
      CtP2 AE Wiki & Modding Reference
      One way to compile the CtP2 Source Code.

      Comment


      • #4
        Originally posted by E
        did you use the latest playtest/patch version?
        No I didn't. Is it fully compatible with cradle mod? Can I start using that playtest version in my current mod?

        Then modifying strategies file, can I do it with my current game?

        Thanks for replying and giving me hints, really appreciated!

        Comment


        • #5
          yep, it should be compatible, but please if you have any problems post a saved game and tell us about it in the playtest thread in Source Code
          Formerly known as "E" on Apolyton

          See me at Civfanatics.com

          Comment


          • #6
            Originally posted by E
            yep, it should be compatible, but please if you have any problems post a saved game and tell us about it in the playtest thread in Source Code
            Is the latest version I can try from this link:



            with title "Playtest Build 2004-04-03"

            That's what was given as link to Makromizer at the source code forum when he asked what to use.

            The description of it has this worrysome statement though:

            "This build is not yet compatible with the official v1.11 patch or any of the fan-made mods."

            So is this true, or is it compatible with Cradle after all?

            Thanks in advance.

            Comment


            • #7
              try this thread:



              and this link its 12-28-2004 (and in the same thread)

              Formerly known as "E" on Apolyton

              See me at Civfanatics.com

              Comment


              • #8
                Thanks E for the links. I downloaded it, then made a full copy of my CTP2 directory and unrarred the playtest into that copy. Then I used the modswap in that copy and yes, it worked !! So I can play Cradle mod with this playtest version continuing my current game. Wonderful!

                Everything seems to work. Couple of things changed though. All the colors of the civs changed, I used to be blue and now I'm red. Another change is that the required amounts of caravans for trade went up, was earlier about 1 to 10, now something like 40-60. Huge map & 8 civs.

                Now I'm able to view the goal of all AI units. It's fun to watch what they are up to. At this stage of the game I'm already won (start of modern age) as I could easily conquer the world but I'm having fun watching how AI works.

                I also increased moderately those"GOAL_ATTACK" priorities at CRA_strategies.txt and managed to produce some AI attacks. My neighbor, Hexagonians immediately attacked me at the very next turn. AI could still do better with his attacks however. Here are some of the notions that I made.

                1) AI ironclad appears with goal of pillage. I have a couple of damaged galleons and want to make an experiment. I ungroup them and sail them next to the ironclad to see if it would change the goal and attack me. After all, it should win easily those damaged galleons. Well, the goal changes but to "pirate". I keep following the ironclad, it does some pirating, then goes on to pillage my sea TI's but never attacks my damaged galleons. That leads me to think, if it's possible to write a code that check every time if there is a weaker unit in the vicinity of an AI unit which would "always" make AI attack that unit when in war. After all, that's what humans do. Losing a ship hurts more than losing some gold to pirates or getting some nets pillaged.

                2) During my war with Hexagonians they at some point wants cease fire. I'm at the vicinity of their capital with some huge stacks. I counter it with requesting a city and to my suprise they comply. That city, Maxta, is in the middle of his empire and it's unguarded. However, immediately after our cease fire he attacks me again and we are at war once again.

                I conquer the capitol and watch if they recapture Maxta. It starts to gather some big stacks near Maxta with goals "attact" and "regroup to attack". Several turns go by, it moves it units but never actually attacks the city (which I left unguarded in purpose). Any ideas what's going on with the AI mind?

                3) I also saw some nice improvements done with AI It made some good naval stacks and I really had to work hard to destroy them after I finally got fed up with all the pillaging going on near my cities. I'm sure a lot more good things has been implemented with AI as well, but those are my first impressions.

                Overall, the playtest version was a delight to play. I witnesses several bugs being fixed and some nice new features as well. For example the new specialist tab at the national manager. Handy when I want to check if I got some entetainers somewhere that are not needed anymore for example. If you guys can do all those wonderful improvements, I'm sure that it's possible to teach some new tricks to AI as well. As an old programmer I easily understand that programming intellingent AI must be the hardest part of any game. It's a big challenge but the rewards are huge as well. It's quite possible to make CTP2 the best civ game ever, now that everything in the source code can be modified. After all, the sky is the limit what can be done. Thanks to all who have been working hard with this source code project. The work done there spectacular!

                Comment


                • #9
                  Originally posted by Marko Polo
                  Another change is that the required amounts of caravans for trade went up, was earlier about 1 to 10, now something like 40-60. Huge map & 8 civs.
                  Well some updates to the Cradle files are necessary to fix this. I have some files in my ..\ctp2_data\default\gamedata\ folder with the CRA*_ prefix, unfortunatly I have no idea which of them are used in the current version of Cradle. However two files need correction. The first file(s) is(are) CRA*_const.txt, there you find a CARAVAN_COEF, its value must be devided by ten. And the other file(s) is(are) CRA*_tileimp.txt, compere there Cradle versions with the version that came with the playtest tileimp.txt. Some of the tileimp records contain an additional flag the Freight flag. Just copy it to the according entries in the Cradle versions, so that new trade routes follow the roads.

                  Originally posted by Marko Polo
                  Now I'm able to view the goal of all AI units. It's fun to watch what they are up to. At this stage of the game I'm already won (start of modern age) as I could easily conquer the world but I'm having fun watching how AI works.
                  Well actual that was just a mistake, I forgot to undo this change in my personal version, before I compiled the playtest build. But nice to hear that you have some fun with it.

                  Originally posted by Marko Polo
                  As an old programmer I easily understand that programming intellingent AI must be the hardest part of any game. It's a big challenge but the rewards are huge as well. It's quite possible to make CTP2 the best civ game ever, now that everything in the source code can be modified. After all, the sky is the limit what can be done.
                  In theory, but in practice time and manpower is the limit. And as you are an old programmer I can see that you can help us, as we still need programmers. So what about?

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

                  Comment


                  • #10
                    Originally posted by Martin Gühmann
                    And as you are an old programmer I can see that you can help us, as we still need programmers. So what about?

                    -Martin
                    Well, when I refer to myself as "old" programmer, that really mean like a dinosaur.. I have my basic programmer education 1985-1987 when COBOL was the dominant programming language. Learned Pascal/Turbo Pascal, APL and some of C but only on the surface. About Basic, my skills are from programming Commodore 64..

                    During my career I used 4GL Powerhouse with HP 3000 and after that MS Access. So I'm not very familiar of the event based programming languages although I guess that's not too hard a concept to grasp.

                    When playing my Cradle game, I noticed that my trebuchets didn't get upgraded to cannons as I excepted. So the programmer in me woke up and I started to analyze the CRAG_updater.slc. I added the missing entry there as well as fixed an index problem associated with "flintlock" related updates. I also found a bug there, that if I manage to get an upgrading advance with diplomacy, the script doesn't work. I tells "you have 0 0 units to upgrade and it costs 0 gold" and updates nothing. Apparently this isn't normally a problem as with Frenzy mod all AI's should hate you all the time.. however, I did find a peace-loving diplo-minded civ and we managed to get a nice diplomatic relationship.

                    Another strange thing I found out that it isn't enough to open chat box and type /reloadslic there to activate my updater slic changes. It does popup that "welcome to diplomod 4.5" but my updater fixes doesn't work. I need to go to cheat menu and click "load slick" button so that the changes start working.

                    In conclusion, I'm a bit afraid and intimidated to think that I could help with this project. I really don't have experience of the languages used today. Nor do I have a compiler but maybe there is some free version I could use? The idea of getting involved in this is tempting however.

                    Comment


                    • #11
                      Marko,

                      I don't know how to program and Martin has been VERY patient showing me a thing or too. It might not take you so long to get into it. And if there are things you'd like to see added to the game, then digging into the source code and trying it yourself is the best way to bring it about
                      Formerly known as "E" on Apolyton

                      See me at Civfanatics.com

                      Comment


                      • #12
                        Originally posted by Marko Polo
                        During my career I used 4GL Powerhouse with HP 3000 and after that MS Access. So I'm not very familiar of the event based programming languages although I guess that's not too hard a concept to grasp.
                        C++ is rather a imperative programming languange in the first place. Slic is event driven, that means that you have events on that you can trigger code. Well windows C++ programming is also event driven even if you don't need to understand it in detail.

                        Originally posted by Marko Polo
                        Apparently this isn't normally a problem as with Frenzy mod all AI's should hate you all the time.. however, I did find a peace-loving diplo-minded civ and we managed to get a nice diplomatic relationship.
                        Maybe that is a incompatibilty between Frenzy and Diplomod, Frenzy for enhancing the AI and Diplomod for enhancing diplomacy. Both by different authors, and obviously not quite compatible. Diplomod tries to make the AIs more diplomatic and Frenzy tries to make the AIs hate you, so to opposite things.

                        Originally posted by Marko Polo
                        Another strange thing I found out that it isn't enough to open chat box and type /reloadslic there to activate my updater slic changes. It does popup that "welcome to diplomod 4.5" but my updater fixes doesn't work. I need to go to cheat menu and click "load slick" button so that the changes start working.
                        That's odd, actual it should work without the CheatEditor. And by the way I presume Diplomod 4.5 is a typo. Otherwise it would suprise me to find something else then Diplomod 3.5 in Cradle maybe v. 3.6 but nothing else.

                        Originally posted by Marko Polo
                        In conclusion, I'm a bit afraid and intimidated to think that I could help with this project. I really don't have experience of the languages used today. Nor do I have a compiler but maybe there is some free version I could use? The idea of getting involved in this is tempting however.
                        Well you can learn C++, that's not the problem, I have already started a lecture series in the source code forum, unfortunatly I didn't come so far right now, probably I will continue it next weekend.

                        The more serious problem is getting hands on a compiler. For the start a GNU compiler is sufficient, but if you want to compile a ctp2.exe, you need Visual C++ 6 compiler or the one of .NET, that are the two compilers we can currently use, of course we would like to port it to other compilers as platforms as well, but that is for the future. An introductory version of VC++6 is also sufficient at least it allows you to compile and debug the game. But it doesn't allow you to use all the compiler optimization options, so the game is slower then with a full version of VC++6. However for the start we should talk about code modifications.

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

                        Comment


                        • #13
                          Thanks E and Martin,

                          I managed to make the trade routes working modifying those files.

                          I've been reading threads, especially about AI as that's the topic I find most fachinating. I've been thinking of this improvement. I guess that's not too hard to implement.

                          AI is at war and is moving it's units. Then it encounters an enemy unit/stack. Now it should check if it has a reasonable chance to attack and destroy that stack, despite of it's current goal. (Or change the goal on the fly). At least, give the sudden attack a very high priority, maybe not destroying that trireme with the battleship that's needed to guard vulnerable troop ships (when it's in his way to make that naval invasion.. )

                          Also, if it's having a stack it should calculate which units to take from the stack to attack the enemy. Further, if it spots an unguarded enemy city it should be a very high priority to take that city. So how hard it is to implement this? Better to implement it in the source code or with SLIC?

                          Comment


                          • #14
                            Originally posted by Marko Polo
                            AI is at war and is moving it's units. Then it encounters an enemy unit/stack. Now it should check if it has a reasonable chance to attack and destroy that stack, despite of it's current goal. (Or change the goal on the fly). At least, give the sudden attack a very high priority, maybe not destroying that trireme with the battleship that's needed to guard vulnerable troop ships (when it's in his way to make that naval invasion.. )
                            Actual this is the way I prefer to implement. However calvitix went another way, with that I don't agree, namly bypassing the threat with a big detour, not very efficient, espeacilly if you consider that if you want to attack a city in the middle of an empire you have to find a way to sneak in and if you find it your enemy closes it, so no chance to sneak in without a risk.

                            Originally posted by Marko Polo
                            Also, if it's having a stack it should calculate which units to take from the stack to attack the enemy. Further, if it spots an unguarded enemy city it should be a very high priority to take that city.
                            The first problem I see is to make the AI to consider unguarded cities first.

                            Originally posted by Marko Polo
                            So how hard it is to implement this? Better to implement it in the source code or with SLIC?
                            Of course a good AI is an essential feature, of a civ game and therefore it belongs into the source code, and any slic code would be just a work around, that overwrites default AI behavior in a not very efficient manner. Sliced AI is always a battle against the builtin AI.

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

                            Comment


                            • #15
                              Originally posted by Martin Gühmann


                              Actual this is the way I prefer to implement. However calvitix went another way, with that I don't agree, namly bypassing the threat with a big detour, not very efficient, espeacilly if you consider that if you want to attack a city in the middle of an empire you have to find a way to sneak in and if you find it your enemy closes it, so no chance to sneak in without a risk.
                              -Martin
                              Does that mean that you and Calvitix are making your own versions of this concept and then we playtesters an verify which one is better? What's the method in this project to sort out the different opinions? Project manager? Voting?

                              Marko

                              Comment

                              Working...
                              X