Adding terrain to V

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Therem Harth
    Knight
    • Jan 2008
    • 926

    Adding terrain to V

    I am really interested in adding more colorful and more interesting terrain to my variant, and now that I have some free time again I should be able to do it. Problem is I don't know where to start.

    How is terrain implemented in variants like NPP and FA, compared to Vanilla? Can anyone give me a rough outline of the differences, before I go code-diving? How much code modification am I going to need, to add terrains with different effects?
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9637

    #2
    Originally posted by Therem Harth
    How is terrain implemented in variants like NPP and FA, compared to Vanilla? Can anyone give me a rough outline of the differences, before I go code-diving? How much code modification am I going to need, to add terrains with different effects?
    V tends to base terrain interaction on the actual feature (eg if it's a down stair, do this), or sometimes on ranges of terrain features (which makes it a bit dependent on the order of terrain in the terrain file (and defines.h).

    FA has moved completely (I think) to terrain flags, where each terrain type has certain properties (allow line of sight, hold objects, burn you, etc), and game interactions happen based on the property. Getting there took a bit of modification, but if you're going to have significant new terrain, I'd recommend doing something like this sooner rather than later.

    I'm not sure of all the details of how NPP does it, but NPP's terrain came from UnAngband originally, and is considerably more varied than FA's. I know it has persistent effects as well as terrain, and terrain that does stuff...
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • Therem Harth
      Knight
      • Jan 2008
      • 926

      #3
      Hmm. Now that I think about it...

      With Neoband ATM my bad habits are really coming back to bite me - the bookless spell system is a pile of redundant spaghetti code. I don't actually have an API, just a bunch of rough guidelines that I'm following.

      Now that I have a better idea of what I want, and am slightly more experienced, I think it may be more productive to start over with a different variant; preferably one with terrain support built in.

      Comment

      • nppangband
        NPPAngband Maintainer
        • Dec 2008
        • 926

        #4
        In NPP (based on Unangband), the terrain becomes completely flag-based, whereas in Angband, all terrain chatacteristics are based on the terrain number entry. For example, all stores are in a sequence, all monster traps, all walls, etc. Change the order, and the game breaks. The transition is *extremely* painful. In some places in the C code the terrain is a simple hard-coded number, making it hard to find. Be prepared for lots of de-bugging.

        Personally, in hindsight I think the terrain system in NPP is overly complicated, and I would recommend usuing something simpler. We have this amazing system that allows to do almost anything we want, and we barely use 1% of its capabilities. In the end, terrain just isn't that interesting, and players are far more interested in objects and monsters.

        At a glance, FAangband probably has a much better terrain setup than NPP.
        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

        • Therem Harth
          Knight
          • Jan 2008
          • 926

          #5
          Does FA inherit it from O? I forget...

          Mostly I'm interested in terrain for atmosphere reasons - it would be nice, I think, to have terrain that complemented the foes du jour (even if it was mostly just scenery). But yes, if it takes that much work I may leave it be.

          Comment

          • nppangband
            NPPAngband Maintainer
            • Dec 2008
            • 926

            #6
            Originally posted by Therem Harth
            Does FA inherit it from O? I forget...

            Mostly I'm interested in terrain for atmosphere reasons - it would be nice, I think, to have terrain that complemented the foes du jour (even if it was mostly just scenery). But yes, if it takes that much work I may leave it be.

            Yes, FA is based on O. I didn't mean to discourage you from terrain in general, just the NPP system. I would bet that FA isn't too bad to implement.
            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

            • Mondkalb
              Knight
              • Apr 2007
              • 982

              #7
              I like he FAangband terrain in the dungeons. I adds some flavor to the otherwise rather colorless corridors and rooms of Angband.
              It's less drab if you stumble into a room with a water basin or even some green spots or lava every now and then.

              I also remember a nice variety of terrain in Zangband.
              My Angband winners so far

              My FAangband efforts so far

              Comment

              • Mikko Lehtinen
                Veteran
                • Sep 2010
                • 1246

                #8
                I hacked EyAngband's trap layer code to create Halls of Mist's terrain features.

                All additional terrain features are painted with "decorations" on the trap layer. A tree is a painted rubble; a statue is a painted granite wall; a table is a painted floor.

                In most respects the new features behave exactly like what they are based on. I haven't modified monster AI or visibility rules at all, for example. Decorations affect graphics and some terrain-specific (mostly hard-coded) interactions with the terrain features.

                How flexible Vanilla's trap layer is nowadays? Can a granite wall have a trap on it?

                I'm not recommending Mist's system to anyone, it's spaghetti, just throwing out some ideas.

                Comment

                • Mikko Lehtinen
                  Veteran
                  • Sep 2010
                  • 1246

                  #9
                  Originally posted by nppangband
                  In the end, terrain just isn't that interesting, and players are far more interested in objects and monsters.
                  That's at least partly an implementation problem. Terrain features could have effects that are almost as relevant to gameplay as monsters or items.

                  Also, I think it's a good idea to tie many terrain features to player's skills, attributes or items somehow. All these are very relevant to how you interact with monsters, why not with terrain features? In Mist, your skill scores in Perception, Alchemy, Jumping and Saving Throw affect how beneficial or dangerous terrain features are to you. Some items combo with terrain features to create big effects.

                  Personally, I want every single terrain feature to be very relevant for gameplay, at least potentially. I find this approach is better for the game's athmosphere, too, than having terrain features just for flavour.

                  Comment

                  • nppangband
                    NPPAngband Maintainer
                    • Dec 2008
                    • 926

                    #10
                    Originally posted by Mikko Lehtinen

                    How flexible Vanilla's trap layer is nowadays? Can a granite wall have a trap on it?
                    I don't think Vanilla has a trap layer. A trap is one terrain type that just turns into an empy floor when disarmed.
                    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

                    • Mikko Lehtinen
                      Veteran
                      • Sep 2010
                      • 1246

                      #11
                      Originally posted by nppangband
                      I don't think Vanilla has a trap layer. A trap is one terrain type that just turns into an empy floor when disarmed.
                      OK! I remember reading threads about traps in v4. I don't know whether the underlying system is different there.

                      Comment

                      • Nick
                        Vanilla maintainer
                        • Apr 2007
                        • 9637

                        #12
                        Originally posted by Therem Harth
                        Does FA inherit it from O? I forget...
                        Yes, FA is forked from O. O has more terrain than V, and FA has more still; O doesn't have terrain flags as FA and NPP do. FA low-level codebase is also fairly close to V 3.2.0 - but a lot of the detail is very different.

                        I think you have many good choices
                        One for the Dark Lord on his dark throne
                        In the Land of Mordor where the Shadows lie.

                        Comment

                        • Magnate
                          Angband Devteam member
                          • May 2007
                          • 5110

                          #13
                          Originally posted by Mikko Lehtinen
                          OK! I remember reading threads about traps in v4. I don't know whether the underlying system is different there.
                          Trap detection and handling are quite different in v4, but there is still no trap layer. v4 hasn't yet touched terrain itself.
                          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                          Comment

                          • buzzkill
                            Prophet
                            • May 2008
                            • 2939

                            #14
                            Allow me to throw Z+ into the mix. It's got wilderness and thus terrains. Don't know where it forked from... or anything else about it for that matter.
                            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

                            • Therem Harth
                              Knight
                              • Jan 2008
                              • 926

                              #15
                              Z+ was, I believe, forked from the original Zangband.

                              I'll admit most of my intent with terrain was (is?) to add flavor (never mind color). If you play ToME 2 there are trees, sand walls, lava and water streamers... Sometimes the terrain is more annoying than anything else, but it gives the game a nicer, more complete feel IMO.

                              Comment

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