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

    Simple Trigger Help

    Scheduled Pinned Locked Moved Map Making
    74 Posts 9 Posters 26.1k Views 9 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.
    • wc_sumptonW Offline
      wc_sumpton
      last edited by

      @Name LOL, no problem. Don't know how many times the simple/overlooked answer has eluded me! Happy to hear it is working. 😉

      Cheers...

      1 Reply Last reply Reply Quote 1
      • N Offline
        Name
        last edited by

        Another question:

        Is there any known reason that this:

         <attachment name="unitAttachment" attachTo="citizens" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
              <option name='isInfrastructure' value='true'/>
              <option name="consumesUnits" value="1:slaves"/>
              <option name='whenCapturedChangesInto' value='any:any:true:slaves:1'/>
              <option name='createsResourcesList' value='1:Manpower'/>		 
          </attachment>	
        

        Won't convert into this on capture? ('whenCapturedChangesInto')

            <attachment name="unitAttachment" attachTo="slaves" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
        	<option name='isInfrastructure' value='true'/>
                <option name="movement" value="1"/>
        	<option name='canNotMoveDuringCombatMove' value='true'/>				 
                <option name="transportCost" value="1"/>	
                <option name='fuelCost' value='Supplies' count='1'/>	
                <option name="consumesUnits" value="1:citizens"/>				 
                <option name='createsResourcesList' value='1:PUs'/>
        	<option name='createsResourcesList' value='1:Supplies'/>
            </attachment>
        
        HeppsH 1 Reply Last reply Reply Quote 0
        • HeppsH Offline
          Hepps Moderators @Name
          last edited by Hepps

          @Name Try removing the...

          <option name="consumesUnits" value="1:slaves"/>
          

          From the Citizen attachment. This attachment means it would consume one of your (already in your possession) slaves when you try to build a citizen... not when you capture a territory with an enemy citizen in it. Your unit attachment for an enemy "citizen" already addresses this need as 'whenCapturedChangesIinto' already deals with this.

          "consumesUnit" should only be used when you are trying to use something that is already yours that is transformed into a different unit during your placement phase.

          Actually you probably need to remove the "consumesUnit" from both units.

          Though to be honest without knowing what your full intentions are it is hard to say for certain.

          "A joyous heart sours with the burden of expectation"
          Hepster

          1 Reply Last reply Reply Quote 0
          • N Offline
            Name
            last edited by Name

            @Hepps I've already tried that (no consumesUnit for either of them), won't work. Adding the rest of the slaves' attributes to citizens won't work as well.

            Adding isConstruction and it's extras also not working, with or without consumesUnit.

            Edit: What I've tried to test is mechanics that allow:

            • Capturing of foreign citizens into slaves (whenCapturedChangesInto)
            • Promotion/Demotion of populations through purchase (consumesUnits)
            • (Somewhat related) Upgraded cities spawn citizens per turn.

            I could do without the first feature, seems rather unbalanced and not AI friendly, but I'll like to test it first and it's strange that it's not working nomatter what.

            HeppsH 1 Reply Last reply Reply Quote 0
            • HeppsH Offline
              Hepps Moderators @Name
              last edited by Hepps

              @Name Do you have all the game properties set up correctly?

               <!-- allows a player to let its units be captured by another player if true, when the territory is captured. units must have canBeCapturedOnEnteringBy and territories must have captureUnitOnEnteringBy and the players must have the player attachment captureUnitOnEnteringBy -->
                  <property name="Capture Units On Entering Territory" value="false" editable="false">
                    <boolean/>
                  </property>
                  <!-- if "Capture Units On Entering Territory" is true, then the units can either be captured (default) or destroyed (only if this property below is true: "On Entering Units Destroyed Instead Of Captured") -->
                  <property name="On Entering Units Destroyed Instead Of Captured" value="false" editable="false">
                    <boolean/>
                  </property>
                  <!-- specific rules -->
                  <!-- land related -->
                  <!-- if true, units with destroyedWhenCapturedBy will be destroyed instead of captured. only applies to non-combat units, since combat units die in combat -->
                  <property name="Units Can Be Destroyed Instead Of Captured" value="true" editable="false">
                    <boolean/>
                  </property>
                  <!-- allows units to change into other units using the whenCapturedChangesInto ability -->
                  <property name="Units Can Be Changed On Capture" value="true" editable="false">
                    <boolean/>
                  </property>
              

              "A joyous heart sours with the burden of expectation"
              Hepster

              1 Reply Last reply Reply Quote 1
              • HeppsH Offline
                Hepps Moderators
                last edited by

                @Hepps said in Simple Trigger Help:
                This one in particular is absolutely a MUST for what you are trying to accomplish.

                <!-- allows units to change into other units using the whenCapturedChangesInto ability -->
                <property name="Units Can Be Changed On Capture" value="true" editable="false">
                  <boolean/>
                </property>
                

                "A joyous heart sours with the burden of expectation"
                Hepster

                N 1 Reply Last reply Reply Quote 4
                • N Offline
                  Name @Hepps
                  last edited by

                  @Hepps said in Simple Trigger Help:

                  @Hepps said in Simple Trigger Help:
                  This one in particular is absolutely a MUST for what you are trying to accomplish.

                  <!-- allows units to change into other units using the whenCapturedChangesInto ability -->
                  <property name="Units Can Be Changed On Capture" value="true" editable="false">
                    <boolean/>
                  </property>
                  

                  That was it, thanks. Btw it works with consumesUnit.

                  HeppsH 1 Reply Last reply Reply Quote 1
                  • HeppsH Offline
                    Hepps Moderators @Name
                    last edited by

                    @Name Yes... after looking at it figured my initial guess was wrong... but often it is a process of elimination of different things. More so when you are guessing at what people are trying to accomplish. 😃

                    Glad it worked.

                    "A joyous heart sours with the burden of expectation"
                    Hepster

                    N 1 Reply Last reply Reply Quote 1
                    • N Offline
                      Name @Hepps
                      last edited by Name

                      @Hepps said in Simple Trigger Help:

                      @Name Yes... after looking at it figured my initial guess was wrong... but often it is a process of elimination of different things. More so when you are guessing at what people are trying to accomplish. 😃

                      Glad it worked.

                      Well in most cases so far (including ones not posted here), my troubles were simply some missing property, but at least by now I've learned to check if I can find a related one needed for something to work.

                      The citizens/slaves feature is probably getting scrapped though since its extra visual burden and really hard to balance, income-wise, with added units per turn that give income.

                      I'll eventually make a map development thread but for now I'll keep asking here. I'm getting used to making triggers and started looking into politics. Before doing loads of tedious work I'd like opinions on possible and advisable political features. I've read a bit across the forums but I still can't say a have a clear view on this.

                      The background:

                      • The map is set in Hellenistic/Roman times, probably starting at 222BC. Focus will be around Cleomenian, Second Punic, Macedonian and Syrian Wars.
                      • There are many factions, of varied power and faction balance is not a primary concern. I'd like to have around 30 playables eventually.
                      • The map is detailed (many regions) and big.

                      The concerns:

                      • FFA or Fixed Alliances seem unrealistic but easy to make.
                      • Detailed politics (players can change any relation possible) would be ideal but a lot of work. I've read that the AI is really bad at it, but in what way?
                      • Triggered relationships could work and keep historical accuracy reasonable. Say if Macedon or Rome gains a territory in Illyria, the other declares war. But I'm afraid it would railroad the game too much and limit player agency. Is it possible to have set AI reactions (or chances) but let a human decide how to react?

                      Are there other options? Or any upsides/downsides I'm unaware of?

                      B 1 Reply Last reply Reply Quote 0
                      • B Online
                        beelee @Name
                        last edited by beelee

                        Hi Name. Welcome to the site.@Name said in Simple Trigger Help:

                        ...Is it possible to have set AI reactions (or chances) but let a human decide how to react?

                        Are there other options? Or any upsides/downsides I'm unaware of?

                        Not sure if I understand you 100% correctly, but you might be able to have a AI player activate a trigger for a Human player if the right conditions are met and then on the Human players turn, a notification could show up, such as asking to declare war on somebody ? Idk could be worth a shot though.

                        It seems that there's a game that uses lend lease kinda like that. I can't remember what it is though. Zim Xero's "Pacific Challenge" has a lot of triggers and interaction that goes on. Frostion's "Age of Tribes" as well. "Total World War" is another complex map that does a lot of different things. Actually it might be the one I was thinking of about the lend lease. "Feudal Japan" does a lot of stuff too.

                        Anyway, you might want to check those out and see if any of their behavior does what you want.

                        Also Pacific Challenge is heavily AI based if I remember right. Maybe that's his "Solo" challenge. Anyway 🙂

                        N 1 Reply Last reply Reply Quote 0
                        • N Offline
                          Name @beelee
                          last edited by Name

                          @beelee
                          Hi and thanks!

                          What I meant by that is that when a trigger to (potentially) change relationship is activated (say Player1 captured region X )

                          • If Player2 is AI it is given a set reaction (declare war on Player1) or a chance (say 1:6 to declare war - maybe increasing by further 1:6 each passing turn).
                          • If Player2 is Human, they are given a choice (User/Political Action I guess), to declare war if they want.

                          I'll check those maps to get ideas, but I'm mostly interested on informed opinions of the general possibilities and which ones would better fit the scale/setting of mine. And later look into details on implementation (if something complex is needed).

                          I'd generally prefer something AI friendly and not too memory heavy, since ~30 player turns will take quite long anyway.

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

                            @Name I would probably recommend fixed alliances at least to start with as its the simplest and easiest to test with the AI. There are a few various options around diplomacy:

                            1. Fixed alliances
                            2. FFA either with no diplomacy or open diplomacy where players can declare alliance or war with each other freely or for some cost
                            3. Diplomacy with restricted options and alliances like Global 40
                            4. Some sort of unit based system like we are creating for PoP: https://forums.triplea-game.org/topic/1063/power-of-politics-1914-a-wwi-scenario

                            It mostly boils down to how much effort you want to put into diplomacy and if you want the AI to be able to handle it.

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

                            C 1 Reply Last reply Reply Quote 1
                            • C Offline
                              Cernel Moderators @redrum
                              last edited by

                              @redrum said in Simple Trigger Help:

                              @Name I would probably recommend fixed alliances at least to start with as its the simplest and easiest to test with the AI. There are a few various options around diplomacy:

                              1. Fixed alliances
                              2. FFA either with no diplomacy or open diplomacy where players can declare alliance or war with each other freely or for some cost
                              3. Diplomacy with restricted options and alliances like Global 40
                              4. Some sort of unit based system like we are creating for PoP: https://forums.triplea-game.org/topic/1063/power-of-politics-1914-a-wwi-scenario

                              It mostly boils down to how much effort you want to put into diplomacy and if you want the AI to be able to handle it.

                              From what he said so far, sounds like the game would be about as AI unplayable as Civil War, which adds to the fact that the AI is currently very bad at FFA politics, so, while it is always possible the AI to be upgraded to that level, that makes it currently largely unfeasible going with option 2, as that would require 30 human players, that also probably don't care at all about game balance (as a matter of fair winning chances).

                              @Name Probably the best compromise between what TripleA offers and realism is going with a Domination style politics, in which you would have something like 5 or 6 sides (fixed alliances), each having a number of powers (if 30 in total, respectively 6 or 5 powers per side), and you would distribute such power in a way to make the most sense with historical politics (grouping those that were tendentially friendly to each other and assure that those that were main enemies of each other stay in different sides). That way the game might have a chance to get played, especially PBF (you would need "only" to find 5 or 6 players, committing for what is probably going to be a year long gaming experience, if not several years).

                              Theorically, I think the best (both for playability and for historical consistency) would be going Feudal Japan style, having each human player taking 1 power (under some balanced distribution), all remaining ones given to the AI (that is what most commercial historical digital games do, as well), but, for this, you would need the AI actually playing the game at a level of skill comparable to the persons.

                              C 1 Reply Last reply Reply Quote 1
                              • C Offline
                                Cernel Moderators @Cernel
                                last edited by

                                @Cernel said in Simple Trigger Help:

                                Theorically, I think the best (both for playability and for historical consistency) would be going Feudal Japan style, having each human player taking 1 power (under some balanced distribution), all remaining ones given to the AI (that is what most commercial historical digital games do, as well), but, for this, you would need the AI actually playing the game at a level of skill comparable to the persons.

                                Also since this would allow playing the game solo too, taking only 1 player and going for taking over the (known) world (as I guess most commercial historical digital games are usually played).

                                1 Reply Last reply Reply Quote 0
                                • N Offline
                                  Name
                                  last edited by

                                  @Cernel @redrum

                                  Decent AI compatibility is a must. I want to be able to play the game solo or hotseat with a few friends. So far it works rather well, besides a couple of issues.

                                  • "Garrisons" (0/3/0), maximum of 4 per territory are a central part of the gameplay. But the AI won't buy them or I have to use "hacks" giving them 1 movement (triggered movement change during purchase, requiresUnitsToMove, or the best it seems, givesMoment -1 from factory type units). But if I use those hacks, the AI often buys more Garrisons than it can place.
                                  • I'm under the impression (could be wrong though), that the AI doesn't consider nevative isMarine when launching naval invasions and I have the majority of land units at isMarine -1 or -2.

                                  Online is secondary concern but I'll look into it as well. I doubt a game would take months or a year. I'll avoid heavy triggering. There are also severe limits to how many troops a player can have (mostly due to upkeep). Each unit represents around 1000 troops and factions will usually have those in the range of 5-50, depending on territory size and casualties (the upkeep system ensures it takes quite long to reach total troop potential, while garrisons make snowballing hard-ish). The more I say or read the more I think I'd better present the whole target gameplay before hoping for better advice. I'd do that soon.

                                  Anyway back to diplomacy:

                                  • FFA with politics seems out of the question, too much work and AI won't handle it.

                                  • FFA without politics doesn't fit the era much.

                                  • I'll take a look at the maps mentioned.

                                  • A mix of fixed alliances and triggered changes seems the most probable. But can someone explain if something like this is possible:

                                    What I meant by that is that when a trigger to (potentially) change relationship is activated (say Player1 captured region X )
                                    - If Player2 is AI it is given a set reaction (declare war on Player1) or a chance (say 1:6 to declare war - maybe increasing by further 1:6 each passing turn).
                                    - If Player2 is Human, they are given a choice (User/Political Action I guess), to declare war if they want.
                                    

                                  If not I wonder how it would feel to force diplo changes to both player and AI depending on where they invaded etc. Like entering some other power's sphere of influnce is guaranteed war, instantly or soon. I guess it would need some visual feedback to work decently. Some form of "casus beli" markers with the flag of the one getting it on triggering territories.

                                  HeppsH C 2 Replies Last reply Reply Quote 0
                                  • HeppsH Offline
                                    Hepps Moderators @Name
                                    last edited by

                                    @Name 30 players is certainly an ambitious plan. I can't even fathom what the XML would even look like with that kind of political landscape... let alone how to make it AI compatible.

                                    Just the Garrison unit alone with it max units per territory is likely already beyond its comprehension level.

                                    "A joyous heart sours with the burden of expectation"
                                    Hepster

                                    N 1 Reply Last reply Reply Quote 0
                                    • N Offline
                                      Name @Hepps
                                      last edited by

                                      @Hepps said in Simple Trigger Help:

                                      @Name 30 players is certainly an ambitious plan. I can't even fathom what the XML would even look like with that kind of political landscape... let alone how to make it AI compatible.

                                      That's why I'm leaning towards fixed alliances, but I prefer adding some triggered changes to better represent the era (see previous post). The AI won't handle it perfectly, it might invade triggering territories at times it won't have the strength to deal with an additional enemy or two. But I think it's an acceptable middle ground solution. And those territories won't be too many so no extensive coding added to the large task (many factions and total territories).

                                      Just the Garrison unit alone with it max units per territory is likely already beyond its comprehension level.

                                      Even with overpurchasing garrisons the hard AI isn't a pushover so far. It can even use them later to quickly replentish it's defenses. But I'm interested in an alternative defense system. The first idea I was using was "factories" having some defense, which has impact (but only if friendly troops are present). Could consider falling back to that or use some new suggestion.

                                      1 Reply Last reply Reply Quote 2
                                      • C Offline
                                        Cernel Moderators @Name
                                        last edited by

                                        @Name said in Simple Trigger Help:

                                        @Cernel @redrum

                                        Decent AI compatibility is a must. I want to be able to play the game solo or hotseat with a few friends. So far it works rather well, besides a couple of issues.

                                        For what I've read so far, I've a hard time believing this map plays rather well with any AI, but you have the map, so I guess I should take your word.

                                        In this case, you should definitely follow a Feudal Japan style setup, in which every power is on its own (FFA) and you have a simple politics set of rules, then the map being played by taking 1 power per each person in the game, assigning all remaining ones to Hard AI.

                                        You can have the politics working not too badly as long as you don't use any archetype alliance and allows downgrading from any relationships directly to war (for something like alliance, just use the archetype Neutral, but allowing moving into territories, and be sure that you can directly go from that to war).

                                        I strongly suggest not doing any extreme hacks like the ones you described. We already have maps that were tailored around the limits of the old AI, and now that AI is completely gone, and the maps are there broken. Rather, make some chance triggers to give some of the units the AI doesn't buy, removing the resources that would be needed to purchase them, before such a phase (basically, random purchasing for part of the money). You would need adding something to tell the triggers if the player is AI or not, for example like Feudal Japan does with its various triggers adding Ashigarus, et cetera, for AI powers, depending on having placed stuff on boxes, at start game.

                                        N 1 Reply Last reply Reply Quote 0
                                        • N Offline
                                          Name @Cernel
                                          last edited by

                                          @Cernel said in Simple Trigger Help:

                                          For what I've read so far, I've a hard time believing this map plays rather well with any AI, but you have the map, so I guess I should take your word.

                                          Don't exactly take my word. I'm a tripleA newbie, even though a rather experienced TBS/RTS/Grand Strategy player. I actually haven't played much of any map to have a good comparison, but can usually beat HardAI in my map with relatively unfavorable conditions, not without a challenge though. Most of it's functions work well I think (minus garrisons and maybe negative isMarine?). I haven't edited much from the core gameplay and alliances are still fixed. Maybe the map having multiple resources (several of them used for upkeep besides purchace, one of them also fuel) could be a downgrade on the AI?

                                          In this case, you should definitely follow a Feudal Japan style setup, in which every power is on its own (FFA) and you have a simple politics set of rules, then the map being played by taking 1 power per each person in the game, assigning all remaining ones to Hard AI.

                                          You can have the politics working not too badly as long as you don't use any archetype alliance and allows downgrading from any relationships directly to war (for something like alliance, just use the archetype Neutral, but allowing moving into territories, and be sure that you can directly go from that to war).

                                          This system seems very tedious to code, especially with so many players, and I'd like true alliances since they are appropriate for the setting. I think I'll go with fixed alliances and probably add some conditions to change them as I described. If this works badly I'll probably revert to just fixed alliances or consider your suggestion.

                                          Btw Feudal Japan uses this, so I'm confused.

                                                  <attachment name="relationshipTypeAttachment" attachTo="Allied" javaClass="games.strategy.triplea.attachments.RelationshipTypeAttachment" type="relationship">
                                                    <option name="archeType" value="allied"/>
                                                    <option name="canMoveLandUnitsOverOwnedLand" value="true"/>
                                                    <option name="givesBackOriginalTerritories" value="false"/>
                                                    <option name="canTakeOverOwnedTerritory" value="false"/>
                                                  </attachment>
                                          

                                          I strongly suggest not doing any extreme hacks like the ones you described. We already have maps that were tailored around the limits of the old AI, and now that AI is completely gone, and the maps are there broken. Rather, make some chance triggers to give some of the units the AI doesn't buy, removing the resources that would be needed to purchase them, before such a phase (basically, random purchasing for part of the money). You would need adding something to tell the triggers if the player is AI or not, for example like Feudal Japan does with its various triggers adding Ashigarus, et cetera, for AI powers, depending on having placed stuff on boxes, at start game.

                                          I'll consider that among the options, not sure yet on how to handle this.

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

                                            @Name

                                            • "Garrisons" (0/3/0), maximum of 4 per territory are a central part of the gameplay. But the AI won't buy them or I have to use "hacks" giving them 1 movement (triggered movement change during purchase, requiresUnitsToMove, or the best it seems, givesMoment -1 from factory type units). But if I use those hacks, the AI often buys more Garrisons than it can place.

                                            Yeah, the AI currently doesn't support purchasing non-factory 0 movement units. This is something that I'll probably look to add soon as enough maps have them that its probably worth it.

                                            • I'm under the impression (could be wrong though), that the AI doesn't consider nevative isMarine when launching naval invasions and I have the majority of land units at isMarine -1 or -2.

                                            Not sure on this one. Very few if any maps use negative isMarine so I can't remember if the AI handles that or not. I'll have to take a closer look.

                                            If you want a sort of fixed with some triggers system, I would probably model it after something like Global 40. Where based on certain conditions, nations can/will declare war on each other but that generally there are fixed alliances just that maybe some of them don't start out as at war.

                                            What I meant by that is that when a trigger to (potentially) change relationship is activated (say Player1 captured region X )
                                            - If Player2 is AI it is given a set reaction (declare war on Player1) or a chance (say 1:6 to declare war - maybe increasing by further 1:6 each passing turn).
                                            - If Player2 is Human, they are given a choice (User/Political Action I guess), to declare war if they want.
                                            

                                            This should be possible though you may need to create a prompt like in Greyhawk Wars to set a flag whether each player is human or AI to then be used to determine which action or trigger is fired.

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

                                            N 1 Reply Last reply Reply Quote 4

                                            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
                                            • 2
                                            • 3
                                            • 4
                                            • 2 / 4
                                            • First post
                                              Last post
                                            Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums