tweaking the game to my liking

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Grotug
    Veteran
    • Nov 2013
    • 1637

    tweaking the game to my liking

    Erm.. as a code-ophobic person, (<-2 INT> I'm afraid) I'm wondering if it's possible to change what shows up in the stores (I'd like to bring back the days when nothing was guaranteed to be in the stores) and also change the depth when ?phase door scrolls, teleportation scrolls and teleportation staves start to show up as well, and how often they show up.

    I'd also like to bring back spikes for jamming doors and maybe some other legacy things that were removed ages ago. And maybe tweak randomized range for teleportation rings to make them a bit more useful (and maybe increase the teleportation range as well). I know how to change some things in the text files, but not sure if the above can easily be changed. I might also want to give rings of escaping a randomized range of +2 to +4 speed.
    Beginner's Guide to Angband 4.2.3 Part 1: https://www.youtube.com/watch?v=m9c9e2wMngM

    Detailed account of my Ironman win here.

    "My guess is that Grip and Fang have many more kills than Gothmog and Lungorthin." --Fizzix
  • Pete Mack
    Prophet
    • Apr 2007
    • 6883

    #2
    You can change store contents (incl. guaranteed items) via lib/gamedata/store.txt

    Putting back jammed doors is harder

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9637

      #3
      Thank you for starting this thread, I'm going to use the opportunity to advertise (answers to your actual questions at the bottom).

      One of my main purposes with the rewrite that resulted in versions 4.x was to make Angband easier to modify. There are 45 different data files in the lib/gamedata folder, and most of them have at least some changes that can be made without messing up the game.

      You could, for example, put an entry in monster_base.txt for "lawyer", then create a fleet of individual monsters of this type - corporate lawyer, criminal lawyer, tax lawyer - in monster.txt. Their melee (blow_methods.txt and blow_effects.txt) and spells (monster_spell.txt) would have to be drawn from the existing ones as they have code to support them, but the pieces can be put together any way you like.

      It would also be possible to create whole new classes and add their details to class.txt (in fact, there is a file old_class.txt which if renamed to class.txt will give the pre 4.2 classes). You could probably even create a new magic realm in realm.txt to draw their magic from (I haven't tested this; you would at least need to use one of the names of the existing book types as in object_base.txt).

      There is a section in the online documentation on this.

      Answers to actual questions:
      - as Pete said, store.txt enable you to completely revamp the contents of the stores. The black market and the home are special, and you need to leave the store: line alone, but otherwise you could turn the bookseller into a ring shop if you wanted (if you want to change its name, that's in terrain.txt).
      - objects can be modified in every respect - depth they show up and rarity are in the alloc: line. For range of teleportation rings you need to modify the teleportation curse in curse.txt - currently it teleports a distance of 40 every 1d100 turns. Range of teleportation scrolls and staffs is currently M60, which means 60% of the furthest distance to the edge of the level; you could change the percentage or make it a fixed or randomised (XdY) distance. For rings of escaping, change the SPEED[2] to SPEED[1+d3].
      - adding objects is do-able, but if you do it with a live character the savefile won't load. The issue with spikes is that the code to do jamming of doors has been removed.
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

      • wobbly
        Prophet
        • May 2012
        • 2631

        #4
        Modifying what the stores stock is easy in theory, but from my experience its actually fairly easy to cause crashes.

        I'll take a closer look sometime, I suspect the issue I had last time I played around here might of been the store trying to pack more items then it had room for. Mostly I just remember it being a little finicky to adjust.

        Comment

        • backwardsEric
          Knight
          • Aug 2019
          • 527

          #5
          Originally posted by wobbly
          I'll take a closer look sometime, I suspect the issue I had last time I played around here might of been the store trying to pack more items then it had room for. Mostly I just remember it being a little finicky to adjust.
          A change in 4.2.5 plugged one source of crashes in store_create_item() caused by the store not having room to store the new item.

          Comment

          • Grotug
            Veteran
            • Nov 2013
            • 1637

            #6
            Thanks for the replies everyone! I have lots of follow up questions But will only post two for now. 1. Is it possible to have the teleport range of scrolls and staves be M60 (60% of the level) but a variability to that range by say 16 squares on either side of that figure?

            Would writing the following code work?:
            Code:
            dice:M60 -16+1d32
            2. Can I add more lines to potion of Surprise? It would be fun to add !Brawn and maybe !Augmentation. If I were to add !Augmentation, would I need to duplicate the other lines a bunch of times to make the Augmentation occur much less often? I actually used batform from a remaining !surprise potion to get out of a sticky situation. I kept it just in case. I had surmised it probably would have the same effect as the first surprise potion because it was a stack of 2 surprise potions, but maybe it was coincidence that both potions had the same effect?
            Beginner's Guide to Angband 4.2.3 Part 1: https://www.youtube.com/watch?v=m9c9e2wMngM

            Detailed account of my Ironman win here.

            "My guess is that Grip and Fang have many more kills than Gothmog and Lungorthin." --Fizzix

            Comment

            • backwardsEric
              Knight
              • Aug 2019
              • 527

              #7
              Originally posted by Grotug
              Is it possible to have the teleport range of scrolls and staves be M60 (60% of the level) but a variability to that range by say 16 squares on either side of that figure?

              Would writing the following code work?:
              Code:
              dice:M60 -16+1d32
              It would have to be
              Code:
              -16+1d32M60
              , but the current implementation of the teleport effect (it ignores the number of dice and sides from the effect's dice expression, and the distance from the percentage, which is not strictly of the level size but is of the maximum distance from the teleport start location to one of the level's edges, overrides rather than sums with the distance from base, -16) means you would not get the behavior you want:
              Code:
              -16+1d32M60
              would have the same result as
              Code:
              M60
              . The existing teleport effect already randomizes the distance somewhat (one fourth, rounded down, of the result from the dice expression is either added (1/2 chance) or subtracted (1/2 chance) from the result of the dice expression.

              Originally posted by Grotug
              2. Can I add more lines to potion of Surprise? It would be fun to add !Brawn and maybe !Augmentation. If I were to add !Augmentation, would I need to duplicate the other lines a bunch of times to make the Augmentation occur much less often?
              Yes. You would need to increase the number in the "dice:5" line immediately after the "effect:RANDOM" line to match the number of effects you had added; otherwise the potion would choose one of the first 5 effects at random and then always use the additional effects. As you guessed, duplicating lines is currently the only way to get a non-uniform distribution for "effect:RANDOM".

              Originally posted by Grotug
              I actually used batform from a remaining !surprise potion to get out of a sticky situation. I kept it just in case. I had surmised it probably would have the same effect as the first surprise potion because it was a stack of 2 surprise potions, but maybe it was coincidence that both potions had the same effect?
              It was just coincidence (1/5 chance that a surprise potion gives you the same effect as the last one you used). The effect is chosen randomly when the potion is used and not when the potion is created.

              Comment

              • Grotug
                Veteran
                • Nov 2013
                • 1637

                #8
                Thanks backwardsEric! Unfortunately the game won't load after the changes I made. :-/ I'll have to redo my changes and make just one change at a time.
                Beginner's Guide to Angband 4.2.3 Part 1: https://www.youtube.com/watch?v=m9c9e2wMngM

                Detailed account of my Ironman win here.

                "My guess is that Grip and Fang have many more kills than Gothmog and Lungorthin." --Fizzix

                Comment

                • Grotug
                  Veteran
                  • Nov 2013
                  • 1637

                  #9
                  Can I do an alloc line twice to have different level of occurrence deeper you get? Otherwise, umm.. did I do this right?

                  Code:
                  name:Surprise
                  type:potion
                  graphics:!:d
                  level:10
                  weight:4
                  cost:0
                  alloc:10:10 to 15
                  alloc:4:16 to 55
                  pile:25:2
                  power:0
                  effect:RANDOM
                  dice:58
                  effect:TIMED_INC:SCRAMBLE
                  dice:20+1d20
                  effect:SHAPECHANGE:bat
                  effect:DRAIN_STAT:INT
                  effect:DRAIN_STAT:WIS
                  effect:TIMED_INC:STONESKIN
                  dice:20+1d20
                  effect:TIMED_INC:SCRAMBLE
                  dice:20+1d20
                  effect:SHAPECHANGE:bat
                  effect:DRAIN_STAT:INT
                  effect:DRAIN_STAT:WIS
                  effect:TIMED_INC:STONESKIN
                  dice:20+1d20
                  effect:TIMED_INC:SCRAMBLE
                  dice:20+1d20
                  effect:SHAPECHANGE:bat
                  effect:DRAIN_STAT:INT
                  effect:DRAIN_STAT:WIS
                  effect:TIMED_INC:STONESKIN
                  effect:RESTORE_STAT:STR
                  effect:GAIN_STAT:STR
                  effect:LOSE_RANDOM_STAT:STR
                  dice:20+1d20
                  effect:TIMED_INC:SCRAMBLE
                  dice:20+1d20
                  effect:SHAPECHANGE:bat
                  effect:DRAIN_STAT:INT
                  effect:DRAIN_STAT:WIS
                  effect:TIMED_INC:STONESKIN
                  dice:20+1d20
                  effect:RESTORE_STAT:STR
                  effect:GAIN_STAT:STR
                  effect:LOSE_RANDOM_STAT:STR
                  effect:TIMED_INC:SCRAMBLE
                  dice:20+1d20
                  effect:SHAPECHANGE:bat
                  effect:DRAIN_STAT:INT
                  effect:DRAIN_STAT:WIS
                  effect:TIMED_INC:STONESKIN
                  dice:20+1d20
                  effect:RESTORE_STAT:STR
                  effect:GAIN_STAT:STR
                  effect:LOSE_RANDOM_STAT:STR
                  effect:TIMED_INC:SCRAMBLE
                  dice:20+1d20
                  effect:SHAPECHANGE:bat
                  effect:DRAIN_STAT:INT
                  effect:DRAIN_STAT:WIS
                  effect:TIMED_INC:STONESKIN
                  dice:20+1d20
                  effect:RESTORE_STAT:STR
                  effect:GAIN_STAT:STR
                  effect:LOSE_RANDOM_STAT:STR
                  effect:TIMED_INC:SCRAMBLE
                  dice:20+1d20
                  effect:SHAPECHANGE:bat
                  effect:DRAIN_STAT:INT
                  effect:DRAIN_STAT:WIS
                  effect:TIMED_INC:STONESKIN
                  dice:20+1d20
                  effect:RESTORE_STAT:STR
                  effect:GAIN_STAT:STR
                  effect:LOSE_RANDOM_STAT:STR
                  effect:GAIN_EXP
                  dice:200000
                  effect:RESTORE_STAT:STR
                  effect:GAIN_STAT:STR
                  effect:RESTORE_STAT:INT
                  effect:GAIN_STAT:INT
                  effect:RESTORE_STAT:WIS
                  effect:GAIN_STAT:WIS
                  effect:RESTORE_STAT:DEX
                  effect:GAIN_STAT:DEX
                  effect:RESTORE_STAT:CON
                  effect:GAIN_STAT:CON
                  Beginner's Guide to Angband 4.2.3 Part 1: https://www.youtube.com/watch?v=m9c9e2wMngM

                  Detailed account of my Ironman win here.

                  "My guess is that Grip and Fang have many more kills than Gothmog and Lungorthin." --Fizzix

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9637

                    #10
                    Originally posted by Grotug
                    Can I do an alloc line twice to have different level of occurrence deeper you get? Otherwise, umm.. did I do this right?
                    You can only really have one alloc line - if you have a second, it will just overwrite the first. The rest looks OK, except I count 61 effects not 58.
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    • backwardsEric
                      Knight
                      • Aug 2019
                      • 527

                      #11
                      Originally posted by backwardsEric
                      As you guessed, duplicating lines is currently the only way to get a non-uniform distribution for "effect:RANDOM".
                      What I said there is not quite true. There's constructs like this, using nested random effects:

                      Code:
                      effect:RANDOM
                      dice:8
                      effect:BOLT:NETHER
                      dice:16d8
                      effect:RANDOM
                      dice:6
                      effect:RANDOM
                      dice:5
                      effect:BOLT:COLD
                      dice:12d8
                      effect:RANDOM
                      dice:3
                      effect:RANDOM
                      dice:2
                      effect:RANDOM
                      dice:1
                      effect:BOLT:DARK_WEAK
                      dice:8d8
                      where the distribution would be 1/8 for the nether bolt, 7/40 for the cold bolt, and 7/10 for the dark bolt.

                      Comment

                      • Pete Mack
                        Prophet
                        • Apr 2007
                        • 6883

                        #12
                        I could swear that multiple allocation lines were once possible, for things like !Aug and !Exp

                        Comment

                        • Nick
                          Vanilla maintainer
                          • Apr 2007
                          • 9637

                          #13
                          Originally posted by Pete Mack
                          I could swear that multiple allocation lines were once possible, for things like !Aug and !Exp
                          They were indeed, but quite a long time ago.
                          One for the Dark Lord on his dark throne
                          In the Land of Mordor where the Shadows lie.

                          Comment

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