Announcement

Collapse
No announcement yet.

IMPROVED version of DIPLOMOD

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

  • #31
    Originally posted by Martin Gühmann
    World AI Peace, I would rather like AI alliance against other AIs or the human. And AIs should offer each other scince and trade pacts.
    I have two stupid question.
    Aren't science pacts buggy, so Dale removed them from Diplomod?
    What are exact effects of Trade pact, a haven't noticed them?

    Comment


    • #32
      Well I had a science pact once pre mods ,and I took off one turn from my science every turn. So if an advace was supposed to take 10 turns it would take 5. So that might have been the bug.

      I just recently started A new game with medmod 2: The Crusades and improved diplo mod. The mogols went to war with the spaniards and some turns later it might have been 50 since the game goes by so fast in the beginning, The war ended. So the war over script does work.

      For the trade pacts the library says its supposed to give one gold per trade route for every route you have have with that civ. So The more you trade with that civ, the more they're willing to pay for your goods.

      Well you guys are doing great, I can't wait for this to be finished, the AIs will actually conduct diplomacy with each other. WOW!!!

      Comment


      • #33
        Been gone a long time, got a new computer and decided to install all my games, updating CTP 2 and the mods. This could change the game dramatically. I'm so excited. I read Civ 3 would not have multiplayer. Funny since everybody thought Activision released their game too earlier. I guess it's better to wait. The good thing about AI-AI diplomacy is when the human gets too far ahead for them to gang up on the human player like Civ 2. Good luck you guys.....

        Comment


        • #34
          Originally posted by Peter Triggs
          The trouble is that 'IsHumanPlayer(g.player)' will return either 1 or 0, so this message will either go to player 1 (who's usually the human) or the Barbarians. If you use 'THE_HUMAN' you should get the generality you want.
          A logical error, I don't like them, because you don't get any error message it only doen't work or worse it works but in a different as expected and you don't realize that.

          Code:
          int_t THE_HUMAN;
          
          HandleEvent(BeginTurn)'NumofPlayers' pre {
          
          int_t i;
          
              NUM_PLAYERS= preference("NumPlayers");
              for(i=1; i < NUM_PLAYERS; i=i+1){
                   if (IsHumanPlayer(i)) {
          	      THE_HUMAN=i;
                   }
              }
          }
          This code is an improve but also buggy. "NumPlayers" is the number of civilisations with which you started. But if you set "MaxPlyers" higher than "NumPlayers" it is possible to get more than the initial players in a game and if you enabled the write protection of the userprofile.txt CTP2 won't change this number there. The result is that the loop will stop before the last player in this case it doesn't matter, because it is very unlikly that afterwards added players will be human players, OK you can change it via cheat editor.

          Diplomod allready contains such a function, and I got some problems with it as I tested my GoodMod with debug=yes. Half of the world was suddenly covered with auxiliry tileimprovements, although the trigger should only fire at the biginning of the game also you reloadslic, therefore I implemented another disablement function.

          So far I guess this code will also work if it would look like:

          Code:
          int_t THE_HUMAN;
          
          HandleEvent(BeginTurn)'NumofPlayers' pre {
          
          int_t i;
          
              NUM_PLAYERS= preference("NumPlayers");
              for(i=1; i < 40; i=i+1){
                   if (IsHumanPlayer(i)) {
          	      THE_HUMAN=i;
                   }
              }
          }
          Maybe 40 is too high but I had no problems with it so far.

          Originally posted by player1
          Aren't science pacts buggy, so Dale removed them from Diplomod?
          I don't know the exact effect of science pacts. So far as I know if you sign a science pact with a under advanced AI this AI will catch up in science. In theory both players should put their science together in order to research faster. And you are right this pact is not a option in my current game, but only Dale could tell us why he removed it or I have to search for an old thread.

          Originally posted by player1
          What are exact effects of Trade pact, a haven't noticed them?
          I have no I idea but it seems that they have an effect and it is not very buggy. Here is a small discription from the interactions.txt:

          17. TREATY_TRADE_PACT: (DESIRE_MAKE_FRIEND, DESIRE_GOLD)

          Triggered when 1) no war has occurred between sender and receiver
          for 10 turns, 2) sender trusts receiver, 3) receiver has no troops
          on our territory, 4) receiver is pirating our trade routes, 5)
          more than 10% of the value of senders trade is with the
          receiver. 6) value of value of receivers trade with sender does
          not exceed twice senders trade with receiver.
          It doesn't help me very much to understand what the exact effect of a trade pact is but maybe it gives you some hints.

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

          Comment


          • #35
            Originally posted by Martin Gühmann
            This code is an improve but also buggy. "NumPlayers" is the number of civilisations with which you started. But if you set "MaxPlyers" higher than "NumPlayers" it is possible to get more than the initial players in a game and if you enabled the write protection of the userprofile.txt CTP2 won't change this number there. The result is that the loop will stop before the last player in this case it doesn't matter, because it is very unlikly that afterwards added players will be human players, OK you can change it via cheat editor.
            Exactly,
            afterward players wont be humans, just AIs.
            I have also noticed that diplomod is not completly compatibile with multiplayer, since it often relies on human as player one.
            I think that I read some post in General forum about Diplomod not working propely.

            Comment


            • #36
              Originally posted by Cube
              Well I had a science pact once pre mods ,and I took off one turn from my science every turn. So if an advace was supposed to take 10 turns it would take 5. So that might have been the bug.
              In therory the science pact should work like this: Both players in a science pact will share the research capacity, they will also share the results. If the science outputs of both members are nearly equal, the result should be a halved research time for an advance for both players. Maybe the bug is that the research time is calculated on the science output of only your civ and the extra science is not displayed there. Another problem for the player is if he signs a science pact with another civ that is one tenth or less of the players science output he wouldn't see any effect on his science put, but the less advanced player will catch up very fast. As the science of that player is added to you and your science is added to him.

              So far from your observation I guess it is only a display bug, but that should be tested more. But it is shure that AI-AI science pact would be a great help for AI science.

              Originally posted by ENGINEER
              The good thing about AI-AI diplomacy is when the human gets too far ahead for them to gang up on the human player like Civ 2.
              That was but unfurtunatly that didn't help, because I was too advanced and that helped me to stay in democracy and declaring or better to get to war with them. One AI of a concurrent block ask me if I like to get to war with another AI I accepted. I conquered one of its city every of its allies declared war on me. And this AI went to me with a peace/cease fire offer (I had to sign it, beause I was in Democracy) and ask me if I like to attack that AI that ask me to attack him. So I was able to repeat this game until there was no AI left. Actual these AIs were very stupid but it was very funny.

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

              Comment


              • #37
                Originally posted by Martin Gühmann
                Code:
                int_t THE_HUMAN;
                
                HandleEvent(BeginTurn)'NumofPlayers' pre {
                
                int_t i;
                
                    NUM_PLAYERS= preference("NumPlayers");
                    for(i=1; i < NUM_PLAYERS; i=i+1){
                         if (IsHumanPlayer(i)) {
                	      THE_HUMAN=i;
                         }
                    }
                }
                This code is an improve but also buggy. "NumPlayers" is the number of civilisations with which you started. But if you set "MaxPlyers" higher than "NumPlayers" it is possible to get more than the initial players in a game and if you enabled the write protection of the userprofile.txt CTP2 won't change this number there. The result is that the loop will stop before the last player in this case it doesn't matter, because it is very unlikly that afterwards added players will be human players, OK you can change it via cheat editor.
                So if maxplayers is higher, make that the end of the loop:
                Code:
                int_t THE_HUMAN;
                
                HandleEvent(BeginTurn)'NumofPlayers' pre {
                
                int_t i;
                int_t MAX_PLAYERS;
                
                    MAX_PLAYERS= preference("MaxPlayers");
                    for(i=1; i < MAX_PLAYERS; i=i+1){
                         if (PlayerIsAlive(i) && IsHumanPlayer(i)) {
                	      THE_HUMAN=i;
                         }
                    }
                }
                This will check all possible players, without wasting time.
                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


                • #38
                  Hey,
                  the IMPROVED DIPLOMOD V1.15 is out

                  Changes:
                  -Ending War sets regard between AIs to +250
                  (so AIs wont declare war on each other next turn)

                  This is of course temporary solution unitl Petter Triggis finishes
                  his diplomacy slic.
                  Attached Files

                  Comment


                  • #39
                    I think I should read readmes, here is the stuff that I found about science pacts in Dale's readme:

                    From Dale's Diplomod v3.6
                    The "research treaty" bug is where the AI will gain one advance per turn if you have a research pact with them. To counter this bug I have disabled Research Pacts entirely.
                    And here is the stuff about science pacts that I found in the interaction.txt:

                    18. TREATY_RESEARCH_PACT: (DESIRE_MAKE_FRIEND, FEAR_SCIENCE_RANK)

                    Triggered when 1) no war has occurred between sender and receiver for 10 turns, 2) sender trusts receiver, 3) receiver has no troops on our territory, 4) sender generater has less science than receiver per turn, or 5) sender does not generate more than 20% more science than receiver.
                    To summerize it you should never sign a science pact with a player that has a science output that is 20% less than your science output.

                    An example from my current game, I am the most advanced player. I have more than 50 cities. Player 2 has three cities he is currently researching internal combustion this advance costs 75504 my current science output is something like 72000. His science output is very low. Now if I sign a science pact with player2 he will get his current advance in one turn his science output is added to my science output and his science output is added to my science output. As his science output very low I won't notice any effect. But he will get an advance every turn.

                    Player 4 is researching currently mass media in Apolyton pack it cost 81276, therefore a science pact with me would cause that he get an advance every second turn.

                    The other AI players are all researching something that cost 20000 and 90000 science points. Therefore the result will be same irrespective which AI signs a science pact wth me. Each AI will get a science boost, because of my high science output. Each AI will get their advances in one or two turns.

                    In that case it is no bug that the AI will get a science boost and I wouldn't see any effect. It is just the superior human science output. In unmodded games the human has such a high science output compared to the AI or higher normally. It is only a user bug if the human signs a science pact with a such under advanced AI.

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

                    Comment


                    • #40
                      On Impossibile level Advances costs for player are increased for 80%
                      and AI Advances cost is for -75% to -50% cheaper
                      That is about 3.6 to 7.2 times quicker research time
                      And since you get just a litte boost from AI science with sci. pact
                      AI would get yours science multiplied by 3.6 to 7.2 times so evetualy
                      AI will (on harder levels), if you sigh sci. pact become
                      superior in science & you wont't be able cath up with him.

                      Comment


                      • #41
                        Anyway, on Hard+ difficulty, science pact does no good for human player.

                        Comment


                        • #42
                          So science pact would only be usefull in AI-AI diplomacy.

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

                          Comment


                          • #43
                            Code:
                            int_t THE_HUMAN;
                            
                            HandleEvent(BeginTurn)'NumofPlayers' pre {
                            
                            int_t i;
                            int_t MAX_PLAYERS;
                            
                                MAX_PLAYERS= preference("MaxPlayers");
                                for(i=1; i < MAX_PLAYERS; i=i+1){
                                     if (PlayerIsAlive(i) && IsHumanPlayer(i)) {
                            	      THE_HUMAN=i;
                                     }
                                }
                            }
                            Now this code covers the case if MaxPlayers is higher than NumPlayers, the other case if is NumPlayers is higher than MaxPlayers is missing.

                            This code will cover both cases:

                            Code:
                            int_t THE_HUMAN;
                            
                            HandleEvent(BeginTurn)'NumofPlayers' pre {
                            
                            int_t i;
                            int_t MAX_PLAYERS;
                            int_t NUM_PLAYERS;
                                if(preference("MaxPlayers")>preference("NumPlayers")){
                                    MAX_PLAYERS= preference("MaxPlayers");
                                    for(i=1; i < MAX_PLAYERS; i=i+1){
                                         if (PlayerIsAlive(i) && IsHumanPlayer(i)) {
                            	          THE_HUMAN=i;
                                         }
                                     }
                                }
                                if(preference("NumPlayers")>=preference("MaxPlayers")){
                                    NUM_PLAYERS= preference("NumPlayers");
                                    for(i=1; i < NUM_PLAYERS; i=i+1){
                                         if (PlayerIsAlive(i) && IsHumanPlayer(i)) {
                            	          THE_HUMAN=i;
                                         }
                                     }
                                }
                            }
                            Unfortunatly thereis another problem the code will cycle through all players and the last human player that is found will be THE_HUMAN, irrespective of the fact that there could be more than one human in multiplayer games.

                            For messages I should get the generality that I want. If I write the code like:

                            Code:
                            HandleEvent(CaptureCity) 'MG_KillCityOption' post {
                            	if (city[0].population>1) {
                            		if(IsHumanPlayer(player[0])){
                            			if(CityIsValid(city[0])) {
                            				message(player[0], 'DestroyCityMSG');
                            				city[0] = DestroyCity;
                            			}
                            		}
                            	}
                            }
                            But for Dale's main rotine that should work:

                            Code:
                            ///////////////////////////////////
                            // Main routine
                            ///////////////////////////////////
                            
                            HandleEvent(BeginTurn) 'DIP_MainRoutine' post {
                                 if(IsHumanPlayer(g.player)) {
                                      DIP_turns = DIP_turns + 1;
                                 }
                            As if(IsHumanPlayer(g.player)) { returns true or false like if(g.player == 1) {

                            In multiplayer AI-AI diplomacy would happen more than one in a turn.

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

                            Comment


                            • #44
                              This is turning out to be a lot more complicated, difficult, and tedious than I ever imagined. But I've been making notes as I go along and here's a preliminary version for anyone who wants to have a look. Even if you're not interested in Diplomacy, there's an appendix that has a fair amount of information on most of the poorly documented/undocumented SLIC functions. Any help in filling out the gaps in this information would be greatly appreciated.

                              D*mn, it doesn't like rtf files!!!
                              Last edited by Peter Triggs; October 18, 2001, 18:02.

                              Comment


                              • #45
                                So I zipped it.
                                Attached Files
                                Last edited by Peter Triggs; October 18, 2001, 18:19.

                                Comment

                                Working...
                                X