Masking and layering terrains

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • buzzkill
    Prophet
    • May 2008
    • 2939

    Masking and layering terrains

    I'm working on the NPP 32x32 tile set right now. NPP has a lot of terrains. NPP also has terrains which, in theory, could set upon another terrain. Right now all we can do is have a terrain type such as a tree, or a rock ,which has to be drawn on a static background terrain which works OK most of the time, but could be improved by allowing the splitting the terrain feature from the terrain flooring that it is placed upon.

    It would be nice if we could mask and layer multiple terrain types the same way we do with items or monsters (upon terrains). In this way we could have a tree upon a dirt floor, or a tree upon a grassy floor which is currently impossible short each instance of a tree being a unique terrain type.

    In not proposing any game play changes at this time (not that it couldn't happen). The dominant terrain alone would continue to dictate the rules that govern a particular grid. What I'm suggesting is a purely cosmetic change, to make the dungeon look nicer, much nicer.

    While this wouldn't have much impact on V (no terrains) or ASCII players (no tiles), there are a *lot* of variants that use terrains that could benefit from this. Does anybody else think that this has any merit, or I am just barking at the moon?

    ALSO on a related note. It would be wonderful if the game could shade out-of-LOS (torch lit, etc.) tiles itself instead of someone having to draw 3 of every tile. I know we've had this discussion before, and an opinion was formed that the artist should be allowed to shade tiles to his own tastes, but I gotta tell you, it's more trouble than it's worth. 99% of the time I just scale the brightness a bit, the same way Angband.exe could/would. If we could leave the degree of shading up to the user, all the better... and then we'd be able to shade monsters too, though I don't know what that gains us.

    Anyone hear from Shockbolt lately?
    www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
    My banding life on Buzzkill's ladder.
  • Blue Baron
    Adept
    • Apr 2011
    • 103

    #2
    Short version:
    I would like to see this as well, but I don't see it happening before the CoreUI split.

    Long version:
    Personally, I would like to see something like the grid_data structure passed to a platform hook function, and let the platform draw the whole grid point as it wants to, so it could build and draw a terrain chain with tiles, or just draw the top terrain with ascii/fonts. But given that what is stored in the terminal grid are the visuals, whether it is a map grid or line of text, there would need to be a major rewrite, which seems to already be intended for the coreui spilt.

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 5110

      #3
      Personally I'd use the word "terrain" to mean the underlying ground, and refer to trees / rubble / statues / anything else as features on the terrain.
      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

      Comment

      • nppangband
        NPPAngband Maintainer
        • Dec 2008
        • 926

        #4
        NPP already has coding support for this. Angand essentially has 3 layers to its dungeon. One for terrain, one for objects, and one for monsters/player.

        NPP has a fourth that most of the core suport to make it work. It is currently used for effects. This is where clouds, and other lingering effects are stored. They can stack, like objects, so you can have up to 24 effects on one space, in addition to the terrain.

        NPP also breaks out being able to move through a terrain, see through a terrain, and project (eg cast spells or fire arrows) through a terrain, and it factors the effects layer of the dungeon when deciding whether any of these three actions are possible. So most of what you envision below is already implemented.

        It would be a trivial task to make things like trees or rocks an effect rather than terrain. We already did this with traps. We started to do this with doors as well, but in the end we didn't see much point since doors are always over a standard dungeon floor rather than sand dunes or pits of lava.

        Currently, in terms of displaying the contents of a square on-screen, effects on a square take priority over the terrain iteself. It would take some major changes to the core code to blend terrain and effects into a single display or tile for a particular squrae. Is that what you are hoping can be accomplished with the mask?
        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

        • buzzkill
          Prophet
          • May 2008
          • 2939

          #5
          Originally posted by nppangband
          Currently, in terms of displaying the contents of a square on-screen, effects on a square take priority over the terrain itself. It would take some major changes to the core code to blend terrain and effects into a single display or tile for a particular square. Is that what you are hoping can be accomplished with the mask?
          Nothing that involved. All I wanted to do is be able to draw a rock or a tree or a flower (properly masked) without having to draw a backgound behind it. The background will be entirely separate from it. It just for cosmetics.

          Q: If the terrain features such as trees became effects, wouldn't monsters get hidden under them (like cloud effects), or is that adjustable?

          We started to do this with doors as well, but in the end we didn't see much point since doors are always over a standard dungeon floor rather than sand dunes or pits of lava.
          But trees could be placed on a variety of terrains, and rocks (and other things as well) even more so.

          Just hit a forest level with the comp character. Fun. Trying to figure out how to draw NPP style trees with adjacent branches that somehow tile properly, not so much fun. I'm not even sure if it's possible
          www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
          My banding life on Buzzkill's ladder.

          Comment

          • nppangband
            NPPAngband Maintainer
            • Dec 2008
            • 926

            #6
            Originally posted by buzzkill
            Nothing that involved. All I wanted to do is be able to draw a rock or a tree or a flower (properly masked) without having to draw a backgound behind it. The background will be entirely separate from it. It just for cosmetics.

            Q: If the terrain features such as trees became effects, wouldn't monsters get hidden under them (like cloud effects), or is that adjustable?
            No, Monsters have top priority, then objects, then effects, then terrain. The only reason you don't see the monsters in cloud effects is if you can't see through the cloud effects, so the monster loses the "visible" flag.


            Originally posted by buzzkill
            But trees could be placed on a variety of terrains, and rocks (and other things as well) even more so.

            Just hit a forest level with the comp character. Fun. Trying to figure out how to draw NPP style trees with adjacent branches that somehow tile properly, not so much fun. I'm not even sure if it's possible
            I don't think so, without some re-working of the source and terrain.txt I would need to have 8 individual branch terrains, one heading out in each of the 8 directions. Then the tree generation code would need some re-working, so it slelects the terrain type that points that direction.
            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

            • buzzkill
              Prophet
              • May 2008
              • 2939

              #7
              Originally posted by nppangband
              I don't think so, without some re-working of the source and terrain.txt I would need to have 8 individual branch terrains, one heading out in each of the 8 directions. Then the tree generation code would need some re-working, so it slelects the terrain type that points that direction.
              I think that I'm going to settle for trees and branches being distinct and recognizable, even if they don't form a cohesive 'tree'. We'll just going to have to use our imaginations extra hard on this one.
              www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
              My banding life on Buzzkill's ladder.

              Comment

              • Nick
                Vanilla maintainer
                • Apr 2007
                • 9637

                #8
                Originally posted by nppangband
                NPP already has coding support for this. Angand essentially has 3 layers to its dungeon. One for terrain, one for objects, and one for monsters/player.

                NPP has a fourth that most of the core suport to make it work. It is currently used for effects. This is where clouds, and other lingering effects are stored. They can stack, like objects, so you can have up to 24 effects on one space, in addition to the terrain.
                If it's a contest, I have 5
                One for the Dark Lord on his dark throne
                In the Land of Mordor where the Shadows lie.

                Comment

                • nppangband
                  NPPAngband Maintainer
                  • Dec 2008
                  • 926

                  #9
                  Originally posted by Nick
                  If it's a contest, I have 5
                  It *IS* a contest. And I am going to head straight home after work and add two more layers so I can re-claim tactical superiority.

                  The way NPP tackles that issue is each terrain has instructions for how it gets affected by various elements, so if you cast fireballs at some ice it will eventually melt into water. But it is also used during dungeon generation to let things like trees and water spread to surrounding terrains (all based on the terrain code in Unangband).
                  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

                  • Derakon
                    Prophet
                    • Dec 2009
                    • 9022

                    #10
                    Originally posted by nppangband
                    It *IS* a contest. And I am going to head straight home after work and add two more layers so I can re-claim tactical superiority.
                    Screw it, we're going to five blades.

                    Comment

                    • buzzkill
                      Prophet
                      • May 2008
                      • 2939

                      #11
                      Originally posted by Derakon
                      My favorite bit...

                      "They don't tell me what to invent—I tell them. And I'm telling them to stick two more blades in there. I don't care how. Make the blades so thin they're invisible. Put some on the handle. I don't care if they have to cram the fifth blade in perpendicular to the other four, just do it!"

                      ...from the best written article I've read in a while.
                      www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
                      My banding life on Buzzkill's ladder.

                      Comment

                      • ekolis
                        Knight
                        • Apr 2007
                        • 921

                        #12
                        I started reading that quote, and for some reason I thought it was from Cave Johnson (Portal 2)...
                        You read the scroll labeled NOBIMUS UPSCOTI...
                        You are surrounded by a stasis field!
                        The tengu tries to teleport, but fails!

                        Comment

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