Class, Race, and Item Parsing for a Wiki

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kooltone
    Scout
    • Jun 2021
    • 36

    Class, Race, and Item Parsing for a Wiki

    As a new player, it's been bugging me that I can't find detailed specifics about race and class abilities online in a wiki. If I want to see the full list of spells a class can cast, I have to dig through the github files. The online Angband Manual gives a summary of classes, but it doesn't give a complete picture.

    I do not fault the devs. Nick and backwardsEric, you are doing a great job. But it is difficult for a new player to find answers without creating a forum post or having coding knowledge.

    I'm a node.js developer, so I can read the github files fairly well. The data files in lib are really nice. I like how many things are data driven. So I was thinking about creating a parser that would parse class, race, item and monster data into a web page to work like a wiki. However, is this something that would break over time when changes are made? I fear over time changes to the files would break the parser.

    Speaking of which, is the file format Angband specific or does the data follow a standard convention? I tend to deal with JSON, XML, CSV files in my day to day work. How would I check to see when an object terminates? Is it just a blank newline? Actually that doesn't seem right. Is it until you find another name key?
    Certainty of death. Small chance of success. What are we waiting for?
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9637

    #2
    The parsing is done in parser.c (unsurprisingly), and to some extent in datafile.c - looking at those will give some idea of how it all works.

    You may be interested in Thraalbee's monster parsing page here.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • Thraalbee
      Knight
      • Sep 2010
      • 707

      #3
      That page does not adapt to new versions so will fail with the current release. The display part is good though. I made it as a learning excercise so code quality is so so though. Feel free to copy any part of it!

      Comment

      • Sideways
        Knight
        • Nov 2008
        • 896

        #4
        Make sure you have a good idea what kind of output format and UI you want. A wiki may not be the ideal format for automatically produced content, especially if you don't have previous experience with operating a wiki.

        Gwarl tried to launch an Angband wiki some time ago, and had very similar ideas as you for automatically produced content; but he basically approached the project from an entirely non-wiki starting point, so the actual wiki aspects of it were just holding him back, and at the same time he held the wiki back by not implementing basic things like sitewide CSS. Neither the wiki nor the automated content got anywhere.
        The Complainer worries about the lack of activity here these days.

        Comment

        • AnonymousHero
          Veteran
          • Jun 2007
          • 1393

          #5
          I think ToME 2.x had an interesting approach here where you could supply command line arguments to (re-)generate some(!) of the documentation, but it was never really carried to the proper end state. (I.e. there were still lots of hardcoded assumptions in the docs, e.g. what the classes were, etc. etc.)

          EDIT: A reasonably good starting point would be doc systems that let you include bits of documentation generated from code.

          Comment

          • Thraalbee
            Knight
            • Sep 2010
            • 707

            #6
            Originally posted by Nick
            ...You may be interested in Thraalbee's monster parsing page here.
            This site is now updated for the latest release and auto-loads the current datafiles (so a bit slow to load). Probably the easiest way of getting a quick overview of monsters and their distribution from level 1 to 100

            Comment

            • backwardsEric
              Knight
              • Aug 2019
              • 527

              #7
              DavidMedley had manually assembled much of the class information into a spreadsheet hosted on Google Docs. That information is likely fairly up-to-date (4.2.0 to 4.2.1 or 4.2.2).

              In line with AnonymousHero's suggestion, an option to generate class and race spoilers could be added to the spoiler options on the tombstone screen with equivalents for generating them from the command line (the command line version only works when going through main.c; the Windows and Mac front ends bypass main.c so don't benefit from that). There's already spoiler information for plain objects, artifacts, and monsters. That lets one reuse the existing parsers but would likely require a reformatting step on the output since the spoiler text is meant for direct human consumption and doesn't have any markup.

              Comment

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