Announcement

Collapse
No announcement yet.

AI : Army Movement

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

  • #46
    Wow Ive genuinely never seen an AI win a game.
    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


    • #47
      I looked into it, and it looks like that the checks are at the right place, however the CheckIsDangerForPos doesn't look finished. One think to note is that the units aren't in danger, when the other one is an ally.

      Instead of this:

      Code:
      if (the_army->Num() > g_theWorld->GetArmyPtr(start)->Num())
      {
      	IsDanger = true;
      	break;
      }
      I would use this:

      Code:
      if (the_army->Num() > g_theWorld->GetArmyPtr(start)->Num())
      {
      	return true;
      }
      In this way you save the IsDanger variable and the function is immediately left, when it is determined that there is danger and not later when it was possibly a lot of times redetermined that there is danger. Of course doing this requires a return false at the end of the function.

      Another thing about I wonder is the purpose of the robotastar2.cpp file and why are the files MoveFlags.h and ctpgoal.h not in the file list.

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

      Comment


      • #48
        Originally posted by Martin Gühmann
        I looked into it, and it looks like that the checks are at the right place, however the CheckIsDangerForPos doesn't look finished. One think to note is that the units aren't in danger, when the other one is an ally.

        -Martin
        That was the second step I prepared (the code in comments). I had a problem with getting the diplomat global variable (when I include the diplomat.h, I have a lot of errors, I actually don't know how to solve them).


        About Code enhancement, I'll do it.

        About missing files in list, I was impatient to post the update, I don't check it twice. I'll do my best next time .

        Originally posted by E
        calvitix,

        Did you see any AI stuff that may make the AI seek out goods and defend good tiles or even try to take them from other players?
        No, I don't think there is anything in that way. We can perhaps add a bonus for the SEIGE goal if there is good in city range (or for particular building as wonder).

        Comment


        • #49
          Well and another in Scheduler.cpp thing I don't understand is this one:

          Code:
          #if !defined (ACTIVISION_ORIGINAL)
          	m_AllIsExplored = false;
          #endif
          m_AllIsExplored explored is not defined.

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

          Comment


          • #50
            Originally posted by Martin Gühmann
            Well and another in Scheduler.cpp thing I don't understand is this one:

            Code:
            #if !defined (ACTIVISION_ORIGINAL)
            	m_AllIsExplored = false;
            #endif
            m_AllIsExplored explored is not defined.

            -Martin
            Forget it... It's another leftover from tests I made (to avoid to regenerated the Explore goals when all the map is known - it doesn't work.)

            about robotastar2.cpp, it's also another try I made to resolve the problem of divised empire (when there is a foreign territory (with non-treaspassing) between two parts of empire, a lot of armies are blocked (cannot cross the foreign territory). I wanted to find a path although treaspassing treaty (so the AI can choose to violate the treaty or not to cross).

            It was an error, I didn't want to post those files...

            I promise I'll be more carefull on next files post...

            Comment


            • #51
              By the way you still use IsSpecialForces instead of VisionClass:Stealth to assign the armies to the new stealth explore goal.

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

              Comment


              • #52
                Two problems I saw are:

                1. I saw goals assigned to units that cannot reach a spot, because there is water on the way. They were stucked for ages.

                2. Another problem is that the AI doesn't build enough special units, I just saw one Slaver and only one city with a slave. Actual I wat to see cities with a lot of slaves. That way the AIs are more warmonger and not such peacy milksops.

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

                Comment


                • #53
                  Thanks for reports.

                  I'll Add them to my TODO list.


                  Here's a list of problems about sea transports :

                  1. Armies doesn't regroup before going into transport, so most of transport are not full.

                  2. Transport are very often attacked (they have to be protected)

                  3. Armies with Seige goals are unload too near to the enemy city (they are bombarded before they can be all regrouped)

                  4. The units in transport that have a defend goal aren't unload in the city (but stay in cargo)

                  I'm now working on those problems for the moment


                  Originally posted by Martin Gühmann
                  Two problems I saw are:

                  1. I saw goals assigned to units that cannot reach a spot, because there is water on the way. They were stucked for ages.
                  I think what you see (with armytext) is the last goal that have been tested for that unit (after the match cycle), I didn't write NO_GOAL anymore, because there was a problem with somme goals.

                  But there is still a problem : units have to have a goal each turn. (the problem is linked with the Match_Cycles,
                  we have to find a way to test all the possible matches without too much time consuming...)

                  2. Another problem is that the AI doesn't build enough special units, I just saw one Slaver and only one city with a slave. Actual I wat to see cities with a lot of slaves. That way the AIs are more warmonger and not such peacy milksops.
                  I didn't want to work on cities production for now (they is still a lot to do with army movement...), but I agree with you. We have to rebalance a little bit : all the AI are now aggressive)

                  Comment


                  • #54
                    any luck on sea stuff?
                    Formerly known as "E" on Apolyton

                    See me at Civfanatics.com

                    Comment


                    • #55
                      Originally posted by E
                      any luck on sea stuff?
                      Sooorry, I'm very busy these days...


                      I'm far to solve the problem... We'll have to change a lot of things, because the coders haven't think of grouping units from more than one continent.
                      As a result, each unit of the group calls its own transport unit.

                      For the moment I didn't have time to rewrite all the things, I just tried to work around the problem, but without success.

                      And I'm too busy at work for now, and I don't think I'll manage it this year.

                      So please be patient, or maybe another developper can have a look at it.

                      Comment


                      • #56
                        If I'm reading this correctly, the "sea" issue is the lack of coordination between islands and continents.

                        Sounds like we'd need to make a global manager and then make manager instances for each island/continent that the AI has units (or cities) on.

                        I haven't really looked over the AI code so I have no idea if this is able to be added within the context of this game. I'm just brainstorming.

                        Comment


                        • #57
                          Tempus,

                          You may also find the following thread of interest: http://apolyton.net/forums/showthrea...hreadid=117475

                          Especially the post by Martin Guhmann where he attaches a partially complete set of scripts to make the AI properly invade overseas, etc.
                          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


                          • #58
                            Originally posted by Solver
                            Especially the post by Martin G[ü]hmann where he attaches a partially complete set of scripts to make the AI properly invade overseas, etc.
                            Well that script is an attemp to do it, but the oversea invasion part is not finished, and therefore it doesn't work. But conquering on the same continent does work.

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

                            Comment


                            • #59
                              Can any one of you help me check where the ai picks the destinations for exploration goals? I can't find that in the code (I am unfamiliar with the code structure).
                              Clash of Civilization team member
                              (a civ-like game whose goal is low micromanagement and good AI)
                              web site http://clash.apolyton.net/frame/index.shtml and forum here on apolyton)

                              Comment


                              • #60
                                Sounds like you're looking for CtpAi::AddExploreTargets.

                                Comment

                                Working...
                                X