Four types of granite walls?

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

    Four types of granite walls?

    I'm finally trying to add terrain (of a sort) to Neoband, but I'm wondering, why are there four types of granite walls (never mind doors) in lib/edit/terrain.txt? If I add a new type of wall, door, etc. will I have to add four versions? Or is this a thing for graphical tiles, that I can safely ignore?
  • fizzix
    Prophet
    • Aug 2009
    • 3025

    #2
    Originally posted by Therem Harth
    I'm finally trying to add terrain (of a sort) to Neoband, but I'm wondering, why are there four types of granite walls (never mind doors) in lib/edit/terrain.txt? If I add a new type of wall, door, etc. will I have to add four versions? Or is this a thing for graphical tiles, that I can safely ignore?
    It's for dungeon generation. Currently adding terrain is kind of a nightmare due to some awful legacy code. It's getting overhauled in the restruct branch (I think) and it's about time.

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9637

      #3
      With Neoband being based on 3.2.0, adding terrain is easy enough, but the difficult part is making sure it behaves correctly. Things you need to consider include
      • You need to add a
        Code:
        #define FEAT_MARSHMALLOW indexno
        (or whatever) to defines.h, where indexno is its number from terrain.txt
      • LoS considerations - you will need to make sure your terrain gets the CAVE_WALL flag if it is meant to block LoS, or doesn't if it isn't (see cave_set_feat in cave.c)
      • Where it is placed in the order of terrain - a lot of things are done based on facts like "every terrain feature with index >= secret doors is a wall"
      • Any behaviour specific to what you want to introduce


      As fizzix says, it's all a bit painful, but kind of fun in a grim sort of way
      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

        #4
        Thanks... So I guess I won't need to add four types of e.g. coal seam?

        (I take it that removing the need for multiple granite walls, etc. would be nontrivial?)

        BTW I notice the trap implementation requires a terrain feature for each trap type. Ick.

        Comment

        • Derakon
          Prophet
          • Dec 2009
          • 9022

          #5
          I believe the multiple wall types are to indicate things like "this wall is part of the border of a room" and "this wall is in a corridor". Such information is important for laying out the dungeon but is only really relevant for basic wall types.

          Comment

          • Therem Harth
            Knight
            • Jan 2008
            • 926

            #6
            Oh dear. I'd wanted to add wall types, among other things. Unless you mean "only relevant for granite/perm walls/doors."

            Thanks though, I will see if I can come up with a better way of doing things. (Not that I rate my chances that high.)

            Comment

            • Nick
              Vanilla maintainer
              • Apr 2007
              • 9637

              #7
              Originally posted by Therem Harth
              Oh dear. I'd wanted to add wall types, among other things. Unless you mean "only relevant for granite/perm walls/doors."

              Thanks though, I will see if I can come up with a better way of doing things. (Not that I rate my chances that high.)
              As long as you change granite to other types of wall after the basic room layout has been done, you're fine.

              At this stage of the code restructure the multiple types of granite have been removed, and traps are no longer terrain. See the restruct branch on Github if you're interested.
              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

                #8
                Thank you and thank you. I may see about merging some code from that...

                Comment

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