targetting and LOS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Atarlost
    Swordsman
    • Apr 2007
    • 441

    #16
    You still have to handle them somehow unless you remove the tunneling mechanic.
    One Ring to rule them all. One Ring to bind them.
    One Ring to bring them all and in the darkness interrupt the movie.

    Comment

    • PowerDiver
      Prophet
      • Mar 2008
      • 2820

      #17
      Originally posted by etaomyx
      Apologies if I have misunderstood, but in cases like

      Code:
      ............      ........
      .@.###.....M  or  .@......
      ............      .....#..
      ............      ........
      1. Is M visible?
      2. Do the walls even cast shadows?

      (As a random observation, this LOS system would be totally awesome if Angband were represented in unicode, and so you could print those box-drawing glyphs for walls: then LOS would be completely consistent with the visuals. But I don't know, the # symbol looks rather like it should take up a whole tile?)
      Don't overthink the model. It need not be perfect, nor even make sense. The important things are that it should be consistent enough to code easily and properly, and that it gives decent gameplay.

      Given that there seems to be sentiment for non-visible in what I called the boundary case, I can state that the M cannot see the @. The reasoning is that an individual disconnected # counts as a radius 0 blockage at the center. Two adjacent would count as a 0-width line. If you draw a line from the center of one square to the center of another, and it passes through a blockage, not visible. That's the rule.

      Of course, if someone can come up with a different model that is more intuitive that has better gameplay properties, please step forward. You'll notice I didn't put "feature request" in the title of this thread. At this point it's still the "what should we do" phase. I'd love it if someone came up with something better.

      Comment

      • etaomyx
        Rookie
        • May 2009
        • 17

        #18
        Originally posted by PowerDiver
        If you draw a line from the center of one square to the center of another, and it passes through a blockage, not visible.
        Mmm, okay, but then there can be weird gaps in the field of view, like:

        Code:
        .......
        .@.....
        ...#...
        ..... .
        .......

        Comment

        • PaulBlay
          Knight
          • Jan 2009
          • 657

          #19
          You could use these suckers.



          Although you would almost certainly need to supply a font to go with that.

          [EDIT] I couldn't actually find a font that supports the terminal graphics characters - so I asked someone to add it to their font. .

          Code:
          #############
          #        @
          #      ###### 
          #      #
          ########
          Code:
          [COLOR="Silver"]▛▀▀▀▀▀▀▀▀▀▀▀▀[/COLOR]
          [COLOR="Silver"]▌[/COLOR]        @ [SIZE="1"]- Aargh! It burns my eyes![/SIZE]
          [COLOR="Silver"]▌      	▗▄▄▄▄▄ 
          ▌       ▐█████
          ▙▄▄▄▄▄▄▟█████[/COLOR]
          Éomer soon regretted eating that mushroom.
          Last edited by PaulBlay; June 19, 2009, 14:08.
          Currently turning (Angband) Japanese.

          Comment

          • Bandobras
            Knight
            • Apr 2007
            • 726

            #20
            Originally posted by d_m
            This proposal is good--in particular it addresses some annoying inconsistencies with the current treatment of passwall.

            Also, I assume your LOS would be symmetric. I consider that one of the most sorely-needed features.
            Wholeheartedly agreed.

            BTW, I wonder how it relates to LOS modifications in NPP and other variants. I think none were symmetrical and I also don't like the idea that LOS is different from shooting cone, as in NPP. But LOS range and shooting range being different is OK for me. Anyway, I'm curious how the approaches compare...

            Comment

            • jv123
              Scout
              • May 2009
              • 37

              #21
              I think it's clear that a new system for line-of-sight is needed, and this excellent new proposal has some very good features. But I don't think it's quite right yet: surely we don't want to give up the intuitively-familiar idea that you can hide behind a single pillar.

              Here's a refinement of PowerDiver's suggestion which solves this problem. Suppose that monsters (and the character, and items) aren't thought of as 'filling' their entire square, but instead are located in a smaller square area inside it. So it the entire square is located with x- and y-coordinates between 0 and 1, then we can imagine a monster (and the character, and items) only occupying the space between 0.25 and 0.75 on each axis. Isolated walls would work the same way. Continuous blocks of wall would only work this way around their edges.

              To test if the @ can see a monster, you just test to see if there are any lines that can pass from any point in the @'s area, to any point in the monster's area, without passing through an area occupied by a wall. This test is obviously symmetrical. There is a non--floating point algorithm that can perform this check.

              This is slightly more complicated than the original suggestion, but still intuitive. It maintains all of the good aspects, but behaves better in terms of single isolated wall elements. Let me know what you all think!

              Comment

              • d_m
                Angband Devteam member
                • Aug 2008
                • 1517

                #22
                Originally posted by jv123
                Here's a refinement of PowerDiver's suggestion which solves this problem. Suppose that monsters (and the character, and items) aren't thought of as 'filling' their entire square, but instead are located in a smaller square area inside it. So it the entire square is located with x- and y-coordinates between 0 and 1, then we can imagine a monster (and the character, and items) only occupying the space between 0.25 and 0.75 on each axis. Isolated walls would work the same way. Continuous blocks of wall would only work this way around their edges.
                Is this different from the assumption that walls can be zero-width lines? If you imagine players and monsters only occupying the central point, and lines of sight not being allowed to intersect wall points or wall lines, I think it has the same benefits as yours.

                What are the other important differences? Maybe I'm just not fully understanding, but I'd like to avoid doing math with smaller squares inside of unit squares if it can be helped.
                linux->xterm->screen->pmacs

                Comment

                • jv123
                  Scout
                  • May 2009
                  • 37

                  #23

                  Is this different from the assumption that walls can be zero-width lines? ... I'd like to avoid doing math with smaller squares inside of unit squares if it can be helped.
                  So would I! I think it is different, because of the behaviour of single-block pillars. Under your proposed scheme, a pillar horizontally or vertically away from the player would indeed block monsters behind it, by treating the pillar as a zero-size obstruction at its centre. So in this scenario --- @...#...M --- the @ can't see the monster, which I think we all agree is the desired behaviour.

                  But as etaomyx describes in post 18 to this conversation, this won't work so well when you're not in a horizontal or vertical line from the player. So in your scheme, things would look like this, with the blank squares being invisible to the @:
                  Code:
                  ...........
                  .@.........
                  ...#.......
                  ..... .....
                  ....... ...
                  ......... .
                  ...........
                  With my suggestion, it would be more like this:
                  Code:
                  ...........
                  .@.........
                  ...#.......
                  ....  .....
                  .....   ...
                  ......    .
                  .......
                  (Of course, I haven't gone to the trouble of calculating this perfectly accurately, but you get the idea.)

                  Comment

                  • PaulBlay
                    Knight
                    • Jan 2009
                    • 657

                    #24
                    I did some testing with the following assumptions:

                    1. Pillars take up half the square.
                    2. Pillars are square.
                    3. Any square you can see at least half of you can "see" less than that and you can't see them.
                    4. People don't care that I'm doing this by eye. ;-)

                    Code:
                    ###############
                    #........
                    #.....
                    #.@#
                    #.....
                    #........
                    ###############
                    This is what you could see standing straight behind a pillar.

                    Code:
                    ###############
                    #..............
                    #........
                    #@.#
                    #........
                    #..............
                    ###############
                    Standing one grid further away.
                    Currently turning (Angband) Japanese.

                    Comment

                    • jv123
                      Scout
                      • May 2009
                      • 37

                      #25
                      Looks good to me!

                      Am I right in thinking that as Angband works at the moment, it's more like this:
                      Code:
                      ###############
                      #..............
                      #..............
                      #@.#
                      #..............
                      #..............
                      ###############

                      Comment

                      • Marble Dice
                        Swordsman
                        • Jun 2008
                        • 412

                        #26
                        I agree with jv123, if you sub-divide each tile into 16 smaller pieces (4x4), consider each wall to take up the middle 4 (2x2). Then if you can draw a line from tile center to tile center without crossing an obstructed portion of a tile, you have visibility. It would look something like this:

                        Code:
                        #######.#######
                        #######@#######
                        ????.......????
                        ?.............?
                        
                        ................?
                        .........????????
                        .@.###?????M?????
                        .........????????
                        ................?
                        
                        @...........
                        ...#?.......
                        .....????...
                        .......?????
                        .........???

                        Comment

                        • PaulBlay
                          Knight
                          • Jan 2009
                          • 657

                          #27
                          Originally posted by Marble Dice
                          I agree with jv123, if you sub-divide each tile into 16 smaller pieces (4x4), consider each wall to take up the middle 4 (2x2). Then if you can draw a line from tile center to tile center without crossing an obstructed portion of a tile, you have visibility. It would look something like this:
                          Yah, but that wouldn't account for the "ghost in the wall" scenario.

                          Now if we allowed any square that you can see at least 1/4 of (instead of 1/2) then it would (oddly) make rather little difference but would allow for you to see monsters in walls.

                          Code:
                          #################
                          #................
                          #.........
                          #@.#
                          #.........
                          #................
                          #################
                          You only need to see 1/4 of the square, not 1/2 case.
                          Currently turning (Angband) Japanese.

                          Comment

                          • jv123
                            Scout
                            • May 2009
                            • 37

                            #28
                            This brings up the possibility of some extra fun stuff --- it a monster is right on the edge of your visibility cone, and you fire a bolt spell or arrow, there could be a chance of getting the message "Your missile glances off the wall!" and the attack missing. This would penalize you for staying right on the edge of your visibility cone, from where escape is easier. Of course, monsters would also have this penalty when firing at you.

                            Here's how this could be calculated: we're subdividing each grid square into 16 smaller squares, and imagining that the monster occupies the central 4 squares. If you can only see some proportion of these squares, then your chance to hit the monster is reduced by the appropriate fraction. Maybe there could be a dex-related chance of ignoring this penalty: after all, if you're really good at aiming, you only need to have line-of-sight to a small point on the monster to be able to deliver a fatal shot.

                            Note that for this to be symmetrical, you need to ask "can I see any of the monster's 4 central squares from any of my 4 central squares?" In other words, it's not good enough to check to see if you can see any of the monster's 4 central squares from the precise centre of your grid square --- this wouldn't give a symmetrical condition, and I get the impression that symmetry is generally desired.
                            Last edited by jv123; June 19, 2009, 16:22.

                            Comment

                            • Marble Dice
                              Swordsman
                              • Jun 2008
                              • 412

                              #29
                              Originally posted by jv123
                              In other words, it's not good enough to check to see if you can see any of the monster's 4 central squares from the precise centre of your grid square --- this wouldn't give a symmetrical condition
                              This is true, but what's wrong with just checking center-to-center? Wouldn't you only need to use the central 4-squares for checking obstruction from a wall?

                              Originally posted by PaulBlay
                              Yah, but that wouldn't account for the "ghost in the wall" scenario.
                              Is this really a scenario that needs accounting? Why can't enemies in visible tiles just always be visible, regardless of if they're a hydra in the open or a ghost inside a wall? If you can see the wall, then you can see the ghost inside it.

                              Comment

                              • jv123
                                Scout
                                • May 2009
                                • 37

                                #30
                                what's wrong with just checking center-to-center? Wouldn't you only need to use the central 4-squares for checking obstruction from a wall?
                                You're quite right --- simpler is better, and I can't see any problem with just checking the centre-to-centre line. Centre-to-centre would allow you to see the monster in this situation, which is the most important thing to make sure of:
                                Code:
                                ......
                                ..@...
                                ###...
                                ###M..
                                I do like the idea of 'partial visibility' for monster right at the edge of what you can see, but I agree it's not a necessary part of the proposal.

                                Comment

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