Handling of AI players not meant to be played - Github request.
-
@Hepps It buys and it places but it also destroys all income, which implies that, normally, it can buy only on the first turn of the game for that player. I don't actually know what this behaviour is for; I suggest asking Veqryn in GitHub (as he doesn't read here).
As said, myself, beside testing, I only ever use Does Nothing for do what it says, assigning it to players of quitters in FFA (if we don't want to turn quitters to an actual AI, which I'm tendentially against to, for FFA meant not to be played with AI, to start with).@redrum I would take that issue out of "ice box", based on the new directives, as it looks like this topic is on it.
-
I actually seem to vaguely remember that Veqryn created Does Nothing mainly for FFA, for some reasons, but maybe I'm wrong here, and not at all. I can see no other alternatives but asking Veqryn exactly what the behaviour of that AI is for, if he still remembers, unless there is some documentation somewhere, about it, or anyone wants to delve into the old forum, in case. Also remember that if you want just to disable a player, you can do it unticking its "use" (I don't do that for Napoleonic Empires FFA quitters (or other politic FFA), because that would set as refusing all politics, while I want neutralised players to accept all, which is the Does Nothing behaviour).
-
@Cernel Another item of the un-use vs set to Does Nothing is that un-use removes all phases; so you may have players you want them to do nothing, while not losing their phases, in case of triggers firing. Like a game presenting the option of having, either, some players active or neutral-like (for example, I could make the "Neutral" of 270BC into an "AI_Barbarian" player, and tell in notes to set it to "Does Nothing", if people wants it to be just like the old Neutral stuff).
-
@Cernel @Frostion I've made the latest changes to allow setting default player type in game XML: https://github.com/triplea-game/triplea/pull/2048. Once the next version is released then I will update Pact of Steel 2 XML.
So there are 2 new player properties:
- defaultType - optional, default is "Human"; options are "Human", "AI", "DoesNothing"; sets player to this type by default in the player selection window
- isHidden - optional, default is "false"; options are "true", "false"; if true doesn't show player in player selection window
Examples:
<player name="Germans" optional="false" defaultType="AI" />
<player name="Italians" optional="false" defaultType="DoesNothing" />
<player name="Japanese" optional="false" defaultType="DoesNothing" isHidden="true" />@Cernel If you want to discuss "Does Nothing" purpose or changes then let's open a different thread so we can keep this focused on game XML settings for players.
-
@redrum Cool. I suggest also explicitly informing that when you set isHidden true you are also usually (but not necessarily) supposed to set the same player not to Human. Otherwise some might get confused and think that if something is hidden then it is not selected or even disabled.
-
@redrum I want to add that I specifically like this for a map I'm making, where I have a bunch of neutral players that will be nice to be able to hide. Still, I'm thinking leaving them starting as "Neutral_" anyways.
-
@redrum
When will the latest build release have this? I guess version .5470 does not have this option yet?
PS: I will surly update my maps to use this feature when a new TripleA version is officially out. -
@Frostion The changes are in the latest pre-release now so feel free to test it out. Hopefully we will have a target release date for the next TripleA version soon. I believe you should be able to add the new parameters now and they won't have any impact on the current TripleA release version as it should just ignore them.
-
@redrum said in Handling of AI players not meant to be played - Github request.:
In general, using hacky prefixes or suffixes on strings is something we want to move away from. If there are others please open an issue so we can look to create proper attributes for them.
The fact that islands are handled by looking if their sea zones have names ending exactly in "Sea Zone" might be a good candidate...
https://github.com/triplea-game/triplea/issues/1331 -
@redrum
I think there is something wrong with the feature you made. Things seem to work fine when I use a setup like this:<player name="Slovakia" optional="false" defaultType="AI" isHidden="false"/>
In the above case the game starts / has a default setup with the AI controlling Slovakia. I can see this both before gamestart and in the game after startup. The AI controls Slovakia.
But if I in the XML sets isHidden=true, then Slovakia is under human control when it is Slovakias turn. Is this not a flaw?
When looking at the "game history – Game loaded", it seems that all hidden players are automatically set to human, even though they are, in my XML, defaultType=AI.
-
@Frostion Good catch. I broke this functionality when I added the "default" option to the set all player dropdown
It should now be fixed with https://github.com/triplea-game/triplea/pull/2149. Please test with the latest pre-release.
-
@Frostion Have you gotten a chance to test after I made the fix here?
-
@redrum Yes. I am testing it out in Iron War Europe and it seems to work now. I at least have not seen any problems. I like this feature And will do an XML update on all my maps when the engine supports it.
-
@Frostion Cool. I still need to add it into the POS2 XML as well.
-
Updates to the POS2 XML: https://github.com/triplea-maps/the_pact_of_steel/pull/2
-
@redrum
What ETA would you give on the public release of a TripleA version that handles these features? I was thinking that I could work on updating my maps in advance and just not upload it yet. -
@Frostion Hoping to release in the next week. We are going through some testing and fixing a few bugs that were found. You should be able to make a PR in github or make the changes local and not upload them then wait til its released.