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

    Hard or Does Nothing AI for unactive players

    Scheduled Pinned Locked Moved Map Making
    34 Posts 3 Posters 7.5k 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.
    • redrumR Offline
      redrum Admin @Cernel
      last edited by

      @Cernel The "Neutral" (null) player uses the same casualty selection as "DoesNothing" which is essentially the default plus interleaving carriers and planes. I would recommend using this for any player that is just taking part in battles and not meant to move/purchase/etc.

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

      LaFayetteL C 2 Replies Last reply Reply Quote 0
      • LaFayetteL Offline
        LaFayette Admin @redrum
        last edited by

        @redrum Are you sure it's not actually weak AI that neutral player uses? Is it indeterminate and based on the location of code?

        For example, in casualtySelector.java:

            final Player tripleaPlayer =
                player.isNull() ? new WeakAi(player.getName()) : bridge.getRemotePlayer(player);
        

        From what I can tell DNAI is weak AI that does not move. Weak AI shares the same casualty selection as ProAI where it uses default casualty with interleaved carriers+figs.

        C redrumR 2 Replies Last reply Reply Quote 0
        • C Offline
          Cernel Moderators Lobby Moderators @redrum
          last edited by

          @redrum said in Hard or Does Nothing AI for unactive players:

          @Cernel The "Neutral" (null) player uses the same casualty selection as "DoesNothing" which is essentially the default plus interleaving carriers and planes.

          Good to know, this is exactly what I wanted and what I actually went with, since nobody answered me 2 months ago.

          I would recommend using this for any player that is just taking part in battles and not meant to move/purchase/etc.

          Also for players (like this one) having "Conduct Combat" phases and attacking during the same? If positive, can we document this as intended and "stable" somewhere?

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

            @LaFayette said in Hard or Does Nothing AI for unactive players:

            @redrum Are you sure it's not actually weak AI that neutral player uses? Is it indeterminate and based on the location of code?

            For example, in casualtySelector.java:

                final Player tripleaPlayer =
                    player.isNull() ? new WeakAi(player.getName()) : bridge.getRemotePlayer(player);
            

            From what I can tell DNAI is weak AI that does not move. Weak AI shares the same casualty selection as ProAI where it uses default casualty with interleaved carriers+figs.

            I guess what @redrum means is that the "Neutral" player is using Weak AI too?

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

              @LaFayette Weak AI and DoesNothing AI are the same as well since they both use Abstract AI selectCasualties (this probably should actually be updated to be DoesNothing AI since that makes more sense but is just a code issue). No, ProAI uses a separate casualty selection that is more advanced than Weak/DoesNothing: https://github.com/triplea-game/triplea/blob/master/game-core/src/main/java/games/strategy/triplea/ai/pro/AbstractProAi.java#L346

              @Cernel Sorry, I think I missed this thread. Yeah, a brief definition should probably be added to POS2 XML. Yes, "Neutral", DoesNothing, and Weak all use the same casualty selection which is default plus interleaving carriers and planes. Once the current PR that is potentially altering this is decided on then an update would be good.

              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 0
              • LaFayetteL Offline
                LaFayette Admin
                last edited by

                I suppose it's getting to be a pedantic point, though WeakAI is the one used for casualties it appears.

                Yeah, a brief definition should probably be added to POS2 XML

                I would disagree, players want to know this information as well for what a given AI does. As far as I'm concerned though AIs should not be a tool of map makers and maps should not be aware of AIs. On the other hand selecting more players to be neutrals via another means would be the right feature. Any cases where we really want a player to just mindless place units can be considered apart from AIs (for example, wouldn't triggers be able to accomplish that just fine?)

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

                  @LaFayette said in Hard or Does Nothing AI for unactive players:

                  As far as I'm concerned though AIs should not be a tool of map makers and maps should not be aware of AIs.

                  I think most map makers would disagree with this. Either I'm misunderstanding or just not seeing how you would handle the various maps that are defaulting players to AI and using hidden players.

                  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 2
                  • C Offline
                    Cernel Moderators Lobby Moderators @LaFayette
                    last edited by

                    @LaFayette said in Hard or Does Nothing AI for unactive players:

                    Any cases where we really want a player to just mindless place units can be considered apart from AIs (for example, wouldn't triggers be able to accomplish that just fine?)

                    So, I thought I made this clear, but I'll further clarify that FOR THIS ONE GAME DNAI is not required to place anything, as all the placements is made by triggers. What DNAI should be doing in this one is mindlessly attacking, resolving battles in a random order and taking casualties always by the autoselector (it has no retreat decisions, since the units are placed directly into the enemy territories).

                    1 Reply Last reply Reply Quote 0
                    • LaFayetteL Offline
                      LaFayette Admin
                      last edited by

                      @Cernel my comment was more directed to @redrum who has stated it would be more flexible for DNAI to place but not purchase.

                      My opinion is that DNAI should behave like a neutral player.

                      From another perspective, IMO using AI to get the behavior of a neutral player is a bad way to go. Instead I think the right feature is to be able to mark players as neutral which would remove their player slots and avoids loads of confusion and frankly other hackery.

                      But for your prospective map and perhaps any others, I do wonder, @Cernel why not use a true neutral player?

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

                        @LaFayette said in Hard or Does Nothing AI for unactive players:

                        But for your prospective map and perhaps any others, I do wonder, @Cernel why not use a true neutral player?

                        I tried to use the "Neutral" player, at first, but it didn't work, either because you cannot assign phases to it or because you cannot assign triggers to it or both (I don't exactly remember, as I opened this topic 2 months ago).

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

                          @redrum said in Hard or Does Nothing AI for unactive players:

                          No, ProAI uses a separate casualty selection that is more advanced than Weak/DoesNothing: https://github.com/triplea-game/triplea/blob/master/game-core/src/main/java/games/strategy/triplea/ai/pro/AbstractProAi.java#L346

                          Right, this is the reason why I would prefer avoiding using "Hard" AI (thus I need "Does Nothing" AI, or something like that), especially since it can be changed any time in the future. I don't want this player to "think" about what to select, but just always go by the autoselect. For example, if, on the last round of a battle, you have a 2/1 and a 1/4 units left and the killed defenders hit once, a thinking player may decide to take out the 2/1 unit, while this non-thinking player should always take out the 1/4 one, instead.

                          LaFayetteL 1 Reply Last reply Reply Quote 0
                          • LaFayetteL Offline
                            LaFayette Admin @Cernel
                            last edited by

                            @Cernel Thanks. This sounds like the "convenient but not appropriate" anti-pattern. Lacking the right tool, we used an existing one that was not the right one but made it to work. Instead it sounds like the game engine should be modified to accommodate what you want without using an AI. In other words, instead of an inappropriate hack that is "easy", and breaks design at long term cost, we should instead look at requirements and how to natively support them.

                            1 Reply Last reply Reply Quote 0
                            • LaFayetteL Offline
                              LaFayette Admin @Cernel
                              last edited by

                              @Cernel Weak and DNAI are in theory no different from Pro in terms of mutability guarantees. They could change. I'd suspect DNAI is the safest as 'doing nothing' is the most stable and should not be modified beyond the bounds of its intent. Since they both use the same casualty selection, it is subject to change. In practice probably not as we know there are dependencies, but the fact that such dependencies have been created is a problem and should be avoided and removed.

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

                                I'd actually argue that the regular neutrals on maps is the "hack" and weird "null" player isn't ideal. Really DNAI should be the standard neutral AI player always used for even regular neutrals like on NWO/WaW and should be flexible enough to allow triggers/phases. It should be well defined and generally not change. The problem is the "null" neutral was created in the engine first so I believe when the limitations of it not being a real "ai/player" were then realized later on (can't have triggers/phases/etc) the DNAI was created.

                                This isn't the case for weak/fast/hard AI which are meant to be "intelligent" AI that try to do all the possible actions given to them and optimize their chance of "winning".

                                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 Lobby Moderators @redrum
                                  last edited by

                                  @redrum Hack or not, a minor problem I have with "Neutral" is that it is a mandatory name, you cannot customize. In this particular game, the DNAI player is called "barbarians" and it would be quite silly to call it "Neutral", in the moment it is attacking everyone!

                                  Also "Neutral" is a very bad name even for NWO and such, since we also have the relationship archetype "Neutral", that means the player is actually "Neutral", while the "Neutral" player itself is not "Neutral" at all, but always "Enemy" to everyone (that would be the archetype "War", not "Neutral", for relationships and politics). There is really nothing "Neutral" about the "Neutral" NWO player: it is an "Enemy" (to everyone) player that never moves or attack.

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

                                    @Cernel Example: If you have "Neutral" relationship ships and you go in their sea zone, nobody attacks anybody (since everyone is neutral to each other), but if you have "Neutral" ships and you go in their sea zone, you must attack them (since everyone is at war with each other). Very bad mixing of the exactly same definition for two different and almost opposite things, if you ask me.

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

                                      @Cernel Yeah, customizing the name is another good point about why the default "neutral" (null) player is less than ideal.

                                      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
                                      • LaFayetteL Offline
                                        LaFayette Admin
                                        last edited by

                                        It almost seems there should be a third category of player for specific game mechanics, like neutral, or special players that should not receive resources. Such a category of player would be defined by a map and not available to change. With luck that would work in hosted games without any additional updates and would avoid the confusing situation where a player has to "know" which players to set to DNAI and which ones are meant to be played.

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

                                          @LaFayette Still not following you. What you seem to be describing is essentially set players to default to DNAI and using isHidden=true.

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

                                          LaFayetteL 1 Reply Last reply Reply Quote 0
                                          • LaFayetteL Offline
                                            LaFayette Admin @redrum
                                            last edited by

                                            @redrum Having neutral players be represented by null is a hack of its own. That is an implementation detail.

                                            For example, Conquest, with a DNAI player, it should do the random placement of territory selection and place its units but otherwise not move. Let's say we wanted another player to be a neutral buffer that did not place. In such an example it would not place and would not have a turn. In this scenario you could replace the DNAI with another AI and it would still be a 1v1 if you play against it. But say you want to make it interesting with neutrals occupying part of the map, that could not be done. Hence potentially a "third player type" that is effectively a combination of DNAI, isHidden=true, and does not collect, spend, nor place units (and is in effect, a neutral)

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