Handling of AI players not meant to be played - Github request.
-
So I think I'm going to rename the properties to:
- isAIDefault
- isHidden
This shouldn't affect bots at all (they would still be shown as human players).
-
@redrum
So, so. "isHidden" feels a bit vague to me, and it is not making clear that player would be AI too (one might think it gets just disabled). I didn't give an alternate suggestion, as I couldn't really figure something really telling.
But doesn't it feel a bit weird having the "isHidden" forcing it being "isAIDefault" too? I suggest "isHidden" doing nothing else but to hide it, meaning that "isHidden" would still keep the player assigned to the normal default (the one hosting the game, in a private host), unless the mapmaker also set "isAIDefault" true. It is true that you probably want to almost always have "isAIDefault" true for all players having "isHidden" true, but you should consider that here we are talking of a functionality to be set by mapmakers, not by regular users, so straight coding and simpler functionality should be preferred over bundling stuff just because it makes the only sense (it can be expected the mapmakers to take care not to forget to assign "isAIDefault" as correctly intended; no need to force).
Moreover, I can see some borderline cases in which you might want "isHidden" without "isAIDefault", for example a passive player that is supposed by rules to take casualties in a specific way, not supported by the AI (so, the player hosting the game would make the work of taking out casualties correctly, like you would when playing a boardgame, without a robot doing it), or if you have purely utility players meant just to somewhat setup the game at the start of it, like the "GameSetup" player of "FeudalJapan" (it might make the most sense it not showing, but being assigned to the hoster, just like it is the hoster to define Map Options before firing up).
But I agree that all uses of an "isHidden" player being not "isAIDefault" would be either strange or hackish; so the main reason I would not force is just to keep it clean code-wise, as I trust the map makers can just take care themselves to set both true, when needed (and it can be written in pos2 to take care to set "isAIDefault" true for any players having "isHidden" true, when such players are not supposed to be played by any human). This is just my personal preference of keeping the functionalities straght and simple, even in the case when having one means you almost surely want another too. If you prefer forcing, then I suggest you still keep it simple, and just make the game crash if a player is "isHidden" true but "isAIDefault" false; this is how the code normally works. For example, if you give an air-only ability like "isStrategicBomber", or something, to something that it is not air, it doesn't automatically turn that unit into an air unit, but it just makes the game crash, because not compatible.Will the "AI" and "Neutral" at the start of the name be kept being supported as a way to set "isAIDefault" true? If yes, deprecated or fully supported?
-
Otherwise I guess maybe calling it "isAIHidden".
-
I've decided to go with:
- isAIDefault
- isHidden
And make it so "isHidden" just controls whether the player is shown not making the AI default as it does make the properties more straightforward.
Prefixing names with "AI" and "Neutral" will no longer be supported as it was really a hack in the first place. We'll need to work to update any popular maps that used these once this is released.
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.
-
@redrum
Sounds sweet!
I don't know how many maps use the AI prefix, but many, if not all, my 7 maps do. So I would really like if it was announced when a new stable TripleA goes live and when the XML should be updated and how to do this. I would just need a 24 hours notice I guess. If I update my XMLs to soon, then they will not work right when folks download, right? -
@Frostion Yeah, we won't want to update any maps til we release the next stable.
-
The PR to address the first 2 points is now merged and can be tested in the pre-release.
-
-
@redrum I have never used the does nothing AI for anything else then testing, as a way to get through the player list quickly to the point where I can take control of a specific player.
But maybe your idea is good for any future versions of AI players? Like AggressiveAI, AirFocusedAI, MindlessAI? Just a thought

-
@redrum
Beside testing, I only use does nothing in FFA as a quitter substitute. It also automatically accepts anything, and this is a behaviour that was set (by veqryn) after I requested it, for lost FFA players (initially, it used to refuse everything, which is the behaviour for unused players, but not really good when you want to turn some player passive in a FFA).
I don't actually know why Does Nothing does an initial placement, instead of actually doing nothing.
In TripleA, "Player" means the in-game one, not the one playing it, that it is the PlayerType, thus:playerTypeDefault="Does Nothing"
playerTypeDefault="AI"
playerTypeDefault="Human"Default to "Human" if not set.
As said, my only problem with "Does Nothing" is that it does an initial placement instead of actually doing nothing, and this is a bit confusing and I don't get it. I'm not sure if maybe this was intended by Veqryn for Risk?
-
@Cernel
Basically, what I was saying, is that the most important gaming use I see for "Does Nothing" is when you play 3+ sides games and one or more of the players quit and they get turned to "Does Nothing" (that also accepts anything). Of course, this is of no relevance in 2 sides games, since they just end when one quits. -
@Cernel So TWW is an example of where "Does Nothing" is used for neutral nations. @Zjelcop Put in a feature request a while back requesting that as well: https://github.com/triplea-game/triplea/issues/457
-
@redrum I was going to say something....
If I remember correctly Do nothing buys... but does not move at all.
-
@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.
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