Monster spell messages (list-mon-spells.h) conversion to text in progress

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Elsairon
    Adept
    • Apr 2007
    • 117

    Monster spell messages (list-mon-spells.h) conversion to text in progress

    Working on a first pass at monster spell messages, for now just converting them into a text file format without changes, as Magnate noted in this thread: http://angband.oook.cz/forum/showthread.php?t=4494

    Whoever will be implementing the parser can let me know if they want/need anything different.

    If this is no longer needed, then updating the OP for non-coding help requests is a good idea.

    FYI, some of the direct file links have changed or are completely gone since the OP was written, the directory structure has changed.
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9637

    #2
    Thanks for doing this! I hope I have caught you before doing too much work - although I think any work you have done is not wasted.

    There is now a file containing monster spell info, but not the messages. lib/gamedata/monster_spell.txt has entries which look like:
    Code:
    name:BR_GRAV
    hit:100
    effect:BREATH:GRAVITY:2
    power:30
    The first line is the first column in list-mon-spells.h, to which we would want to add (similar to in the OP):

    vis-message: Message that is printed when the spell is cast by a visible monster (use %^s for the monster's name), e.g. %^s points at you, incanting terribly!
    invis-message: Message that is printed when the spell is cast by an unseen monster, e.g. Something utters a terrible incantation!
    lore: Description that is printed in monster recall after "It can", e.g. cause critical wounds
    save-message: A message which is printed when the player saves (i.e. anything more flavourful than "You avoid the effects!"), if the spell allows a save


    Thanks also for pointing me at the original thread (which I had forgotten, sticky or not). I will make an attempt to post an updated list of things to do at the bottom of that thread, I think, rather than update the OP.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • Elsairon
      Adept
      • Apr 2007
      • 117

      #3
      Sounds good.

      Where can I find a list of the spells that allow saves.
      Last edited by Elsairon; July 11, 2015, 02:46.

      Comment

      • Elsairon
        Adept
        • Apr 2007
        • 117

        #4
        (Fyi, First time using git, using win 7)

        I have opened a github account, installed git, forked angband/angband, and cloned to local repo.

        I have added all current description lines for the monster spells for; vis-message:, invis-message:, and lore: to my local repo.

        Then synced with my github account. I'm not sure when or where you want this, or if angband/angband is the right place to push commits?

        I have not added save-message: yet as I'm looking for a list which monster spells the player has a chance to resist, and then I'll do a pass on some short flavorful messages.

        Some Thoughts:

        1) I have an idea about changing the invis-message: for some of the spells, although it would be a game change, and not sure if it would be a good addition to V. For example, using some variety of messages for monster spell types instead of the ubiquitous 'mumbles'. For example, something a little different for summon spells, attack spells, self-effect spells, etc. This would allow the player a bit more flavor and additional cognizance of what is happening out of vision, and might affect tactical decisions, thus making the game slightly easier. (being able to know if there was a summons for example) I won't do this unless it seems like a good idea and there is some consensus.

        2) "monster spell messages - lots of people have noted that the messages in the latest dev versions are less flavourful than their predecessors." Where are these 'predecessor' messages? I'd be happy to convert those that are available from previous versions. I think that would help keep the history/theme of V intact, instead of making all new messages.
        Last edited by Elsairon; July 11, 2015, 04:35.

        Comment

        • Nick
          Vanilla maintainer
          • Apr 2007
          • 9637

          #5
          Originally posted by Elsairon
          (Fyi, First time using git)

          I have opened a github account, installed git, forked angband/angband, and cloned to local repo.

          I have added all current description lines for the monster spells for; vis-message:, invis-message:, and lore: to my local repo.

          Then synced with my github account. I'm not sure when or where you want this, or if angband/angband is the right place to push commits?
          Pushing to your own repo is fine - although it usually makes it easier for you if you do new work in a new branch rather than use your master branch (see here for this and other helpful advice). There is also specific advice on pull requests, which are the best way to go about getting your stuff included.

          Originally posted by Elsairon
          I have not added save-message: yet as I'm looking for a list which monster spells the player has a chance to resist, and then I'll do a pass on some short flavorful messages.
          The message is always "You avoid the effects" - at least for the spells which have a TRUE in the save column in list-mon-spells.h. So basically anything is an improvement

          Originally posted by Elsairon
          I also have an idea about changing the invis-message: for some of the spells, although it would be a game change, and not sure if it would be a good addition to V. For example, using some variety of messages for monster spell types instead of the ubiquitous 'mumbles'. For example, something a little different for summon spells, attack spells, self-effect spells, etc. This would allow the player a bit more flavor and additional cognizance of what is happening out of vision, and might affect tactical decisions, thus making the game slightly easier. (being able to know if there was a summons for example) I won't do this unless it seems like a good idea and there is some consensus.
          I think this is definitely a good idea - in fact, I'm also in favour of adding different messages depending on the power or other features of the attack. If you want some ideas, this file has a bunch - just search through for the various "case RSF_" statements.
          One for the Dark Lord on his dark throne
          In the Land of Mordor where the Shadows lie.

          Comment

          • Elsairon
            Adept
            • Apr 2007
            • 117

            #6
            Finished basic resist messages.

            I'll continue on next with reviewing monattk.c for some ideas.

            Question: Do we want blank save-message: entries for spells that cannot (currently) be resisted?
            Last edited by Elsairon; July 11, 2015, 06:26.

            Comment

            • Nick
              Vanilla maintainer
              • Apr 2007
              • 9637

              #7
              Originally posted by Elsairon
              Question: Do we want blank save-message: entries for spells that cannot (currently) be resisted?
              No need - the parser can just leave a null message if there's no save-message line.
              One for the Dark Lord on his dark throne
              In the Land of Mordor where the Shadows lie.

              Comment

              • Elsairon
                Adept
                • Apr 2007
                • 117

                #8
                Finished the save-messages. I want to write the invis-messages next. I need to understand how they are constructed.

                EDIT: For now I am source diving in 4.0.0 looking for answers to these questions. If new code is needed source diving won't help, but I have to start somewhere.

                Questions

                What are the rules for message construction?
                Is there a default prefix that invis-message is appended to?
                Is there a postfix appended, like specific punctuation?
                Are these messages passed whole so I should add punctuation for each?
                Should I include starting/ending quotes?

                For example what seems to be the case with the old mon-list method...

                Code:
                name:ARROW_1
                invis-message:fires an arrow
                This implies something like...
                Code:
                'Something '+invis-message:+'.' -> 'Something fires an arrow.'
                I see in monattk.c file in FA you have what I would translate as:
                Code:
                name:ARROW_1
                invis-message:'You hear a soft twang.'
                This imply the message is constructed without prefix or postfix, and requires bounding quotes. I'm not sure if these messages are constructed different for V.

                Code:
                ''+invis-message:+'' -> 'You hear a soft twang.'
                Last edited by Elsairon; July 11, 2015, 18:53.

                Comment

                • Elsairon
                  Adept
                  • Apr 2007
                  • 117

                  #9
                  As far as I can tell right now the spell messages are created in mon-spell.c/do_mon_spell(...)

                  The pertinant part being

                  Code:
                  /* Tell the player what's going on */
                  	disturb(player, 1);
                  
                  	if (!seen)
                  		msg("Something %s.", info->blind_verb);
                  	else if (!hits) {
                  		msg("%s %s %s, but misses.", m_name, info->verb, info->desc);
                  		return;
                  	} else if (info->msgt)
                  		msgt(info->msgt, "%s %s %s.", m_name, info->verb, info->desc);
                  	else
                  		msg("%s %s %s.", m_name, info->verb, info->desc);
                  
                  	/* Try a saving throw if available */
                  	if (info->save && randint0(100) < player->state.skills[SKILL_SAVE]) {
                  		msg("You avoid the effects!");
                  		return;
                  Up to now messages are built using the monsters name, and data from the monster spell info table.
                  Code:
                  const struct mon_spell_info *info = &mon_spell_info_table[index];
                  Specifically monster spell table distinguishes between;
                  blind verb, verb, and desc from the table.

                  Compare withe the new message system;
                  invis-message: and vis-message

                  If I understand correctly the new messages need to include both the verb and the description in one entry.

                  An example of a new entry showing the new messages.
                  Code:
                  name:MIND_BLAST
                  hit:100
                  effect:DAMAGE
                  dice:8d8
                  effect:TIMED_INC:CONFUSED
                  dice:3+1d4
                  vis-message:%^ gazes at you with psionic energy
                  invis-message:focuses on your mind
                  lore:cause mind blasting
                  save-message:you shake off a pounding headache
                  Extracted from table
                  Code:
                  /*name		type			desc			msgt				save	verb			blind_verb		lore_desc*/
                  RSF(MIND_BLAST,	RST_ATTACK | RST_ANNOY,	"psionic energy",	0,				TRUE,	"gazes at you with",	"focuses on your mind",	"cause mind blasting")
                  Question being , should the save-message change? Does it need quotes?
                  save-message:you shake off a pounding headache -> save-message:'You shake off a pounding headache!'

                  If we want to have more freedom with invis-messages not being dependent on 'Something' as a prefix would open up alot more opportunities. See see end of previous post for example with ARROW_1 message in FA.

                  Part of the challenge of thinking of these messages is the format constraints, and trying to think of all the contexts in which the message might be displayed, and making them general enough to make sense in all the scenarios, yet still retain enough flavor to be worth adding.
                  Last edited by Elsairon; July 11, 2015, 20:47.

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9637

                    #10
                    I would start with the following rules:
                    • No need for quotes (unless you want the quotes to actually appear, as in
                      screams the word 'DIE!'
                    • Assume you're doing the entire message
                    • You can either have space for the monster's name (or substitute like "something"), or not - so "^%s fires an arrow" or "You hear a soft twang" are both possibilities


                    For the last case, the code will need to know whether it needs to fill in monster name or not. Probably the simplest way to do that is to have two different types of line:
                    Code:
                    invis-message:You hear a soft twang
                    or
                    Code:
                    invis-message-name:^%s fires an arrow
                    and each spell only gets one or the other.

                    But don't be held back by those rules. You've seen how simple the code around this is; if you have a better scheme for constructing the entire spell message, go right ahead. Really all we're trying to do is be informative, flavourful and fairly brief.
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    • takkaria
                      Veteran
                      • Apr 2007
                      • 1951

                      #11
                      I think we want to avoid constructing strings in the code (thinking about potential future translations here too). And including bare format strings in the edit files is a security hole and potential crash bug waiting to happen. So I'd do something like use {{name}} or similar to signify where the monster name should go and we can make the code process that. And include a failure line as well, so that the code doesn't have to add "but misses":

                      Code:
                      message:{{name}} gazes at you with psionic energy. 
                      message-miss:{{name}} gazes at you with psionic energy, but misses.
                      message-save:You shake off a pounding headache. 
                      message-invis:Something invades your mind.
                      lore:cause mind blasting
                      takkaria whispers something about options. -more-

                      Comment

                      • Elsairon
                        Adept
                        • Apr 2007
                        • 117

                        #12
                        Thanks guys. I will continue ahead with these suggestions, one more thought though.

                        Do we need message-invis-miss: ?? I'm thinking not since the player wouldn't know about it, and the messages are all about filling in the characters experience for things that are not obvious on screen but are perceived.

                        How about the lore: entries?

                        Those are listed here but are built in a different part of the code. As of now the entries for breath include only the name of the element, and not the prefix 'breathes'. This is part of monster memory view if I recall correctly.
                        Last edited by Elsairon; July 12, 2015, 08:59.

                        Comment

                        • Elsairon
                          Adept
                          • Apr 2007
                          • 117

                          #13
                          I'm looking at which spells need message-miss:
                          I'm guessing the entries with RST_BOLT and RST_ATTACK.

                          I think the relevant code is here.. in mon-spell.c (correct me if I'm wrong)
                          Code:
                          	/* See if it hits */
                          	if (spell->hit == 100)
                          		hits = TRUE;
                          	else if (spell->hit == 0)
                          		hits = FALSE;
                          	else
                          		hits = check_hit(player, spell->hit, rlev);
                          However I don't know where spell->hit is reading from so I can't tell for sure which spells need it and which don't.

                          I think I'm almost done after adding these miss messages. I'll do another once over to look for typos, etc.

                          Comment

                          • Nick
                            Vanilla maintainer
                            • Apr 2007
                            • 9637

                            #14
                            Originally posted by Elsairon
                            However I don't know where spell->hit is reading from so I can't tell for sure which spells need it and which don't.
                            spell->hit is just coming from the hit: line in monster_spell.txt - so basically they're all perfect hits except arrows and boulders.
                            One for the Dark Lord on his dark throne
                            In the Land of Mordor where the Shadows lie.

                            Comment

                            • Elsairon
                              Adept
                              • Apr 2007
                              • 117

                              #15
                              I'm calling this first iteration done. All of the requested messages as far as I can tell are added to the monster_spell.txt file.

                              I took several ideas from Nick's FA monattk.c and used those, trying to maintain theme.

                              The ARROW_1 - 4 messages might need another look to match the lore: entries as I wasn't sure how those are used or if they could be changed.
                              Some messages retain 'Something mumbles.' for message-invis: such as the ball and bolt spells.

                              More iteration can improve these issues later,but it should be enough to test with.

                              Completed file attached here, as it is within the size requirement (hopefully it works) or if not shoot me a pm and I can email you.
                              Attached Files
                              Last edited by Elsairon; July 14, 2015, 20:57.

                              Comment

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