Announcement

Collapse
No announcement yet.

Civ Rev Mod

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

  • Civ Rev Mod

    Seeing the new Cradle 2 victory condition reminded that the AI has never beat me to any victory, so I thought I'd try some other victory conditions and see if the AI could complete them more easily. I decided to see if I could make the victory conditions from CivRev using SLIC, and gradually I turned this into a full mod and this is what I've got so far.

    The game lasts around 200 turns, from 4000BC to 2100BC, so things are a lot faster, and includes all the techs, units, buildings, wonders and governments from CivRev (although not all have the same bonuses). There are only 5 players and the map is much smaller. Because of the faster game I removed pretty much everything that requires micromanagement, like pollution and un/happiness, that slows down the movement of the game. Don't worry, it's not as bad as it sounds.

    Victory conditions:

    Economic: there are 8 economic milestones, you reach a milestone by saving a certain amount of gold. The first milestone is 1000 gold, the last will probably be around 100,000. For each milestone reached you get some kind of bonus, the 1st milestone gives a free settler for example. You can only reach each milestone once. After the final milestone is reached you can build the World Bank wonder and win.

    Cultural: certain buildings (temple +1, cathedral +2) and wonders (+5) built add to your culture per turn count, this count is added to your total every turn. When you have a total culture of 1000 you can build the United Nations and win. The important difference from CivRev here is that you can't capture cities for cultural buildings/wonders and get the culture per turn. Only the builder gets the benefit.

    I may or may not try to put some form of "great people" into the game, to further benefit cultural players. I will definitely not try to put culture flipping in though, because a) it's a bit stupid, and b) I'm not sure I can do it good enough.

    Conquest: you must control 5 palaces (capitals). This is basically a shorter version of normal conquest that is reachable before the game ends.

    So far the AI can complete the economic and cultural victories quite often, but the biggest problem at the moment is the AI not attacking very well. Once that is sorted it should be much harder for the human to juggle everything. Fighting the war mongers, while preventing the cultural and economic personalities from winning, and trying to win themselves.

    In this (not very interesting) screenshot the player has built 2 temples (+1 culture each) and a wonder (+5), which gives 7 culture per turn, and reached the first economic milestone for saving 1000 gold:

    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.

  • #2
    Re: Civ Rev Mod

    Originally posted by Maquiladora
    So far the AI can complete the economic and cultural victories quite often, but the biggest problem at the moment is the AI not attacking very well. Once that is sorted it should be much harder for the human to juggle everything. Fighting the war mongers, while preventing the cultural and economic personalities from winning, and trying to win themselves.
    You could try it with the executable you can compile from the latest revision, this should have some improvements, although it could have some more improvements, but this should make a difference. For the AI problem in VC2008 I think it has to do with adding new player from revolts. So let's see if you can see here something.

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

    Comment


    • #3
      I updated the code to revision 890 but I got 4 errors and 38 warnings compiling ctp2, the rest are fine. Here is the log for it:
      Attached Files
      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 Maquiladora
        I updated the code to revision 890 but I got 4 errors and 38 warnings compiling ctp2, the rest are fine. Here is the log for it:
        Trying to compile ambiguous code that just isn't ambiguous. Anyway, I removed the compiler errors.

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

        Comment


        • #5
          Originally posted by Martin Gühmann

          Trying to compile ambiguous code that just isn't ambiguous. Anyway, I removed the compiler errors.
          Thanks Martin, it's compiling fine for me too now.

          I've ran a few tests with the latest revision and the AI does seem o be more active at giving lots of different goals, and changing it's mind often. It will now form large armies too. Although they couldn't seem to keep their goal long enough to reach a city and attack, and eventually the army would be broken up for garrison somewhere. I will look into that, I haven't tweaked any goal settings at all yet.

          I had one freeze and crash while watching the AI but the crash.txt didn't have anything in it except the version date. I'll try a longer test without the mod to see if I can repeat it with the default game.
          Last edited by Maquiladora; August 17, 2008, 07:48.
          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


          • #6
            Re: Civ Rev Mod

            Some thoughts...
            I'm assuming that you are doing this via SLIC. If so...

            I'm also interested in, with your permission, possibly adapting some of this to my setup for Cradle in an altered format.

            Cultural: Rather than assign points to the cultural buildings on a turn by turn basis with unlimited buildings (if you have 40 cities, you could accumulate a lot of points because of the sheer number of buildings you could potentially construct), it would assign points once you reached (for the sake of argument, say 10) buildings of a particular type, BUT you do not gain more points by constructing more of that type of building.

            Build 10 temples, and the points start kicking in. Build an 11th temple and you still get your regular points, but you do not get additional points.

            This would not force a player into a 'Bigger is Better' playstyle to win the game.

            I could adapt the setup to include a variety of building types (theatres, forums, courthouses) like you do., and bonus points could be gained by building specific wonders.

            Because of the way CTP2 works on the higher levels, the AI invariably gets to the techs before the player. It can build up an unsurpassable cultural number because of a cumulative effect. By starting the numbers once you get your 10 buildings, it allows the player a chance to win.

            Economic: It's a good concept, but this probably would not work with the way I have Cradle set up for gold.

            Military: From what I see with the AI, this would be impossible for it to achieve. It lacks the focus to target multiple cities, let alone specific capitols.
            Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
            ...aisdhieort...dticcok...

            Comment


            • #7
              Originally posted by Maquiladora
              I've ran a few tests with the latest revision and the AI does seem o be more active at giving lots of different goals, and changing it's mind often. It will now form large armies too. Although they couldn't seem to keep their goal long enough to reach a city and attack, and eventually the army would be broken up for garrison somewhere. I will look into that, I haven't tweaked any goal settings at all yet.
              Unfortunately, tweaking the goals won't help help, since this is a problem with the garrison assignment. When the AI matches its armies to goal it uses also those that should stay inside the cities. In the code the is a move out garrison troops prevention. That cripples the AI, I still have to figure out how I can program this properly. At least when I disabled that, I unlashed something. Unfortunately, the AI left all its slaves unguarded behind.

              Originally posted by Maquiladora
              I had one freeze and crash while watching the AI but the crash.txt didn't have anything in it except the version date. I'll try a longer test without the mod to see if I can repeat it with the default game.
              Well, in that case it is good to have a savegame from the beginning and restart from there. If there is no human interference the AI will do exactly the same things.

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

              Comment


              • #8
                Originally posted by Martin Gühmann
                Unfortunately, the AI left all its slaves unguarded behind.
                - Militia SLIC code...
                - Increase the number of slaves a single garrison unit could control.
                - The other thing you could do in this area is downplay the AI's slaving ability, while increasing the cost of Slavers a lot.

                If the player wants slaves, he would have to pay through the nose.
                Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
                ...aisdhieort...dticcok...

                Comment


                • #9
                  Originally posted by hexagonian
                  - Increase the number of slaves a single garrison unit could control.
                  - The other thing you could do in this area is downplay the AI's slaving ability, while increasing the cost of Slavers a lot.
                  That doesn't help if you cripple the Garrison code instead of fixing it. The AI would nevertheless move out all its units.

                  Originally posted by hexagonian
                  If the player wants slaves, he would have to pay through the nose.
                  If you want slaves then you have to accept that other players on the map want slaves, too. So I like it how it is now. Just garrison needs to be fixed and maybe some AI balancing and we can release our next playtest version.

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

                  Comment


                  • #10
                    Re: Re: Civ Rev Mod

                    Originally posted by hexagonian

                    Build 10 temples, and the points start kicking in. Build an 11th temple and you still get your regular points, but you do not get additional points.
                    I'll have to think about the best way to do it but I'm sure I can do it.

                    How do you want to handle the selling/capturing/destroying of buildings and wonders? As in this mod buildings are unsellable and cities cannot be destroyed, so all wonders and buildings stay forever, continuing to generate culture for their original builder (whether they still own it or not).

                    What happens for example if a player builds 10 temples for the culture per turn bonus, then later one temple is destroyed in an assault?

                    Also the culture is added to the culture per turn counter only when a building/wonder is completed (createbuilding/wonder event). So the code I've written is very simple at the moment. It doesn't track how many of each building or wonder a player has each turn. If you want it to do that it will require a bit more work, but then you would be able to remove destroyed/sold buildings/wonders from the culture per turn counter.

                    It would also be easy to create another function to add a lump sum of culture to total culture (not per turn). perhaps for achieving a feat or something.

                    Economic: It's a good concept, but this probably would not work with the way I have Cradle set up for gold.
                    I had to stop economic AI's rush buying, so they would actually save gold. Then they also need to spend on unit upgrades, espionage, diplomacy etc.

                    Military: From what I see with the AI, this would be impossible for it to achieve. It lacks the focus to target multiple cities, let alone specific capitols.
                    This is a more human thing, to stop the game dragging out if the human wants to win via conquest. I doubt I would ever let the AI capture my capital to win. I would expect the human to quit before it came to that anyway.
                    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


                    • #11
                      Originally posted by Martin Gühmann

                      Unfortunately, tweaking the goals won't help help, since this is a problem with the garrison assignment. When the AI matches its armies to goal it uses also those that should stay inside the cities.
                      Ah, so that's why that was happening.
                      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


                      • #12
                        Re: Re: Re: Civ Rev Mod

                        How do you want to handle the selling/capturing/destroying of buildings and wonders? As in this mod buildings are unsellable and cities cannot be destroyed, so all wonders and buildings stay forever, continuing to generate culture for their original builder (whether they still own it or not).

                        What happens for example if a player builds 10 temples for the culture per turn bonus, then later one temple is destroyed in an assault?

                        Also the culture is added to the culture per turn counter only when a building/wonder is completed (createbuilding/wonder event). So the code I've written is very simple at the moment. It doesn't track how many of each building or wonder a player has each turn. If you want it to do that it will require a bit more work, but then you would be able to remove destroyed/sold buildings/wonders from the culture per turn counter...

                        It would also be easy to create another function to add a lump sum of culture to total culture (not per turn). perhaps for achieving a feat or something.
                        I did some more thinking, and after looking at how Cradle usually plays itself out, I came up with a slight change.

                        Rather than have the counter kick in after 10 buildings of a particular type is built, I would like it capped at a maximum of 10 buildings, So the 11th building of that type would not add anything...and Bigger is Better does not play a role.

                        You would still accumulate points as soon as you create a new building, same as what you have in your Mod now.

                        Augmented with points for specific wonders.

                        The reasoning...in my games, I can always meet the Theatre Feat before the AI, and it is the same for my Birth of an Empire building requirements. So I'm figuring that the player can meet every building requirement before the AIs...if it is first based on meeting a total number requirement.

                        I will have to think about how many buildings will be the requirement, as well as which ones to focus on. Cradle tends to be heavily- military unit creation in the early game (as well as targeted wonders and settlers). Once you get a stable core, then you concentrate on buildings.

                        With your code, I can see the dilemma for the player to consider creating some of those buildings in the early game to set up for a Cultural win.

                        I'd like the player to own the building, and if he falls below the min number, he does not get the turn-by-turn benefit until he gets back above the number.

                        The determining factor will be ownership, not who created it.

                        Usually in Cradle, captured cities end up losing many of their buildings because of the assault code, so transference of ownership may not happen all that much.

                        And if the code can be adapted for the achievement of feats, that would work too. All of my ingame religions are Feats, so it would be an extra award for reaching them first. And in this area, the AIs generally beat me to the religions. I was only able to get Christianity in my last game, and only after making it a priority.

                        Can the player monitor how the AI's are doing in the game in their score without resorting to cheat mode? In your screenshot, you only have one player's score.

                        There is no rush on this...I'm in the middle of a good game now, and I usually do not playtest one game and play another one at the same time.
                        Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
                        ...aisdhieort...dticcok...

                        Comment


                        • #13
                          Re: Re: Re: Re: Civ Rev Mod

                          Originally posted by hexagonian

                          You would still accumulate points as soon as you create a new building, same as what you have in your Mod now.

                          ===

                          I'd like the player to own the building, and if he falls below the min number, he does not get the turn-by-turn benefit until he gets back above the number.
                          OK let me use an example to make sure we are both on the same page.

                          I have 15 cities and I have built a shrine in 9 of the cities. One shrine BUILT is worth 7 culture total (CT). 10 shrines is the culture per turn (CPT) cap for shrines which I must reach to get the per turn benefit, which is +10 CPT. So I currently have (7*9) 63 total culture and 0 culture per turn.

                          - If I build two more shrines to get 11, I will get +14 to CT for the two shrines BUILT, and the CPT benefit of +10 per turn will start, for controlling 10 shrines.

                          - If I lose two shrines*, I'll only have 9 shrines and will lose my +10 CPT. I will NOT lose the +14 for building the two shrines though.

                          *(either via city capture, selling, or destroyed in assault, bombard or nano attack, disasters?)

                          In summary it means the builder of a shrine is the cultural "father" and gets an instant culture boost but no per turn effect. Only the owner of shrines will get a per turn effect, as long as he controls at least X many shrines.

                          Usually in Cradle, captured cities end up losing many of their buildings because of the assault code, so transference of ownership may not happen all that much.
                          I'll have to check some other code to see how best to track each building. I have an idea how to do it though.

                          And if the code can be adapted for the achievement of feats, that would work too. All of my ingame religions are Feats, so it would be an extra award for reaching them first.
                          There is already a couple of functions in the code to add to the culture per turn counter, or add to total culture, so you just need to use this on an AccomplishFeat event.

                          Can the player monitor how the AI's are doing in the game in their score without resorting to cheat mode? In your screenshot, you only have one player's score.
                          At the moment I have the score message triggered to pop up when the human opens the empire manager. A message is sent for each player in the game showing their score details, but this is just set up like this for me to monitor them all.

                          I would have to change it to get the information of all players in one message, it might not fit or look messy with 8+ players though.

                          If it doesn't fit perhaps you could have regular updates or warnings of other civs reaching landmarks, and keep the triggered message just for the human's score.

                          There is no rush on this...I'm in the middle of a good game now, and I usually do not playtest one game and play another one at the same time.
                          Well I'll see what I can do, because I might also use it in this mod if it works well.

                          I still have my Cradle game going too. 200 turns so far, I usually finish about 50 turns a session, unless I need to finish someone off.
                          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


                          • #14
                            Originally posted by Maquiladora
                            In summary it means the builder of a shrine is the cultural "father" and gets an instant culture boost but no per turn effect. Only the owner of shrines will get a per turn effect, as long as he controls at least X many shrines.
                            yep!



                            Originally posted by Maquiladora
                            At the moment I have the score message triggered to pop up when the human opens the empire manager. A message is sent for each player in the game showing their score details, but this is just set up like this for me to monitor them all.

                            I would have to change it to get the information of all players in one message, it might not fit or look messy with 8+ players though.

                            If it doesn't fit perhaps you could have regular updates or warnings of other civs reaching landmarks, and keep the triggered message just for the human's score.
                            I'm just interested in having a running tab on the total culture points a rival civ has, so I know if I am ahead or behind them. The breakdown is nice but not necessary, if you cannot get it in.



                            Originally posted by Maquiladora
                            I still have my Cradle game going too. 200 turns so far, I usually finish about 50 turns a session, unless I need to finish someone off.
                            Any thoughts so far???? Steal or borrow whatever features you want to use for your setup.
                            Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
                            ...aisdhieort...dticcok...

                            Comment


                            • #15
                              Originally posted by hexagonian

                              yep!
                              Well I already got that part working. I just hope it's not so slow the way I've implemented it. There is a lot going on in Cradle already so it's important it should be fast as possible.

                              It goes like this: at the beginning of each players turn it searches for the amount of a certain building(s) a player owns. If it's above the limit the bonus is added to the per turn bonus, if it's below, it removes it (if it's already added).

                              Then finally it adds the per turn culture (which includes all building and other bonuses) to the total culture. So it takes into account all buildings built that turn. If you lose or gain a building (in the middle of a turn) that affects a bonus, you would have to wait for the next turn to see a change in the bonus score. Perhaps I can change this, but there are many ways to gain/lose a building so it could cause slowdowns, at least the way I have it now.

                              My concern with this is obviously searching for all the buildings. In the test I set up with the default game I have it searching for 6 types of building each turn for each player, and it has very little slow down with 8 players, beyond the first turn to set up the array anyway.

                              I also haven't tested the code with a revolution to make sure it tracks the new player properly, I'll check that later.

                              If anyone has a better way to keep track of the buildings a player owns though, please tell me.

                              Also for anyone that knows SLIC better than me: for some reason I couldn't create a function with a building for use with CityHasBuilding. I kept getting a wrong variable type error when using it with the building input. Obviously I don't know how to convert the input from the function to something CityHasBuilding could use. I ended up just using a separate function for each building, with the only input being the player. If there is an example of how to do this, or could someone show me?

                              I'm just interested in having a running tab on the total culture points a rival civ has, so I know if I am ahead or behind them. The breakdown is nice but not necessary, if you cannot get it in.
                              Just the total should be doable all in one message, perhaps per turn figure too. 16 players should be fine, anyone crazy enough to use more it can be expanded to two messages.

                              Any thoughts so far???? Steal or borrow whatever features you want to use for your setup.
                              No thoughts so far, but I'm not into the meat of it yet. I'm planning for the new victory condition.

                              I've already stolen some numbers from various files. I'll try out the militia code eventually too.
                              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

                              Working...
                              X