Pack UI = artificial stupidity?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chris
    PosChengband Maintainer
    • Jan 2008
    • 702

    #16
    Originally posted by ewert
    The difference is, a "is friend hurt" is checked at every pass, whereas "I'm hurt guys" only happens when hurt. Say a pack of 12 hounds:

    Every monster turn: 12 checks for if hurt for all LoS
    vs.
    Player damages monster: 1 check for all LoS to set "hurt" flag per damaged monster. It could even check for "hurt" flag prior checking LoS, since that is a single boolean check vs. complex LoS computing.

    Okay we have officially gone into geekdom now, we have gigahertz computers and we are debating code efficiency in an ascii game! ... =P Woooot!
    Just throwing out an idea I am planning on working on at some point:

    [1] New static array: mob_info.
    [2] New field on each monster: mob_idx.
    [3] When a mob is generated, a mob_info record is initialized and all monsters in the mob get the same unique mob_idx.
    [4] The mob_info controls AI for the entire pack.
    [5] Different mobs can behave differently.
    [6] Mobs can have a boss. Kill the boss, and the mob breaks morale (mob_info.ai = MOB_FLEE or something).
    [7] Kill a member of the mob, and the entire mob rolls a morale check.
    [8] Wake up a member of the mob, and it will attempt to wake up its buddies.

    etc. But I think this sort of implementation would be rather efficient, and offer up a lot of opportunities for flexible monster behavior.

    Anyway, I haven't done it yet ... but maybe somebody else can beat me to it and let me know how it works out



    Cheers,
    --Chris

    Comment

    • Sirridan
      Knight
      • May 2009
      • 560

      #17
      Originally posted by chris
      Just throwing out an idea I am planning on working on at some point:

      [1] New static array: mob_info.
      [2] New field on each monster: mob_idx.
      [3] When a mob is generated, a mob_info record is initialized and all monsters in the mob get the same unique mob_idx.
      [4] The mob_info controls AI for the entire pack.
      [5] Different mobs can behave differently.
      [6] Mobs can have a boss. Kill the boss, and the mob breaks morale (mob_info.ai = MOB_FLEE or something).
      [7] Kill a member of the mob, and the entire mob rolls a morale check.
      [8] Wake up a member of the mob, and it will attempt to wake up its buddies.

      etc. But I think this sort of implementation would be rather efficient, and offer up a lot of opportunities for flexible monster behavior.

      Anyway, I haven't done it yet ... but maybe somebody else can beat me to it and let me know how it works out



      Cheers,
      --Chris
      I'd like this, I was thinking something similar for my py version, (although later, since for now I want it to be straight vanilla).

      This could make things like orc pits very deadly... especially if monsters like archers start to stand back and shoot while others run forward. Imagine stepping into a room and 8 kobold rangers start taking pot shots at you while the shamans just cast and the large ones rush in?

      As for point [6], maybe the mob pack could also have multiple bosses? Such as you kill an orc unique in the orc pack, and then the orc captain takes over. Kill him, no one can lead and the mob breaks up or becomes disorganized.

      Some AI like this could make the game a lot more 'tactical' than it already is.

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9634

        #18
        Originally posted by chris
        Just throwing out an idea I am planning on working on at some point:

        [1] New static array: mob_info.
        [2] New field on each monster: mob_idx.
        [3] When a mob is generated, a mob_info record is initialized and all monsters in the mob get the same unique mob_idx.
        [4] The mob_info controls AI for the entire pack.
        [5] Different mobs can behave differently.
        [6] Mobs can have a boss. Kill the boss, and the mob breaks morale (mob_info.ai = MOB_FLEE or something).
        [7] Kill a member of the mob, and the entire mob rolls a morale check.
        [8] Wake up a member of the mob, and it will attempt to wake up its buddies.

        etc. But I think this sort of implementation would be rather efficient, and offer up a lot of opportunities for flexible monster behavior.

        Anyway, I haven't done it yet ... but maybe somebody else can beat me to it and let me know how it works out
        I've got the beginnings of this in FAangband - I have all the structures, but don't do much with them yet.
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • Timo Pietilä
          Prophet
          • Apr 2007
          • 4096

          #19
          Originally posted by ewert
          The difference is, a "is friend hurt" is checked at every pass, whereas "I'm hurt guys" only happens when hurt. Say a pack of 12 hounds:

          Every monster turn: 12 checks for if hurt for all LoS
          vs.
          Player damages monster: 1 check for all LoS to set "hurt" flag per damaged monster. It could even check for "hurt" flag prior checking LoS, since that is a single boolean check vs. complex LoS computing.

          Okay we have officially gone into geekdom now, we have gigahertz computers and we are debating code efficiency in an ascii game! ... =P Woooot!
          No matter which way you do that check, it needs to be for pack monsters only, so that should be one of the very first things to check. Orcs don't care if their brothers in arms get hurt, except maybe to cause fear for their own safety, which is the only reason they might do combat healing.

          Comment

          • ewert
            Knight
            • Jul 2009
            • 702

            #20
            Well the "hurt" flag would only be applied if LoS checked monster is "same type", and the "hurt flag" procedure called only if monster is "pack AI type", and the "hurt flag" would only be relevant to disabling "pack AI" if set so that current stupid pack AI does not give player free shots on packs in rooms...

            Comment

            • PowerDiver
              Prophet
              • Mar 2008
              • 2820

              #21
              How much of this comes down to abuse of asymmetric LOS? If every hound you could see to shoot could see you to breathe back, would it even be a significant problem?

              Comment

              • fizzix
                Prophet
                • Aug 2009
                • 3025

                #22
                Originally posted by PowerDiver
                How much of this comes down to abuse of asymmetric LOS? If every hound you could see to shoot could see you to breathe back, would it even be a significant problem?
                You'd have to make it so that they were smart enough to breathe on the square next to you. Making LOS symmetric would help, but you still need to deal with ball spells. d_m's solution seems both simple and elegant enough.

                Comment

                • nppangband
                  NPPAngband Maintainer
                  • Dec 2008
                  • 926

                  #23
                  Originally posted by fizzix
                  You'd have to make it so that they were smart enough to breathe on the square next to you. Making LOS symmetric would help, but you still need to deal with ball spells.
                  NPP has both of these. It wasn't easy to code, but all of the bugs have been worked out.
                  NPPAngband current home page: http://nppangband.bitshepherd.net/
                  Source code repository:
                  https://github.com/nppangband/NPPAngband_QT
                  Downloads:
                  https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                  Comment

                  • fizzix
                    Prophet
                    • Aug 2009
                    • 3025

                    #24
                    Originally posted by nppangband
                    NPP has both of these. It wasn't easy to code, but all of the bugs have been worked out.
                    what about this situation?

                    Code:
                    [FONT="Courier New"]###############
                    ##########Z....
                    ##########.....
                    @..............
                    ##########.....
                    ##########Z....
                    ###############[/FONT]
                    @ can kill the Z's but they can't hurt @. Does NPP do something clever here? If so, that is what we should poach.

                    Comment

                    • camlost
                      Sangband 1.x Maintainer
                      • Apr 2007
                      • 523

                      #25
                      Originally posted by nppangband
                      NPP has both of these. It wasn't easy to code, but all of the bugs have been worked out.
                      You allow monsters to use ball spells to do splash damage to '@'? I added that, but I'd be interested to see a more robust solution; mine doesn't work all that well with monsters that don't know where the player is precisely.
                      a chunk of Bronze {These look tastier than they are. !E}
                      3 blank Parchments (Vellum) {No french novels please.}

                      Comment

                      • Timo Pietilä
                        Prophet
                        • Apr 2007
                        • 4096

                        #26
                        Originally posted by PowerDiver
                        How much of this comes down to abuse of asymmetric LOS? If every hound you could see to shoot could see you to breathe back, would it even be a significant problem?
                        It's not so much of asymmetric LoS but difference between targeting and LoS, which allows way worse abuse than just asymmetric LoS. IMO, if you can't see it you should not be able to target it no matter if it is asymmetric or not (asymmetric LoS is fine to me).


                        ###....TTTTTTTTssssss
                        T=targetable but not in sight
                        ###...TTTTTTsssssssss
                        s=in sight
                        ###..TTTTssssssssssss
                        ###.TTsssssssssssssss
                        ###ssssssssssssssssss
                        .@sssssssssssssssssss
                        #####################


                        T is where pack monsters move freely because they apparently try to avoid being in LoS, not being targetable.

                        Even if you fix that targetable vs LoS you can still kill the monsters without with ball spells. That's what's wrong in pack behavior.

                        Comment

                        • ewert
                          Knight
                          • Jul 2009
                          • 702

                          #27
                          I noticed a problem with the "is friend hurt" coding approach compared to "I'm hurt guys" coding approach. If you instant kill them, the pack AI never gets turned off and you can still pick them off 1 by 1.

                          Comment

                          • nppangband
                            NPPAngband Maintainer
                            • Dec 2008
                            • 926

                            #28
                            Originally posted by fizzix
                            what about this situation?

                            Code:
                            [FONT="Courier New"]###############
                            ##########Z....
                            ##########.....
                            @..............
                            ##########.....
                            ##########Z....
                            ###############[/FONT]
                            @ can kill the Z's but they can't hurt @. Does NPP do something clever here? If so, that is what we should poach.
                            If a monster get's hit by the player, and then the player is out of line of sight when it is the monsters turn to attack (pillar dancing, or the situation above), they are marked with a flag, they notify thier entire pack of the attack, and usually as a group they charge straight at the player, retreat further away, or if they have ball spells, they try to cast it close to the player. The monsters get to cheat a little bit and they always know where the player is (but I think they always have this advantage anyways).

                            It isn't perfect, but they won't sit there passively until you kill them with out-of-los attacks. Improving the group AI is on my to-do list for NPP 0.7.0.

                            Also, most importatnly, hockey-stick LOS attacks don't work in NPP (I lifted the projection and LOS codes that Leon Marrick used in Sangband. I think that might currently be the biggest abuse in the game.
                            NPPAngband current home page: http://nppangband.bitshepherd.net/
                            Source code repository:
                            https://github.com/nppangband/NPPAngband_QT
                            Downloads:
                            https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                            Comment

                            • fizzix
                              Prophet
                              • Aug 2009
                              • 3025

                              #29
                              Originally posted by ewert
                              I noticed a problem with the "is friend hurt" coding approach compared to "I'm hurt guys" coding approach. If you instant kill them, the pack AI never gets turned off and you can still pick them off 1 by 1.
                              how would 'i'm hurt guys' improve on that? It seems like it'd be problematic either way.

                              Comment

                              • Timo Pietilä
                                Prophet
                                • Apr 2007
                                • 4096

                                #30
                                Originally posted by nppangband
                                Also, most importatnly, hockey-stick LOS attacks don't work in NPP (I lifted the projection and LOS codes that Leon Marrick used in Sangband. I think that might currently be the biggest abuse in the game.
                                I'm happy with asymmetric LoS, because it is asymmetric in both directions. What I don't like is targeting not following the LoS: being subset of LoS. IMO "you can see monsters you can't target" is more natural than other way around.

                                That's like one of the Mythbusters episode where they shoot around the corner. Without seeing what you are shooting (even that you did know where the target is) you hit anything but the target. If that is the case with pistol, try doing that same with bow. It only gets worse. Sling would be practically impossible. Magic? Well, magic is magic, you can rationalize that in many ways, but I think it should follow the same rule as other distance attacks.

                                Comment

                                Working...
                                😀
                                😂
                                🥰
                                😘
                                🤢
                                😎
                                😞
                                😡
                                👍
                                👎