Announcement

Collapse
No announcement yet.

Frenzy AI revisited (v 2.1)

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

  • #16
    Originally posted by Solver
    OK, that all sounds good. Determening when the ships are full is easy with the new SLIC functions, so I can't see why wouldn't you post the script so someone could improve it and get it it completed, like Bert, as said!

    Come on, do so .
    You should give me some time to put it together.

    However it is some kind of GoodMod, something beyond version 1.0. The files are for CTP2 v. 1.1 Activisions original patch, therefore I did not removed the soundfix slic and moved it into the tileimp.txt, terrain.txt is also the original version, and of course a lot of strings for the playtest version are missing. const.txt should need some modification to make it work with our playtest version. I tweaked a little bit the unit.txt so that is now true tanks != super weapon. The government determination code doesn't work without a modified govern.txt, the strategies.slc needs an modified strategies.txt but it keeps the AI from settleing and conquering when it has gone over the city limit. I didn't check if I disabled frenzy and player1's pw cheat, frenzy and pwcheat should be disabled and I think the modifications are only in place for GoodMod for ApolytonPack, so don't expect a strong AI when using the MedPack version, and of course it is not tested that I include all the necessary files.

    And another thing if you want to use it with the playtest version. Peter messed around with the ConsiderNewProposal function therefore the argument list that is used in Diplomod doesn't match anymore with the argument list by our playtest version.

    And finally the pack comes without a readme and of course you are on your own.

    -Martin

    GM11A.zip
    Civ2 military advisor: "No complaints, Sir!"

    Comment


    • #17
      Wow, that's a whole mod in there. I imagined it would be only a SLIC script file, like Frenzy.

      Let's see if an idiot without modding experience like me can get it to work even .

      And I really hope that Bert will also decide to poke around with the file and maybe bring it to the conclusion it needs.

      Thanks, Martin .


      Edit: A question - does this thing, otherwise, work as GoodMod? That is, can I unpack this atop of CtP2+SAP2 after a clean install?
      Solver, WePlayCiv Co-Administrator
      Contact: solver-at-weplayciv-dot-com
      I can kill you whenever I please... but not today. - The Cigarette Smoking Man

      Comment


      • #18
        Originally posted by Solver
        Wow, that's a whole mod in there. I imagined it would be only a SLIC script file, like Frenzy.
        Well that would be preferable, but remember CTP2 v.1.1 has no way to figure out the current government of a player. Therefore I used these to figure out the players government salery, food and workday level. The disadvantage of this is that these three values must be unique for each government you have in the database. In comparison to Dale's way I think it is a cleaner solution.

        For the air units I used a solution by Peter I just modified one function to get rid of the PowerPoint system. So Why adding it to my script if it is already there.

        And another aspect is formed by the AI strategies. I added some code that reduces the settling activity and conquering activity, when the AI is over the city limit.

        [QUOTE] Originally posted by Solver
        Let's see if an idiot without modding experience like me can get it to work even .

        And I really hope that Bert will also decide to poke around with the file and maybe bring it to the conclusion it needs.

        Thanks, Martin .


        Originally posted by Solver
        Edit: A question - does this thing, otherwise, work as GoodMod? That is, can I unpack this atop of CtP2+SAP2 after a clean install?
        It is designed for GoodMod and without some modifications it doesn't work, you need the govern.txt from GoodMod. And also the Ai strategy change should also be done, it doesn't make any sense when the script is in non conquering mode while the AI's strategy is still in conquering and settling mode. Otherwise you have to include the script into the Apolyton APOL_script.slc and of course make sure that the script is included int the according XXX_script.slc of the version of GoodMod you are currently using. I can tell you at least that it is not part of the MedPack version.

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

        Comment


        • #19
          Sorry for my absence, I am not feeling very productive these days due to the strange weather here in Vienna
          But I've managed to download Martin's latest developments and take a brief look at them. As far as I can see most of the SLIC is basically already present in GoodMod/BetterAI.
          The most interesting new SLIC file is of course the *big huge* MG_Functions.slc with loads of extremely interesting functions that would certainly be useful as a basis for the development of tactical concepts. Though some things already are/will probably be integrated into the source code (by Martin himself ) like governments or continent-id's (at least I vaguely remember having read about it in the altered source files thread) there still remain lots of "terrain, city, unit etc."-checking functions that should IMHO remain user-defined since different modders might have different ideas about what e.g. IsGoodLandForSettling().
          Nonetheless when I put together that "Common functions file" for my project I came up with the idea of putting together something like an "Apolyton Common SLIC Library" similar to the "Apolyton Tile File", which contains the most elaborate, efficient, working, "clean" ... versions of all those functions every serious modding project tends to need at some point . This would be some organized way of stealing from each other and would prevent the reinvention of the wheel due to ignorance of existing solutions.
          I haven't yet explored all of the Call To Conquest SLIC (Martin seems having done so) but I am sure it contains some interesting tactical concepts, too.
          As for military strategy and tactics (and this is the original topic of this thread, somehow ) two aspects seem most important to me:[list=a][*] This one isn't new but needs to be mentioned: The AI's military strategy needs to be backed by some general idea of the geographical, economic and diplomatic/"political" situation. CTC's approach as far as I have seen in the SLIC files is mainly "geographical threat". What I have seen so far from Martin's new code suggests that "geographical awareness" is a major concern to him, too. The same goes for myself, I have been experimenting so far in favoring a peaceful but well defended, exploring, settling and "building" AI that realizes when it has reached the limits of peaceful development and then seriously considers and undertakes military action. Well it's a matter of fact that I like full-fledged warfare (with knights or tanks, that doesn't really matter, though I do prefer tanks ) when I can see some rationality in being attacked or having to attack another player, but I dislike at least as much having to struggle around with some spearmen for centuries for no other apparent reason but sharing a continent with an AI. I really hate AI's for attacking me restlessly while not settling on the huge landmass still waiting for them.[*] The second one hasn't yet been mentioned too often: Concerning military tactics and the AI's concept in general I think it's not only strength (in terms of production and loads of 12-stacks) but also variety of tactics that makes the AI an interesting and challenging opponent to the HUMAN. That's why I would like to experiment with applying as many tactical concepts as possible (each one a good concept per se regarding e.g. "land army movement", "naval tactics" and "air tactics") in different situations, chosen by some rationality that still needs to be developed at the "backend" of let's say economic, political ... choices but also somewhat "randomly", so that the HUMAN player cannot entirely predict the AI's next steps (which used to be the major "bug" with good old Frenzy as far as I am concerned: You just knew they would show up next to your closest city with a 12-stack as soon as they had built the 12 extra units).[/list=a]
          What I am experimenting with so far is introducing different "modes" for the AI depending on their geographical, (scientifical, diplomatical, economical) situation and accordingly applying different military (but also diplomacy- and settling-) concepts (i.e. scripts). What I have so far ist still a pretty rough concept trying to integrate what we have so far and I got stuck with getting that working at all, but if the Apolyton Edition lets me I am willing to continue and some day refine this concept. When as many good, particular concepts as possible are in a Mod you can use BetterAI to make them stack their armies, keep them off blocking each other and the roads, load their ships etc., you can use (a continuously improved version of) Frenzy AI to make them launch a major military campaign when needed (my TaskNumberOne-function is one attempt in this direction, in the context of a complex Mod additional uses for "Frenzy" armies could be thought of) - and you can use other concepts to make them use their armies differently when needed or just for the sake of variety. The same goes for different navy and air force concepts.

          Interesting enough that Martin came up with a kind of "AI-modes", too. Well finally, apart from different preferences in many regards we all stumble across the same conceptual "nodes". So we are still on the way to create "the best of all worlds", and when we have it, everybody will Mod it to his taste again .
          The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

          Comment


          • #20
            Wow that's insightful . You post many things that are good in perspective, but I'd like to repeat that, even if the AI would only be taught to invade other landmasses, I would already be happier. It's simple things like this that make the Civ 3 AI competetive - it will regularly send Transports to your landmass to harass you with troops.

            And somehow, when playing CtP2 now, I don't notice the effect of AIs declaring just for the sake of it, probably because of using the fixed Frenzy code. Now, if you're nice to the AI and do some diplomacy, you can very well coexist on one landmass. It's better to have an army, but no longer you'll be attacked ridicilously.
            Solver, WePlayCiv Co-Administrator
            Contact: solver-at-weplayciv-dot-com
            I can kill you whenever I please... but not today. - The Cigarette Smoking Man

            Comment


            • #21
              Originally posted by BureauBert
              As far as I can see most of the SLIC is basically already present in GoodMod/BetterAI.
              Not quite true. MG_BetterAI.slc uses now a lot of stuff from MG_Functions.slc. These slic functions are just put into a libary. Most of the functions in MG_BetterAI.slc are obsolete, and I was going to remove them. Who needs functions like IsLandSettler if one has such a nice function by Peter Triggs that can determine the unit's type. However I modified this function to get rid of the PowerPoints system that allows more mod indepence.

              Originally posted by BureauBert
              Though some things already are/will probably be integrated into the source code (by Martin himself ) like governments or continent-id's (at least I vaguely remember having read about it in the altered source files thread)
              Actual Peter did the government field for the player array.

              Originally posted by BureauBert
              there still remain lots of "terrain, city, unit etc."-checking functions that should IMHO remain user-defined since different modders might have different ideas about what e.g. IsGoodLandForSettling().
              That's actual defined by the terrain values that we cannot access by slic so far.

              Originally posted by BureauBert
              The same goes for myself, I have been experimenting so far in favoring a peaceful but well defended, exploring, settling and "building" AI that realizes when it has reached the limits of peaceful development and then seriously considers and undertakes military action. Well it's a matter of fact that I like full-fledged warfare (with knights or tanks, that doesn't really matter, though I do prefer tanks ) when I can see some rationality in being attacked or having to attack another player, but I dislike at least as much having to struggle around with some spearmen for centuries for no other apparent reason but sharing a continent with an AI. I really hate AI's for attacking me restlessly while not settling on the huge landmass still waiting for them.
              The settling priority is defined in strategies.txt you just need to set the settling priority very high and the map will be filled with AI cities.

              Well for diplomacy I came to the conclusion that if the human player manages to keep an peace treaty with the AI that the human player has a lot of time to arm up and beat the AI then. Maybe it should be easier to achieve piece with my script, because with my script the AI won't be helpless if you declare war on it.

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

              Comment


              • #22
                For bureaucratic reasons (keeping this thread on topic) I opened a new thread to discuss the settling issue, which I think merits a thread of its own : Controlling Settlers?
                Last edited by BureauBert; July 7, 2004, 16:21.
                The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

                Comment


                • #23
                  Interesting stuff BureauBert et al.

                  Martin: you said you had some AI script for the playtest before anything on that?

                  Stan and anyone else: how much of this was incorporated in to AoM frenzy (its at frenzy9 now?). Is BB's stuff obsolete concerning some of the changes done by AoM?
                  Formerly known as "E" on Apolyton

                  See me at Civfanatics.com

                  Comment


                  • #24
                    Bureaubert,

                    not sure you are around but I did a run with your frenzy21.slc. The barbarians were making of the most of kicking some serious a$$. However, my neighbor I seized there capitol and there two warriors moved around without attacking, i think its because I had a hoplite and a swordsman there that would have more power. the other thing I think was that they were pretty weak on units so ididnt witness an attack.

                    but does this frenzy have the same weakness of leaving only one unit in a city? it seemed so.

                    that brings me to my other point. Is it possible to make a frenzy defender slic? by this maybe the first two stacks it builds are frenzy attackers and the third one one is a stack of defenders and moves to the city closest to the enemy to defend it. that way the AI builds up defenses on its borders.




                    Granted this may leave it open to the indirect approach but hopefully it can detect it and send a stack to it.
                    Formerly known as "E" on Apolyton

                    See me at Civfanatics.com

                    Comment


                    • #25
                      Hi E!

                      I am still lurking around from time to time

                      they were pretty weak on units so ididnt witness an attack
                      There is indeed a FAI_AttackSize[], initially it's 4 and it grows as the AI builds bigger stacks. Of course you can tweak this to fit your taste in the slic file

                      Actually my idea was that the whole Frenzy stuff becomes more interesting and useful for the AI in later stages of the game - when more units are around and "Frenzy" tactics can be combined with other - eg. "Better AI" tactics.

                      weakness of leaving only one unit in a city
                      There is also a FAI_GarrisonCity event handler, which "unfrenzies" and entrenches the Frenzy army after having captured it's target city - at least it's supposed to do so. But there is no method of providing backup-troops as a garrison - so the garrison will be whatever is left of the (former) "Frenzy" army.
                      The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

                      Comment


                      • #26
                        awesome, then it was probably due to their lack of units. I'll play more and see how it develops. I was testing it out for my civ3 mod and I had to do some tweaking and balancing.
                        Formerly known as "E" on Apolyton

                        See me at Civfanatics.com

                        Comment


                        • #27
                          I did not notice this thread until now.

                          Locutus helped me get started an now my frenzy file is at least 3 times larger than the cradle original.

                          This first thing we did was make an ai attack when it got to target. Then we made frenzy move subject to diplomatic state. The problem there is once you get agreements with the ai, you should be able to kep them

                          I have now added ai breaking agreements once the human is too aggressive, increaseing/decreasing frenzy for religion, probably 20+ ways for frenzy to go up or down and ai wars start to slow down or stop altogether once the human reaches the stage of being a Hitler/Napoleon.

                          Comment


                          • #28
                            Bureaubert,
                            I did some more initial testing for my civ3mod and although the AI didnt have stacks (again too early) it was pretty aggressive so I figure as I play more it will do well (in cheat mode i saw that it did a lot of wars against other AI elsewhere so the code looks great)

                            Stan,
                            I would have loved to put AoM frenzy in my civ3 mod but you said it uses 6 files and its hard to find them all.
                            Formerly known as "E" on Apolyton

                            See me at Civfanatics.com

                            Comment


                            • #29
                              AI didnt have stacks ... it was pretty aggressive
                              Well I am not sure if the "aggressiveness" you observed is due to the script. As soon as the AI has built it's first 4-stack it should throw it against it's worst enemy's "most at risk city". If all "regular" civ's are above "hot war level" in terms of "effective regard" the AI will consider good old barbs being their worst enemy.

                              So if you are observing an AI attacking with at least 4-stacks it's most likely due to the Frenzy script, if they are just throwing waves of single spearmen against their opponents something is going terribly wrong as per default .

                              A NOTE: Frenzy script does not much for helping the AI in grouping stacks -- it mainly controls their use of some of their existing stacks. In my own modding project I integrated Martin Gühmann's "Better AI" script to do the basic work of making the AI build their armies. Generally I think that even an improved Frenzy script can only complement a framework of "AI tactics"-scripts.

                              And of course the effect of Frenzy script depends pretty much on how everything else is set up in your mod - for example: how long it takes to build which types of units in which stage of the game and how many units the AI will actually build. If units are cheap, and the AI is tweaked to build a lot of units and to keep strong garrisons in their cities from start, an initial value of 4 for a Frenzy stack might result in a terrible waste of Frenzy armies and the initial value should probably be set to 8 or 10 -- or even 12. On the other hand: If it takes a long time to build units, the AI in your mod is not that much focused on building units (as opposed to buildings and wonders), exploration is set to a high priority (AI sends out lots of single units that will never stack) and you set the initial Frenzy stack size to 12 you will need to wait a little until you see their first Frenzy army -- if ever before you win the game .

                              a lot of wars against other AI elsewhere
                              Even if this observation in your test game is not actually related to the use of Frenzy script -- it is designed to encourage this kind of AI behaviour . We owe this improvement to Pedrunn (Frenzy behaviour tied to diplomatic regard instead of "all AI against the HUMAN's closest city").
                              The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

                              Comment


                              • #30
                                bureaubert,

                                still testing. I found messing with the strategies is helping out too (defense and offense) you might want to package something with that.

                                Also I recall that you had a visible capitol slic before but cant find it on your site, could you post a link?
                                Formerly known as "E" on Apolyton

                                See me at Civfanatics.com

                                Comment

                                Working...
                                X