Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old February 26, 2011, 07:36   #1
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: New England winter
Posts: 923
Therem Harth is on a distinguished road
Number of spells per realm requirement

I was messing around with Angband 3.2 today, adding a new spellcasting class (Elementalists, with spellbooks based more or less on the classical elements). Everything went fine until I discovered that the way the spell indexing works seems to require a set number of spells per realm. The number is apparently 64, and Elementlists get only 16...

It *would* be possible to get this working, I think, but it looks like it would require some stupid hackery, testing for the problem realm number and stuff. So before I reimplement the whole thing in a way that doesn't use spellbooks, I have two questions...

1. Is there a non-hacky way to work around this problem in 3.2, without making huge changes?
2. If not, could allowance for magic realms of varying sizes be added to the list of wanted features for the next release? (Assuming it's not too much of a pain to do in C.)

Though FWIW, despite this setback I'm finding it quite fun to work with the current V codebase. It's much less confusing than the other variants I've looked at.
Therem Harth is offline   Reply With Quote
Old February 26, 2011, 07:53   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,864
Donated: $60
Nick will become famous soon enough
I am currently moving FA to be as like the V3.2 code as I can - and I can't see a way to do that non-hackishly. There is also an assumption built in in places that there are only two spell realms.

FA currently has a big array with all the spells for all the different class types, arranged into books - and I am planning to keep it that way, but in other respects use as much of the V code as possible. The current (seriously under construction) state of FA is here, if you want to look at it for ideas. I have mostly done the spellcasting, I think...
__________________
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 February 26, 2011, 15:55   #3
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: New England winter
Posts: 923
Therem Harth is on a distinguished road
Hmm, thanks.

Looking at this, I think the easiest way to handle the problem is to redo the magic system and divide it up the way I like it. In this case, one tval for spellbooks, five books, eight spells per book, with each book being a separate realm. I think that should work.
Therem Harth is offline   Reply With Quote
Old February 26, 2011, 21:40   #4
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 39
Posts: 1,516
d_m is on a distinguished road
If you want to open a bug about making spell/realm/book/magic definitions more flexible I would love to work on that. While I don't expect V (in the short term) to introduce new realms I would like for a variant author to be able to do this easily (via edit files only ideally).
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old February 26, 2011, 22:46   #5
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,864
Donated: $60
Nick will become famous soon enough
I think new spells are always likely to need more than edit files - but I may be being pessimistic there. And more flexibility is good.
__________________
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 February 26, 2011, 23:50   #6
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 39
Posts: 1,516
d_m is on a distinguished road
Quote:
Originally Posted by Nick View Post
I think new spells are always likely to need more than edit files - but I may be being pessimistic there. And more flexibility is good.
Oh I totally agree that new spell implementations will often need C code (although it'd be nice to be able to parameterize the spells, e.g. Fireball(dmg=100, range=20, radius=2) or something)... but I think that the edit files should support any number of spells/realms/books/whatever.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old February 27, 2011, 00:57   #7
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
What's wrong with do things in hacky ways?
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Old February 27, 2011, 01:25   #8
PowerDiver
Prophet
 
Join Date: Mar 2008
Posts: 2,712
PowerDiver is on a distinguished road
Quote:
Originally Posted by d_m View Post
Oh I totally agree that new spell implementations will often need C code (although it'd be nice to be able to parameterize the spells, e.g. Fireball(dmg=100, range=20, radius=2) or something)... but I think that the edit files should support any number of spells/realms/books/whatever.
Ideally, everything would be an effect in effects.c, and the spells would invoke some effect.

The tricky stuff is spells like Orb. You need to define an effective level for invoking the effect, but priests do more evil damage than paladins at the same CL. Perhaps paladins could count as half of a priest for that purpose? That would only work if it made sense to do it consistently across all of the other spells where you want effect to scale with level.
PowerDiver is offline   Reply With Quote
Old February 27, 2011, 01:40   #9
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 39
Posts: 1,516
d_m is on a distinguished road
Quote:
Originally Posted by PowerDiver View Post
Ideally, everything would be an effect in effects.c, and the spells would invoke some effect.

The tricky stuff is spells like Orb. You need to define an effective level for invoking the effect, but priests do more evil damage than paladins at the same CL. Perhaps paladins could count as half of a priest for that purpose? That would only work if it made sense to do it consistently across all of the other spells where you want effect to scale with level.
My parameterization solution would be to actually have a mapping from generic spells (which would correspond to effects) onto how the spell performs for a given class (in terms of spell power, failure rate, radius, damage, range, chance to beam, whatever). In that case you just need to make sure your effects have the right parameters and you should be able to configure actual spell behavior pretty flexibly.

You could actually define monster attacks in a similar way, mapping a monster attack onto a parameterized effect. The fact that monsters and players are so asymmetric would obviously make that level of code sharing somewhat awkward, but probably not impossible.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old February 27, 2011, 01:41   #10
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,864
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by PowerDiver View Post
The tricky stuff is spells like Orb. You need to define an effective level for invoking the effect, but priests do more evil damage than paladins at the same CL. Perhaps paladins could count as half of a priest for that purpose? That would only work if it made sense to do it consistently across all of the other spells where you want effect to scale with level.
That should be OK - you can just do a check for ZERO_FAIL in the effect definition. More generally, increased use of the player flags to can give more control over this sort of stuff.
__________________
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
Number of monsters at each depth CunningGabe Vanilla 13 January 26, 2011 21:27
Random number generation? Chud Vanilla 21 November 8, 2010 19:00
Increasing number of Randarts Malatar Vanilla 33 January 27, 2010 19:13
Number and arrow keys Nick Vanilla 3 December 6, 2008 22:58
Where to find all the number-key maps Dawnmist Vanilla 6 March 24, 2008 20:47


All times are GMT +1. The time now is 23:17.


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