Announcement

Collapse
No announcement yet.

Recruiting to do the best AI combat slic handler ever!

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

  • #16
    I'm willing to lend a set of fingers where necessary.

    My concern is that we can construct models complex enough that they don't become too obvious for the human to see and outwit.

    I was at one point meaning to focus the AI advance lists better. In fact, does that file actually work? Given that all the lists in the default files are the same, and other AI files do nothing, do we know if this one works properly? If not, it'll need its own workaround.

    What precisely the "City" module contain? Placement, build queues and specialists?
    This could require very close correlation with other modules. Should be good fun to code though
    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


    • #17
      Yes I think a lot of us a willing to lend a claw but all we need is some one to give the nod to what we are to code.
      "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


      • #18
        I plan to do some work on 3.1 this weekend.

        Comment


        • #19
          Great ideas!! I really like Locutus idea of completely re writing the AI in SLIC. But as he said this would need a lot of planning before the coding started.

          I'm willing to help with ideas and testing but my SLIC is very rusty and was never that good to begin with .
          Shores Of Valinor.com - The Premier Tolkien Community -

          Comment


          • #20
            Originally posted by child of Thor
            Tamerlin, i guess your fears could be addressed by making the AI 'cheats' dependant on the level you play at(a bit like now where the AI gets many more bonuses on the harder difficulty settings).
            I am playing at Very Difficult and about to test Impossible after a few more games. I have no problems about the advantages given to the AI as it is implemented in CtP2. But there are a few cheats I would not like to see in a CtP2 game whatever the level because I don't find that a game is funny when an AI uses such crude cheats. I would prefer an AI that is planning its attacks with the right mix of Flanking/Front/Ranged units, that is using planes efficiently and is able to attack across an ocean...

            I am not interested in an AI that is sending its settlers to a previously unexplored spot because a "cheat" is telling it there is a valuable resource here, I am not interested in an AI that knows exactly the number and quality of the defenders in my cities (unless it sends a spy)...

            Though the game would be harder I would found it a lot less funny because I really hate this kind of cheats... I don't like to face an opponent that is basing its strategies on informations it should not have.

            This is of course my two €-cents opinion on the kind of games I like and I know it is very hard to develop an AI that is not using such cheats...
            "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

            Comment


            • #21
              Originally posted by Turambar
              Great ideas!! I really like Locutus idea of completely re writing the AI in SLIC. But as he said this would need a lot of planning before the coding started.
              So lets do it. Indeed Locutus ideas were the best. Very much like what i had in mind. So i say lets do it.

              Originally posted by ahenobarb
              I plan to do some work on 3.1 this weekend.
              Good. Your ideas are terrific. So i hope to see the AI building good stacks too. But remember to make the things easily editable. The things that may chnge from mod to mod.

              "Passive personalities will build: 40% type a, 50% type b, and 10% c.
              Neutral personalities will build: 50% type a, 30% b, and 20% c.
              Aggressive personalities build: 60% type a, 10% b, and 30% type c."
              This is the main thing to discuss in your ideas. So remember to make it very much changeble.
              The rest of you ideas are already too good. Though they are too complex, specially the building of the 3 different types of stacks (probably making open the addition of other types would be great too. And a possible change in personality which i would like to implemeted. Remember to save the armies in arrays with all the data about it: Owner, type, etc... Keep always uploading it what you have. I want to check its evolvement very closely.

              Originally posted by Immortal Wombat

              My concern is that we can construct models complex enough that they don't become too obvious for the human to see and outwit.
              Actually formulas like the CheckCityValue as you can find in my slic for example uses variables that our impossible to be known by the human and the complexity of the formula cant be predicited. So i do believe that it will be very difficulty predicted unless if very time consuming.

              Originally posted by Immortal Wombat
              I was at one point meaning to focus the AI advance lists better. In fact, does that file actually work? Given that all the lists in the default files are the same, and other AI files do nothing, do we know if this one works properly? If not, it'll need its own workaround.
              I guess our knowlegde of working files isnt bigger than yours. The best would be to jus work with slic since we have plenty of controll over it. But i guess we dont have as many function for researching than other areas. But locutus diagram has a whole module for science in which we dont have much people working on it. Would you want to grab this module? If yes, gives us your ideas

              Originally posted by Immortal Wombat
              What precisely the "City" module contain? Placement, build queues and specialists?
              Placemement would be something good to work with it but i guess the use of the flag 'Score' in the terrain.txt if well adjusted may give some good placements. Indeed something good to work on if by slic or text.
              The build queue should be one of our main focus together with military and diplomacy of this project.
              We can mod the specialist distribution as you may know

              Originally posted by Immortal Wombat
              This could require very close correlation with other modules. Should be good fun to code though
              Actually the idea is to make the modules first and the correlation later. This will work well enough in this first stage. Since so far we have only few fronts: ahenobarb, with stack creation, and me, with moving units and map awareness work. So thats whay some more feedback from you guys that want to join us is important.

              Originally posted by Big Mc
              Yes I think a lot of us a willing to lend a claw but all we need is some one to give the nod to what we are to code.
              Good. Any interest in one of the Locutus module?

              Turambar, the lesser the cheats the better. But some our impossible. And some cheats will show up for sure. But as the project evolves they will be removed.

              And unfortunetly i bring the first best news When testing the GetContinentSize function of my slic i found out that the function
              Code:
              INT IsContinentBiggerThan(location,  size)
              indeed is broken as reported before. It always return true. So as my first work since the beginning of this project is to create a function to replace it. Probably also making the AI making some map awareness. By drawing in arrays the map. How? By traking the beaches and trenchs of the map.
              Whish me lucky and await some more info and feedback on this tomorrow. Since today I have got to sleep. But i wish to have something concrete this weekend
              "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


              • #22
                Originally posted by Pedrunn

                Good. Your ideas are terrific. So i hope to see the AI building good stacks too. But remember to make the things easily editable. The things that may chnge from mod to mod.

                "Passive personalities will build: 40% type a, 50% type b, and 10% c.
                Neutral personalities will build: 50% type a, 30% b, and 20% c.
                Aggressive personalities build: 60% type a, 10% b, and 30% type c."
                This is the main thing to discuss in your ideas. So remember to make it very much changeble.

                The rest of you ideas are already too good. Though they are too complex, specially the building of the 3 different types of stacks (probably making open the addition of other types would be great too. And a possible change in personality which i would like to implemeted. Remember to save the armies in arrays with all the data about it: Owner, type, etc... Keep always uploading it what you have. I want to check its evolvement very closely.
                The percentage variables will be desinged so that they can be changed and eventually they will be better if the percentages are based on different strategic states being adopted by the AI. So if it is on the attack or is surrounded by a powerful neighbor (high FEAR_MILITARY_RANK & FEAR_INVASION) the defensive stacks will increase while the AI prioritizes science in order to get some better equipment.

                Stack types will be changeable too, or more likely you'll be able to add different type stacks to the code. Each type will have a numeric flag (1,2,3). If you want a different type of stack use a flag 4 and define the new type of stack you want.

                Structuring the array properly is the key to getting this to work, so it will take some time to design.

                Originally posted by Pedrunn
                And unfortunetly i bring the first best news When testing the GetContinentSize function of my slic i found out that the function
                Code:
                INT IsContinentBiggerThan(location,  size)
                indeed is broken as reported before. It always return true. So as my first work since the beginning of this project is to create a function to replace it. Probably also making the AI making some map awareness. By drawing in arrays the map. How? By traking the beaches and trenchs of the map.
                Whish me lucky and await some more info and feedback on this tomorrow. Since today I have got to sleep. But i wish to have something concrete this weekend
                This gets back to the need to write better functions for looking at the map squares. GetNeighbor isn't capable enough. GetNeighbor of course is good for looking in the immediate circle around a location, but it would be good if there were a function that searched all the tiles in the production zone of a size 2 city, and then one for a size 3, size 4, and so on. These of course could be used to map terrain.

                A second feature I want to add to these functions is the ability to control the direction of the searches: top to bottom, bottom to top, left to right, right to left, spiral clockwise, spiral counter-clock wise. Sounds complicated, but its just mathematics and the results would be worth it.

                Comment


                • #23
                  Percentvariables will be desinged so that they can be changed and eventually they will be better if the percentages are based on different strategic states being adopted by the AI. So if it is on the attack or is surrounded by a powerful neighbor (high FEAR_MILITARY_RANK & FEAR_INVASION) the defensive stacks will increase while the AI prioritizes science in order to get some better equipment.
                  My willing is to do a GetThreatLevel(location_t ) right after the the continent mapping one.

                  Stack types will be changeable too, or more likely you'll be able to add different type stacks to the code. Each type will have a numeric flag (1,2,3).
                  Exacly what i had in mind

                  but it would be good if there were a function that searched all the tiles in the production zone of a size 2 city, and then one for a size 3, size 4, and so on. These of course could be used to map terrain.
                  I already have worked with such a function in the CityExpasion code. But the function is BlueO works.

                  A second feature I want to add to these functions is the ability to control the direction of the searches: top to bottom, bottom to top, left to right, right to left, spiral clockwise, spiral counter-clock wise. Sounds complicated, but its just mathematics and the results would be worth it.
                  But never worked with something like this Still using BlueO logics it can even be even a simpler function than blueO's ones that searchs all directions

                  The Continent mapping algoriyh i plan to use has the following algorith:

                  1) Scroll over all map searching a beach. Once done stop.
                  2) From this beach using GetNeighbor function map all beachs in one neighbor to another neighbor until finding and saving the arrays all beachs of the contitnent. (Note: Be careful to continents only one tile away from the other and continent aside map borders). Saving the location, the x-value and the y-value of these beachs. And the continent they belong (numeric flags)
                  4) After that do all again makin sure the beach that will be used for the mapping doesnt belong to a continent. This way all continent will be mapped.
                  5) It will be needed a simular function to that to map Oceans. But thats a bit harder for sure since many oces can be interconected.
                  6) GetContinentID(location_t) function. If there are in the contitnent array two beachs with the same X-value of the location and other two beachs with the same Y-value for the location. You've got a winner. So just get this contitnet ID.
                  7) IsSameContinent(location_t, location_t) fuction a simple GetContinentID(location_t) == GetContinentID(location_t).
                  8) GetContitnentSize(location_t) function. Very easily done after all that. Just search beachs in the same continent with same x-values. find the distance of those two. And um with the value of other x-values of the same continent.

                  Any other important function idea? Or critics for my algorithm (how do i spell this anyway)?
                  "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


                  • #24
                    Some idea, which Tamerlin and me discussed and we want to present it to you (also, to check, if it is possible):

                    Instead of having the AI cheating (like for the stack-count in cities):

                    Why not changing the vision-range to see the # of units in a city but not their composition? That would give the AI a possibility to calculate the 'strength' without cheating, the same function could be enabled for the human, though. And again, just the # of units, but not which units. If the AI could also take into account the science-level of a human, like for 5 rounds hoplite discovered so, max of 10% defenders = hoplite. That I think could increase the AI behaviour as well..................

                    Just some thoughts..........

                    Comment


                    • #25
                      Don't have much time right now, but I'll give you a very simple equation:

                      MakeLocation() + location[0].x + location[0].y + basic calculus = all the map manipulations you can dream of
                      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                      Comment


                      • #26
                        I've made a first version of the code i explained above. Indeed during coding i noticed that location[0].x and location[0].y will replace two of the arrays i was imagining. And MakeLocation, what slicer havent ever seen the combo:
                        Code:
                        	for(x = 0; x < GetMapwidth(); x = x + 1) {
                        		for(y = 0; y < GetMapheight(); y = y + 1) {
                        			MakeLocation(tmpLoc, x, y);
                        "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


                        • #27
                          Originally posted by Pedrunn
                          I've made a first version of the code i explained above. Indeed during coding i noticed that location[0].x and location[0].y will replace two of the arrays i was imagining. And MakeLocation, what slicer havent ever seen the combo:
                          Code:
                          	for(x = 0; x < GetMapwidth(); x = x + 1) {
                          		for(y = 0; y < GetMapheight(); y = y + 1) {
                          			MakeLocation(tmpLoc, x, y);
                          You mean the code example? Well in that case I not only saw it but I also did it.

                          Code:
                          HandleEvent(BeginTurnImprovements)'MG_ReplaceGoodImprovement'post{
                          int_t i;
                          int_t j;
                          int_t k;
                          int_t MGMapWidth;
                          int_t MGMapHeight;
                          location_t MGGoodLoc;
                          location_t MGUnitLoc;
                          	if (GetCurrentRound () <= 1) {
                          		MGMapWidth = GetMapWidth();
                          		MGMapHeight = GetMapHeight();
                          		for (i=0; i<=MGMapWidth-1 ; i=i+1) {
                          			for (j=0; j<=MGMapHeight-1 ; j=j+1) {
                          				MakeLocation(MGGoodLoc, i, j);
                          				if(HasGood(MGGoodLoc)>-1){
                          					for (k=0; k<=7 ; k=k+1) { //directions
                          						GetNeighbor(MGGoodLoc, k, MGUnitLoc);//look around
                          						FinishImprovements(MGUnitLoc);
                          					}
                          					MG_CreateGoodImprovement(0, MGGoodLoc);
                          				}
                          			}
                          		}
                          		DisableTrigger('MG_ReplaceGoodImprovement');
                          	}
                          }
                          And if you need another city radius checker code then check the Commerce Improvements for AIs code.

                          For the arrays you shouldn'T forget what happens if I do a /reloadslic the information in the arrays must be recreated. This could be achived easily if you put that code into a function that is called in a BeginTurn event handler and optional in a ClickedUnit event handler. Actual the ClickedUnit event handler is only needed if the code is also needed during the human turn.

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

                          Comment


                          • #28
                            Search Me...

                            Here are two of the new search functions I was discussing. There are several others that need to be done, but I wanted to share what I have so far.

                            The first one is:

                            Code:
                                  GetTile([loc], [tilenumber], [direction]);
                                                      ^
                                                  Your For loop
                                                counter number
                            When used in a for loop, it searches the immediate 8 tiles surrounding a location, much like GetNeighbor. However, you can choose the direction of the search. The available directions are in the read me. There are 11 different ones.

                            There was a problem getting SLIC functions to return a location, so I had to store the location in a global variable. When the function has been called, just make your Loc variable equal to GT0_RetLoc, like so:

                            Code:
                                       tmpLoc = GT0_RetLoc;
                            The second function is GetTile1, it searches all the tiles available for a city to use after it has expanded one time. The sytax is:

                            Code:
                                                   GetTile1 ([loc], [tilenumber], [direction]);
                                                                       ^
                                                                 Your For loop
                                                                 counter number
                            Again there are 11 search directions available. When you have used the function, set the value of your Loc variable equal to GT1_RetLoc, like so:

                            Code:
                                       tmpLoc = GT1_RetLoc;
                            See the readme.txt for more details.

                            Check the image below for a visual explanation of the search directions for the second function.
                            Attached Files

                            Comment


                            • #29
                              dp

                              Comment


                              • #30
                                Here is the image:
                                Attached Files

                                Comment

                                Working...
                                X