Spell book thoughts...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seebs
    Rookie
    • May 2013
    • 8

    Spell book thoughts...

    Long story short:

    I would like to solve the problem where there is a magical connection between x-spell.c and spells.txt. I would also like to clean up some of the interactions and/or parsing. Really, ideally, what I think would be nice would be to have books list spells, rather than spells listing books.

    More generally, it might be nice to add slightly improved support for symbolic names to the *.txt parsing, so that instead of having to compare tval/sval values, we could do something like:

    N:470:[Mordenkainen's Escapes]
    SOMETHING_GOES_HERE:BOOK_ESCAPES

    and then later:

    N:34:Word of Recall
    B:BOOK_ESCAPES

    instead of "I:90:6:3".

    This, then, leads into the OTHER thing I want to do, which may be broken-as-designed but sounds really fun to me:

    Scribable spellbooks.

    Basic idea: A spellbook is given a capacity in some unit. You can find blank or incomplete spellbooks. You can learn a spell you don't know, and if you have a spellbook with sufficient space, you can scribe the spell there. Spells cannot be removed from books, or reordered, so if you want spells in a given order, you write them that way.

    What makes this cool: You could find some but not all of the spells from, say, Resistances. You might have Resist Fire but never have seen Resist Cold, say. This makes finding spells a little smoother in some ways (you don't get an entire dungeon spellbook at once, necessarily), but possibly more annoying if you just happen to never find a given spell.

    What makes it possibly broken: A mage with four blank dungeon spellbooks that have been inscribed with all the spells that the mage ever wants to cast, thus using four slots and 12 lbs. to make up for what would normally take 9 slots some of which had to have multiple items in them...
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9638

    #2
    A couple of things you might like to look at:
    1. A few years back there was a short-lived Zangband variant called Frazband (code here) which featured writable spellbooks
    2. FAangband (my variant) has basically the Angband system but the half-casting classes get a compressed set of spellbooks with different spell ordering; this is handled by having big lists (pretty much of the opaque type you were complaining about...) in the p_class.txt file.
    3. In writing this it has just occurred to me that maybe the way to treat spells is to put them in one of the list-*.h files (list-effects.h is the obvious one to compare to).


    There's your homework, come back when you have a patch written
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      #3
      Originally posted by Nick
      A couple of things you might like to look at:
      1. In writing this it has just occurred to me that maybe the way to treat spells is to put them in one of the list-*.h files (list-effects.h is the obvious one to compare to).
      Yes, this. In fact, spells should just use effects.c/list-effects.h, no point in having a separate setup for them.
      takkaria whispers something about options. -more-

      Comment

      • takkaria
        Veteran
        • Apr 2007
        • 1951

        #4
        Originally posted by seebs
        More generally, it might be nice to add slightly improved support for symbolic names to the *.txt parsing, so that instead of having to compare tval/sval values, we could do something like:

        N:470:[Mordenkainen's Escapes]
        SOMETHING_GOES_HERE:BOOK_ESCAPES

        and then later:

        N:34:Word of Recall
        B:BOOK_ESCAPES

        instead of "I:90:6:3".
        The game has been moving towards allowing reference to names of objects rather than numeric values for a while. In a lot of places, you can now use textual tvals as well as the object's name as the tval (e.g. I:magic book:[Mordenkainen's Escapes]:3), no need for extra symbolic names. It should be pretty easy to change - look at prefs.c for the bit that deals with parsing object graphics.
        takkaria whispers something about options. -more-

        Comment

        • ekolis
          Knight
          • Apr 2007
          • 921

          #5
          Originally posted by seebs
          Scribable spellbooks.

          Basic idea: A spellbook is given a capacity in some unit. You can find blank or incomplete spellbooks. You can learn a spell you don't know, and if you have a spellbook with sufficient space, you can scribe the spell there. Spells cannot be removed from books, or reordered, so if you want spells in a given order, you write them that way.
          This is cool. But how would you learn spells that aren't in books? That would be an entirely new game mechanic, wouldn't it? And (sorry for the fridge logic) if you can learn a spell and hold it in memory indefinitely, why the need for books in the first place? Though I guess casting from memory might be harder than casting from a book, since the book serves as a mental crutch in case you forget some of the incantations. ADOM has a mechanic like this, doesn't it, where casting from a book consumes less MP than casting from memory? Or do books in ADOM exist solely to refresh memory from time to time, but may wear out after repeated reading?
          You read the scroll labeled NOBIMUS UPSCOTI...
          You are surrounded by a stasis field!
          The tengu tries to teleport, but fails!

          Comment

          • LostTemplar
            Knight
            • Aug 2009
            • 670

            #6
            In ADOM casting from book is slow and consumes more MP, while reading books allows to learn limited instances of a spell and destroys book sometimes.

            Comment

            • seebs
              Rookie
              • May 2013
              • 8

              #7
              Originally posted by ekolis
              This is cool. But how would you learn spells that aren't in books? That would be an entirely new game mechanic, wouldn't it? And (sorry for the fridge logic) if you can learn a spell and hold it in memory indefinitely, why the need for books in the first place? Though I guess casting from memory might be harder than casting from a book, since the book serves as a mental crutch in case you forget some of the incantations. ADOM has a mechanic like this, doesn't it, where casting from a book consumes less MP than casting from memory? Or do books in ADOM exist solely to refresh memory from time to time, but may wear out after repeated reading?
              My assumption had been that you would still only ever learn spells from books. Possibly you'd have to have a book containing a spell to write it into another book also.

              I had the idea of making spells take up more or less space by "level" or something.

              Although the edit file stuff is probably a better starting point, since it's not a feature change.

              Comment

              • Derakon
                Prophet
                • Dec 2009
                • 9022

                #8
                For what it's worth, Pyrel's approach to this is probably going to be that spellbooks are containers which hold spell scrolls; if you find a new spell scroll and your spellbook has room, you can put the scroll into the book. But the scroll can never be removed from the book, once added.

                Of course, the Vanilla ruleset within Pyrel would have all books spawn with predetermined spellscrolls inside, and spellscrolls never spawning on their own. But variants would be able to easily change that.

                Comment

                • Magnate
                  Angband Devteam member
                  • May 2007
                  • 5110

                  #9
                  Originally posted by Derakon
                  For what it's worth, Pyrel's approach to this is probably going to be that spellbooks are containers which hold spell scrolls; if you find a new spell scroll and your spellbook has room, you can put the scroll into the book. But the scroll can never be removed from the book, once added.

                  Of course, the Vanilla ruleset within Pyrel would have all books spawn with predetermined spellscrolls inside, and spellscrolls never spawning on their own. But variants would be able to easily change that.
                  That implies that "spellscrolls" are different items from "scrolls". I would urge not taking that route, for the reason that it's completely bonkers for new players - something I know you care about.

                  Just let each normal scroll have a "scribability" rating, which ranges from 0% for scroll-only spells to whatever a reasonable success chance would be for a low-level caster scribing Magic Missile. Let this rating be affected by scribe level, race, book material, whatever.

                  Then in the V-compliant scenario the books come pre-scribed with no spare slots.

                  In variants, you could also be able to remove scrolls from books, albeit perhaps with a chance of damaging or destroying the book.
                  "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                  Comment

                  • Derakon
                    Prophet
                    • Dec 2009
                    • 9022

                    #10
                    Personally I disagree -- there's a big difference between a scroll that anyone can read once and that imparts some magical effect, and a scroll that only certain classes can read that allows them to cast a spell any number of times -- but honestly it's not really worth worrying about, since the difference engine-wise is minimal. Especially, I'd like to be able to support things like ToME2's oddly-named Rings and Amulets of Spell, which were jewelry that you could store spells in. As a result, Pyrel will have to be able to handle spellcasting from any item type, so if you want ordinary scrolls to be "castable" then you just attach the appropriate data to them and you're off to the races.

                    (Spellbooks will have filters on what kinds of items you can put in them so they don't end up as storage for e.g. suits of armor, but again, if you want to put ordinary scrolls into them then just adjust those filters as appropriate)

                    So there's no problem for "vanilla Pyrel" since it won't visibly work differently from Vanilla itself, and variants are free to do whatever they like.

                    Comment

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