Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old May 14, 2013, 04:21   #1
seebs
Rookie
 
Join Date: May 2013
Posts: 8
seebs is on a distinguished road
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...
seebs is offline   Reply With Quote
Old May 14, 2013, 10:02   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,862
Donated: $60
Nick will become famous soon enough
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.
Nick is offline   Reply With Quote
Old May 14, 2013, 14:36   #3
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,936
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Nick View Post
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-
takkaria is offline   Reply With Quote
Old May 14, 2013, 14:43   #4
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,936
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by seebs View Post
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-
takkaria is offline   Reply With Quote
Old May 15, 2013, 01:51   #5
ekolis
Knight
 
ekolis's Avatar
 
Join Date: Apr 2007
Location: Cincinnati, OH, USA
Age: 36
Posts: 911
ekolis is on a distinguished road
Send a message via AIM to ekolis Send a message via MSN to ekolis Send a message via Yahoo to ekolis
Quote:
Originally Posted by seebs View Post
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!
ekolis is offline   Reply With Quote
Old May 15, 2013, 15:15   #6
LostTemplar
Knight
 
Join Date: Aug 2009
Posts: 670
LostTemplar is on a distinguished road
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.
LostTemplar is offline   Reply With Quote
Old May 15, 2013, 19:29   #7
seebs
Rookie
 
Join Date: May 2013
Posts: 8
seebs is on a distinguished road
Quote:
Originally Posted by ekolis View Post
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.
seebs is offline   Reply With Quote
Old May 15, 2013, 20:08   #8
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,946
Derakon is on a distinguished road
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.
Derakon is offline   Reply With Quote
Old May 15, 2013, 21:31   #9
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Derakon View Post
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.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old May 15, 2013, 22:02   #10
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,946
Derakon is on a distinguished road
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.
Derakon 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
New spell lists miyazaki Vanilla 17 August 22, 2010 17:46
New spell / skill dhegler Vanilla 3 May 21, 2010 21:36
Feature request: change "Purification and Healing" prayer book. bron Vanilla 1 December 19, 2009 00:19
r1614 bug - casting from newly acquired book ekolis Vanilla 1 August 5, 2009 22:27
by the book vorondil Vanilla 2 January 6, 2009 00:21


All times are GMT +1. The time now is 07:25.


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