Announcement

Collapse
No announcement yet.

making a new discovery atrribute in strategies.txt

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

  • making a new discovery atrribute in strategies.txt

    After playing medmod, I realized that few civs use communism, and if they do it's only for a short time. I know in apolyton pack, and other mods agressive civs use communism, but I wanted to create a Russian communist super power type discovery atrribute in strategies.txt. This would be used by the Isolationist, Autocratic Militarist personality also known as Stalin in the personality file. They would use communism, right from it's discovery and not stop until technocracy, and never use fascism. They should also not give a damn about the environment and build lots of production buildings.

    How do I do this? Do I just make a new discovery attribute, and incorporate it to personalities.txt? Does anyone have any suggestions for this? Having not lived through the cold war era as an adult, I have no Idea how a communist personality should be.

  • #2
    Strategies.txt is where you set up your government choices. What you may need to do is take out the later government choice in a particular setting, so that when a civ is in Communism, it will stay in it for a while, or make sure that Communisn shows up in all of the personalities, so that it will be used by more civs. The AI follows the lists, and if a choice is not on the list, it will not have the option to use it.

    Sorry about the download problems Cube (I do have to watch my budget though). I think that you can maybe download all of the split files and the updates (which includes all of the text files) and you will have everything - instead of trying to download the combined file. This may make it easier, as you will not be on a single download file for as long.

    The main reason why I have the single file was in the (vain) hope of getting Apolyton to post my file - I had provided a link to Mark and Dan so all they had to do was hyperlink it in their download section.

    But I do not think that will happen
    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


    • #3
      Originally posted by hexagonian
      Strategies.txt is where you set up your government choices. What you may need to do is take out the later government choice in a particular setting, so that when a civ is in Communism, it will stay in it for a while, or make sure that Communisn shows up in all of the personalities, so that it will be used by more civs. The AI follows the lists, and if a choice is not on the list, it will not have the option to use it.
      I Don't want it in all the personalities, I like the differences. in Med Mod communism comes before before fascism and is used by the ecotopian civs before mass media to try to get it to advance further and I added it to the the militarist civs before fascism.

      What I want to do is create two different militarist civs one that uses fascism and one that uses communism. I want to create a new discovery attribute, complete with gov settings, specialist allocation, goals, priorities, etc......... I want to know if it's possible to make a new one. I'll probably end up copying and pasting the militarist discovery attributes, renaming it and messing with it.

      I want to download cradle though have heard good things about it in your cradle post. the AI is actually good militarily!!

      Comment


      • #4
        Originally posted by Cube
        What I want to do is create two different militarist civs one that uses fascism and one that uses communism. I want to create a new discovery attribute, complete with gov settings, specialist allocation, goals, priorities, etc......... I want to know if it's possible to make a new one. I'll probably end up copying and pasting the militarist discovery attributes, renaming it and messing with it.

        I want to download cradle though have heard good things about it in your cradle post. the AI is actually good militarily!!
        Did Wes create new attributes in strategy.txt?

        I know I hadn't tried it for Cradle. Offhand, I'm not sure what files would be affected by the change either, or all the files that would have to be altered to make sure that they would not cause a crash. Plus, you may be able to make the additions, but you also need to make sure that the AI civs will use it themselves.

        As it stands there are 6 main AI personalities (default, science, militaristic, economic, ecotopian, and diplomatic), plus a host of minor strategies. I think I remember Wes having a discussion thread with Richard Azmel, where something along these lines was discussed. You may have to backtrack in the forums to find it, but it may have some good info for this issue.

        Here's the link
        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


        • #5
          he didn't create new atributes. From what I know, all that's needed to make a new personality attribute is to make it in strategies.txt, and make a personality in personalities.txt use it in the line discovery: name of discovery thing, but I'm not sure.

          I read the thread and richard says that the AI considers the production, food and gold of an improvement before it builds tile imporvements then, builds them. he also says something like the ai only builds improvements in tiles with out food, or production or very low production, food. I think this is why the AI doesn't build commerce improvements much. I tried to find were he says this, but the post is really long, and I couldn't find it.

          Comment


          • #6
            If that is all that is needed to do, then you may also need to go to either civilisation.txt or civ_str.txt to make sure that the new personalities are incorporated into the civ personalities.

            I've had some success in getting the AI to build commerce improvements. You may have to limit food improvements to grassland/plains, and then incoprorate a food bonus to a commerce improvement and limit them to forests, jungles, so that they will be built. If given the choice, the AI seems to build food improvements over any other improvements, and if those food options are able to be built in a variety of tiles, then those commerce improvements do not get built. One thing to remember too, it seems that if there are a lot of cities, the AI will fill up the available food production tiles first, (though not always). I do not know how to change this though.
            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
              From what I know, all that's needed to make a new personality attribute is to make it in strategies.txt, and make a personality in personalities.txt use it in the line discovery: name of discovery thing, but I'm not sure.
              It's not that easy. In theory, you can do this using SLIC (in particular, the SetStrategicState function), but it's probably way more trouble than it's worth and nobody's ever done it. (It's more feasible if you're working on a scenario with fixed players. See the WW2 scenario for an example where all the players are given their own special strategies.) Some time ago, RedArmy asked a related question about making the AI more aggressive and I started trying to write an answer but didn't get very far:

              At any point in the game what an AI civ does is determined by the strategic state and diplomatic states of it's leader. These states are in turn determined by the personality attributes, defined in personality.txt, which are used to load various strategies. They also determine the leader's diplomatic states, although what's going on here is not so clear. For example, the Stalin personality has the following attributes which load the associated strategies:

              Attribute Strategy

              Exploration: Minimal EXPLORE_NEAR
              Expansion: Average SETTLE_COMPACT + CAREFUL_START
              Discovery: Military MILITARIST_DEFAULT
              Conquest: Agressive (sic) ?
              Trustworthiness: Chaotic ?
              Alignment: Evil ?
              The question marks are there because: "The active Diplomatic State is selected by logic from within the game. Future plans are to expose the state selection logic to SLIC so state changes can be scripted in SLIC scripts." (from the comments on Diplomacy.txt.)

              I don't really know what they're on about, but I think it means that there's something going on that we can't see, so from now on I'll just talk about strategic states. (And there's actually only three diplomatic states anyway: DIPLOMACY_DEFAULT, DIPLOMACY_PROVOKE_WAR, and DIPLOMACY_MAKE_FRIEND, [although Dale later defined some new ones].)

              Each of the main XXX_DEFAULT strategies is an example of a strategic state and you can see what a strategic state does by examining them in conjunction with the explanation of strategies.txt provided in the Apolyton Modification: Data Files Definitions section.

              But it is important to realize that none of these DEFAULT strategies is ever in itself an active strategic state. The base active strategic state of, e.g., the Stalin personality is obtained by embedding the EXPLORE_NEAR, SETTLE_COMPACT, and CAREFUL_START strategies into MILITARIST_DEFAULT. (This is done with the SLIC ConsiderStrategicState function.) The point is that some of the data in the DEFAULT strategies is never used; it is always overwritten by the corresponding data in the Exploration, Expansion and Start strategies. The resulting strategic state is the one that is used by the Stalin personality for most of the game. There are then other strategies that are embedded into this state in special game situations. The most interesting are the war strategies: STRATEGY_SIEGE, STRATEGY_ATTACK, and STRATEGY_DEFEND.

              So that's a very concise description of how the game engine determines the active strategic states of the AI players.

              Any programming task has two highly interdependent entities to consider: the data and the program. For all it's faults, CTP2 has provided us with the means to modify both of them. We have access to much of the AI's data and we have SLIC functions that allow us to change the way in which it uses this data.

              First consider the data. Clearly, you can change the active strategic states of the AI players by just changing the data in strategies.txt and the other connected files. Here's a couple of suggestions:

              (1) Get rid of the Wimps: in civilisation.txt replace the Ghandi, Nader, and Medici personalities with the more warlike Stalin and Caesar ones.

              (2) Experiment with Goals.

              But now for the bad news. Just changing the data will not, IMHO, result in any really significant improvement in the AI's behaviour. To do that you have to learn SLIC and modify the program itself.

              That's as far as I got.

              What I want to do is create two different militarist civs one that uses fascism and one that uses communism.
              I think that the easiest way to do this is to take over one of the existing personalities. I wanted to do something like this too, and I used the ecotopian type personalities: Callenbach and Strangelove. In Strategies.txt, I changed the government settings of STRATEGY_ECOTOPIAN_DEFAULT to:

              // Government GOVERNMENT_ECOTOPIA
              // Government GOVERNMENT_VIRTUAL_DEMOCRACY
              // Government GOVERNMENT_DEMOCRACY
              Government GOVERNMENT_TECHNOCRACY
              // Government GOVERNMENT_CORPORATE_REPUBLIC
              Government GOVERNMENT_COMMUNISM

              Government GOVERNMENT_THEOCRACY
              Government GOVERNMENT_MONARCHY
              Government GOVERNMENT_TYRANNY
              Now any civ whose leader has the Callenbach or Strangelove personality will use the sequence of governments: TYRANNY, MONARCHY, THEOCRACY, COMMUNISM, TECHNOCRACY, as they become available. I guess you also have to edit the parameters that deal with pollution in this strategy, but I don't know what you'll have to do, cause I never play with pollution on. (Out and out Bloodlust, I guess I'm just a latent meglomaniac. )


              About Adding New Strategies


              You can add as many new strategies as you want, but you have to learn at least a bit of SLIC to get the AI to use them. Bear in mind that a strategy can be almost any subset of parameters from a default strategy. The Goal parameters are especially fun: they control how the AI moves it's units around the map. For example, I've been playing with the WW2 scenario and defined two new strategies for the Germans:

              STRATEGY_WW2_GERMAN_LAND_GOALS{

              GoalElement { Goal GOAL_SEIGE Priority 995000 MaxEval 25 MaxExec 15 }
              GoalElement { Goal GOAL_ATTACK Priority 805000 MaxEval 25 MaxExec 25 }
              GoalElement { Goal GOAL_HARASS Priority 755000 MaxEval 25 MaxExec 10 }
              GoalElement { Goal GOAL_HARASS_CITY Priority 730500 MaxEval 12 MaxExec 3 }
              GoalElement { Goal GOAL_BOMBARD Priority 807000 MaxEval 5 MaxExec 2 }
              GoalElement { Goal GOAL_BOMBARD_UNIT Priority 810000 MaxEval 5 MaxExec 2 }

              }

              STRATEGY_WW2_GERMAN_AIR_GOALS{

              GoalElement { Goal GOAL_SEIGE Priority 810000 MaxEval 5 MaxExec 2 }
              GoalElement { Goal GOAL_ATTACK Priority 805000 MaxEval 5 MaxExec 2 }
              GoalElement { Goal GOAL_HARASS Priority 755000 MaxEval 5 MaxExec 2 }
              GoalElement { Goal GOAL_HARASS_CITY Priority 730500 MaxEval 12 MaxExec 3 }
              GoalElement { Goal GOAL_BOMBARD Priority 995000 MaxEval 25 MaxExec 25 }
              GoalElement { Goal GOAL_BOMBARD_UNIT Priority 990000 MaxEval 25 MaxExec 25 }
              }
              Then I modified the handler 'WWNextStrategicState_F':

              Code:
              if (tmpPlayer == 1) {		// If current player is German
              	      ConsiderStrategicState(tmpPlayer, 9900, StrategyDB(STRATEGY_WW2_GERMAN),-1,-1,-1);     
              	      tacticalGoals=Random(100);
              	      if (tacticalGoals<66) {
              	           ConsiderStrategicState(tmpPlayer, 9999, StrategyDB(STRATEGY_WW2_GERMAN_LAND_GOALS),-1,-1,-1);    
              	      }
                            else{
              	           ConsiderStrategicState(tmpPlayer, 9999, StrategyDB(STRATEGY_WW2_GERMAN_AIR_GOALS),-1,-1,-1);
                            }
              So now on any given turn, there's a 1 in 3 chance that the Luftwaffe will try to bomb the hell out of you. Otherwise the Panzer divisions will go for your cities. (Actually, that's a bit misleading, I had to do an awful lot more to get the AI to pursue proper Blitzkrieg tactics.)

              Here's another example. In the standard game the AI will rarely use STRATEGY_SEIGE. This is the one where it prioritizes capturing cities. But you can force it to use this strategy when it's at war with you with:

              Code:
                       if (IsAtWarWithHuman(player[0])) {//if at war, take cities
                            
              	      SendTroopsToTheater();
              	      ConsiderStrategicState(Player[0], 1500, StrategyDB(STRATEGY_SEIGE),-1,-1,-1);
                       }
              'SendTroopsToTheater' is a function that gathers up all the AI's spare troops and sends them to where the action is.

              For all it's faults, this is a great game for modders.

              Comment

              Working...
              X