Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old July 11, 2015, 02:40   #1
Elsairon
Adept
 
Join Date: Apr 2007
Posts: 117
Elsairon is on a distinguished road
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.
Elsairon is offline   Reply With Quote
Old July 11, 2015, 03:13   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,224
Donated: $60
Nick is on a distinguished road
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.
Nick is offline   Reply With Quote
Old July 11, 2015, 03:18   #3
Elsairon
Adept
 
Join Date: Apr 2007
Posts: 117
Elsairon is on a distinguished road
Sounds good.

Where can I find a list of the spells that allow saves.

Last edited by Elsairon; July 11, 2015 at 03:46.
Elsairon is offline   Reply With Quote
Old July 11, 2015, 04:59   #4
Elsairon
Adept
 
Join Date: Apr 2007
Posts: 117
Elsairon is on a distinguished road
(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 at 05:35.
Elsairon is offline   Reply With Quote
Old July 11, 2015, 05:49   #5
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,224
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Elsairon View Post
(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.

Quote:
Originally Posted by Elsairon View Post
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

Quote:
Originally Posted by Elsairon View Post
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.
Nick is offline   Reply With Quote
Old July 11, 2015, 07:12   #6
Elsairon
Adept
 
Join Date: Apr 2007
Posts: 117
Elsairon is on a distinguished road
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 at 07:26.
Elsairon is offline   Reply With Quote
Old July 11, 2015, 07:31   #7
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,224
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Elsairon View Post
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.
Nick is offline   Reply With Quote
Old July 11, 2015, 08:42   #8
Elsairon
Adept
 
Join Date: Apr 2007
Posts: 117
Elsairon is on a distinguished road
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 at 19:53.
Elsairon is offline   Reply With Quote
Old July 11, 2015, 20:42   #9
Elsairon
Adept
 
Join Date: Apr 2007
Posts: 117
Elsairon is on a distinguished road
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 at 21:47.
Elsairon is offline   Reply With Quote
Old July 12, 2015, 00:57   #10
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,224
Donated: $60
Nick is on a distinguished road
I would start with the following rules:
  • No need for quotes (unless you want the quotes to actually appear, as in
    Quote:
    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.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bug in Monster/Mon-timed.c mixer Vanilla 2 December 17, 2011 11:25
list experience value in Monster List view fbas Vanilla 1 November 24, 2010 20:51
Spell list in windows? Swede2378 Vanilla 0 June 13, 2010 01:04
Basic Questions: Ball Spell + List Items kicker Vanilla 4 November 16, 2008 21:35
monster list info DaviddesJ Vanilla 1 March 31, 2008 04:10


All times are GMT +1. The time now is 06:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.