Making RISK within TripleA - Help Requested
-
@slendymctendies
This map is a lot smaller in code than the Settlers: Fallen Empire and so might be easier to follow, but it was my first published random map and so the comments might be weak.https://forums.triplea-game.org/topic/2399/settlers-age-of-tribes-official-thread
You can have two xml within the same map and
- have Capitals/Fixed and Random territories (like The Shogun)
- have Random territories (like Settlers: Age-of-Tribes)
Just in case you dont know, because a territory has
<option name="capital" value="none"/>does not mean it is fixed location, this code is to help the AI aim for a Victory City/centre.
In your case both xml would be almost the same, but the fixed capital code would be in one and not the the other.
-
@beelee After looking through "The Shogun" I found how they detached the necessity for Capitals (and edited to fit my game):
<variableList> <variable name="AllPlayers"> <element name="Germans"/> <element name="Russians"/> <element name="Japanese"/> <element name="Americans"/> <element name="Chinese"/> <element name="British"/> <element name="Italians"/> <element name="French"/> </variable> </variableList> <playerList> <!-- In turn order --> <player name="Germans" optional="false"/> <player name="Russians" optional="false"/> <player name="Japanese" optional="false"/> <player name="Americans" optional="false"/> <player name="Chinese" optional="false"/> <player name="British" optional="false"/> <player name="Italians" optional="false"/> <player name="French" optional="false"/> </playerList> <attachmentList> <!--Remove Capital Requirement--> <attachment foreach="$AllPlayers$" name="playerAttachment" attachTo="@AllPlayers@" javaClass="games.strategy.triplea.attachments.PlayerAttachment" type="player"> <option name="retainCapitalNumber" value="0"/> <option name="retainCapitalProduceNumber" value="0"/> </attachment> </attachmentList>After doing some testing, gameplay proceeds as normal with no players/factions controlling their capital. This is what I will use, seeing that territory selection in itself is going to be a nightmare. Maybe I'll revisit Capital selection some other time, right now I just want a working concept
-
@thedog I got the random/manual territory selection to work!
Now I just have to re-balance the production values of certain territories to make it fair.
This effectively finishes my "proof of concept". However, there are a few more things that would make it complete:
- "Objectives" - AKA "Continent Bonuses" - to augment PU gain when controlling an entire Continent
- Automated "Victory" Announcement
- Automated Politics (Alliances/War Declarations/Neutralities without "Edit Mode" - and usable by the AI)
-
@slendymctendies
The Shogun has #2 and #3.#2 Automated "Victory" Announcement: Search for
"GO NOTIFICATIONS for all players of an impending clan political allied Victory"
also see file notifications.properties
and
"GO VICTORY" will be just underneath it in the xml.
and see file objectives.properties#3 Automated Politics is not simple. AFAIK The Shogun is the only xml/map to have foreach code for Politics having hundreds of lines of code instead of thousands.
Search GO POLITICS
Search "AllPlayers less one CLAN" this block of code is needed for Politics
You will also need to populate politicstext.properties#1 As to Continental Objectives download Ebbe's WW2 Oil and Snow
https://forums.triplea-game.org/topic/2700/ww2-oil-and-snow-1st-ed-new-map-release
This has national objectives, but can easily be changed to global objectives for all.Happy coding.
-
@slendymctendies If you don't have capitals on the map, the AI will not be aggressive. I suggest designating high value territories as capitals for a player that does not do anything.
-
@rogercooper The capitals still technically exist, they're just owned by a "Null" player (Do-Nothing AI) by default and the other players are not required to own a capital to keep producing units (like in RISK).
The AI have still been playing and being aggressive against opponents, but they tend to act weirdly towards Neutrals. The political system is something I'm still working on and figuring out.
This isn't really meant to be played with AI, but it functions well enough right now.
-
@thedog How do I make the VC requirement adjustable?
I see how the victory condition is checked in your examples with a static value of 11, but I'd like to make it adjustable in the map options between 11 and 21.
-
@slendymctendies Here is the code from the Pact of Steel 2 which documents many properties.
<!-- victory options --> <property name="Projection of Power" value="true" editable="true"> <boolean/> </property> <!-- format of "<alliance> <Name of Victory Condition>" --> <property name="Axis Projection of Power VCs" value="11" editable="false"> <number min="10" max="15"/> </property> <property name="Allies Projection of Power VCs" value="11" editable="false"> <number min="10" max="15"/> </property> <property name="Honorable Surrender" value="false" editable="false"> <boolean/> </property> <property name="Axis Honorable Victory VCs" value="12" editable="false"> <number min="10" max="15"/> </property> <property name="Allies Honorable Victory VCs" value="12" editable="false"> <number min="10" max="15"/> </property> <property name="Total Victory" value="false" editable="true"> <boolean/> </property> <property name="Axis Total Victory VCs" value="15" editable="false"> <number min="10" max="15"/> </property> <property name="Allies Total Victory VCs" value="15" editable="false"> <number min="10" max="15"/> </property> <property name="Economic Victory" value="false" editable="false"> <boolean/> </property> <property name="Axis Economic Victory" value="120" editable="false"> <number min="0" max="1000"/> </property> <property name="Allies Economic Victory" value="120" editable="false"> <number min="0" max="1000"/> </property> <!-- Triggered Victory is a victory condition set by a trigger, using a condition or national objective --> <property name="Triggered Victory" value="true" editable="true"> <boolean/> </property> -
@slendymctendies said in Making RISK within TripleA - Help Requested:
@thedog How do I make the VC requirement adjustable?
I see how the victory condition is checked in your examples with a static value of 11, but I'd like to make it adjustable in the map options between 11 and 21.
Yes, I would like to do the same, Im not sure you can make a Trigger Victory for POLITICALLY ALLIED using alliedOwnershipTerritories as a variable.
The only way I thought of doing it was to have multiple xmls with fixed VCs and with the VCs listed in the Title of the scenario/map.
eg.
Risk WW2 global 15+vc
Risk WW2 global 17+vc.
For one faction but non allied, Roger has listed the options. -
@thedog @RogerCooper Thank you for this feedback. I think I'm going to go with a dual-victory condition. One if a single player controls 11+ VCs, and one if an Alliance controls 18+ VCs.
This alone should provide decent variety in itself, and obviously things can be tweaked into alternate VC sets.
I've also set up a rudimentary Politics system (War/Neutral/Ally) which should more than suffice for its purposes.I've also managed to figure out how to set the number of claimable territories at the beginning of the game and whether it's random or manual selection.
Now I can do some genuine play-testing and get this idea to an official "1.0" state.
Thank you all so much!
EDIT: How do I set it to "Request" a political change to another player? For example, I have this in my "politicstext.properties" file:
German_Russian_Alliance.BUTTON=Offer Alliance German_Russian_Alliance.DESCRIPTION=Offer alliance with the Russians. German_Russian_Alliance.NOTIFICATION_SUCCESS=The Russians have ACCEPTED your Alliance proposal! German_Russian_Alliance.OTHER_NOTIFICATION_SUCCESS=The Germans and Russians have formed an Alliance! German_Russian_Alliance.NOTIFICATION_FAILURE=The Russians have REJECTED your Alliance proposal! German_Russian_Alliance.OTHER_NOTIFICATION_FAILURE=NONE German_Russian_Alliance.ACCEPT_QUESTION=Enter an Alliance with the Germans?How do I use "ACCEPT_QUESTION" properly?
EDIT2: I think I found it in "Pact of Steel"
-
@slendymctendies said in Making RISK within TripleA - Help Requested:
@thedog How do I make the VC requirement adjustable?
I see how the victory condition is checked in your examples with a static value of 11, but I'd like to make it adjustable in the map options between 11 and 21.
I may be misunderstanding, but can't you set the property to "true", which then allows you to modify it in map options ?
<property name="Axis Total Victory VCs" value="15" editable="false">
<number min="10" max="15"/>
</property> -
@beelee I could be misunderstanding too. I'll be posting the Git Repository for this map soon so people can help in a more direct manner if they choose to, or if they want to play the map.
I'm currently working on the wiki section. -
@slendymctendies said in Making RISK within TripleA - Help Requested:
EDIT: How do I set it to "Request" a political change to another player? For example, I have this in my "politicstext.properties" file:
Search for
<!-- GO Politics phase for all at the end of the turn -->
This block of code at the end of the step sequence means that all players/AI get a chance to ask Politics questions in that step order.Keep searching for GO Politics to find all politic elements of the code in the xml.
in GO POLITICS ATTACHMENTS
<option name="text" value="Amago_War_@AllPlayers-Amago@"/>
The text value is the variable text that links to the text line in politicstext.properties, they must match(be paired) for it to work.How do I use "ACCEPT_QUESTION" properly?
This line and similar lines requires a player to answer a popup question.
<option name="actionAccept" value="@AllPlayers-Amago@"/>In the the above case its for all players, that it applies to, except Amago to answer the question.
The reason why Amago is excluded is because they are asking the question to be answered. -
@thedog Thank you. I did find another example of this in "Pact of Steel" and applied it as desired. (I still need to confirm it's working, but based on what you posted it should work.)
-
@TheDog I'm struggling to get the victory notifications to work. I'm not sure what I'm doing wrong.
-
I think you might have to post an extract of the code
Use the </> button to encapsulate the text to make it code. -
@thedog Here's the GitHub repository. The branch I'm working on is "0.1.0".
https://github.com/SlendyMcTendies/ww2_risk_of_defeat/tree/0.1.0
You're going to see a lot of different "Victory" Condition/Notification code commented out because I was trying everything I could think of.
-
Remove the comments from 6220-6224 as that is required for any trigger code.
Line 6258 needs to be trueLine 6236 might need to be true depending on the code you use
Try that for now.
To get the code working around 6229-6234 you need to remove the comments that are required to make it work at line 1364 to 1378, but I think you have worked that out.
-
@thedog Yup. That worked. Idk how I didn't put that together. Thank you very much!
-
I want to limit the number of times players can perform Political Actions per turn. I've noticed that people can offer alliances, then immediately turn around on those alliances, as well as every other Political Action.
The solution I have in mind is adding a new resource, which I'm calling "Influence Tokens", but I only want the players to have a specific number Influence they can use each turn. Right now I'm thinking 3, and I only want players to have 3 Influence Tokens to use each turn, regardless of how many they used on the previous turn.
How would I implement this?
I looked through the reference material everyone has suggested to me very hard, but I still can't quite find a solution.
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