TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Relationships Last Extra Rounds - Resolved -

    Scheduled Pinned Locked Moved XML Options Browser
    6 Posts 3 Posters 2.2k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MahksM Offline
      Mahks
      last edited by Mahks

      Relationships Last Extra Rounds

      Mentions a default relationship duration.

      I can not find where that default is set, closest I see is roundValue in relationshipInitialize, but that appears to be something else.

      redrumR General_ZodG 2 Replies Last reply Reply Quote 0
      • redrumR Offline
        redrum Admin @Mahks
        last edited by

        @mahks POS2 XML:

            <!-- If this is set, it adds or subtracks from any conditions that require a relationship to last for X rounds -->
            <property name="Relationships Last Extra Rounds" value="0" editable="true">
              <number min="-1" max="2"/>
            </property>
        

        Here is the only code that uses it:

          private boolean relationShipExistsLongEnnough(final Relationship r, final int relationshipsExistance) {
            int roundCurrentRelationshipWasCreated = r.getRoundCreated();
            roundCurrentRelationshipWasCreated += Properties.getRelationshipsLastExtraRounds(getData());
            return getData().getSequence().getRound() - roundCurrentRelationshipWasCreated >= relationshipsExistance;
          }
        

        So it appears if that is set then its added to the "round a relationship was created" when checking conditions. I honestly have no idea what map uses that.

        TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

        1 Reply Last reply Reply Quote 0
        • General_ZodG Offline
          General_Zod @Mahks
          last edited by General_Zod

          @mahks

          Typically relationships last 1 round and utilize endRound delegate to determine when that is. But the condition option (conditionAttachment option) for custom diplomacy is below.

          relationship     values: a relationship that needs to be present in the game: "player1:player2:relationship" (will set #rounds to -1 by default) OR "player1:player2:relationship:numberOfRoundsThisRelationshipMustExistForMinimum" for example: "Japan:China:War" or "Japan:China:War:-1" or "Japan:China:War:3".  It will accept "anyWar", "anyNeutral" and "anyAllied" as well.
          

          Some games use multi rounds relationships. They probably use the simple game property "relationship last extra rounds" to just add on versus creating new political actions using the condition ^^.

          Note the condition would likely be used to activate triggerAttachment option, such as below.

          relationshipChange	values: the change in relationship for these players, format: "player1:player2:oldRelation:newRelation" example: "Russians:Americans:coldWar:allOutWar" oldRelation may be "any", "anyWar", "anyNeutral", "anyAllied", or an actual relationshipType used in this xml. You can enter multiple relationshipChanges in the trigger and it will perform every change in the trigger which is valid.
          
          1 Reply Last reply Reply Quote 0
          • MahksM Offline
            Mahks
            last edited by Mahks

            @general_zod said in Relationships Last Extra Rounds:

            conditionAttachment

            when set to -1 does that equal permanent?

            It says (will set #rounds to -1 by default)

            General_ZodG 1 Reply Last reply Reply Quote 0
            • General_ZodG Offline
              General_Zod @Mahks
              last edited by

              @mahks

              Not sure, I always enter a value. @redrum would have to delve into code to give a definitive answer.

              1 Reply Last reply Reply Quote 0
              • redrumR Offline
                redrum Admin
                last edited by

                @Mahks So relationship is part of a condition, so if its set to -1 then it means it'll essentially ignore duration unless "Relationships Last Extra Rounds" is set.

                Essentially this is what the condition checks:
                (currentRound - roundRelationshipWasCreated - "Relationships Last Extra Rounds") >= numberOfRoundsThisRelationshipMustExistForMinimum

                So if "Relationships Last Extra Rounds" isn't used then the -1 will make it so the duration check is always true.

                TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post
                Powered by NodeBB Forums