Player Resource Consortium

 

Author Topic: Selectable metamagic for spontaneous casters?  (Read 21907 times)

0 Members and 1 Guest are viewing this topic.

September 22, 2009, 09:01:51 AM
Reply #15
  • Jr. Associate
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile

I finally had time to test it, and it seems to be working very well, with no more modification on my part. Except for Quicken Spell of course, which is a let-down, but should have been obvious to me before. Anyway, a quickened spell-feat can always be combined with the other abilities.

I really love that I can eliminate the now-redundant versions of the spells from appearing, many of which (like Fireball) would be taking up 5 radial entries. It takes me almost a minute to get to the level 9 spells using the mouse on my level 20 Warmage.

Is there any interest in merging this work with the PRC? I think, please correct me if I'm wrong, that it's more in line with D&D -- not that I'm a reference, as I haven't played it. Doesn't the Psionic system also get similar abilities?


September 23, 2009, 08:51:16 AM
Reply #16

How did you deal with people trying to cast metamagiced spells beyond their allowed level? And does it allow eg. empowered + maximised or just combining a normal one with a sudden one? I can't remember how much feedback metapsionics gives the player, but how easy is it to figure out which feats you have active at any one time (short of casting a spell :p )? I think it would be a nice thing to have in the prc to stop the ever expanding subradials.

Whether or not to enable combined metamagic is another issue. To enable it for all casters would be a lot of work. To only enable it for spontaneous casters using the prc spellbook seems to me to penalise other casters too much. What do other people think about this? (However, if you had fixed all the spells to use combined metamagic, I don't see a problem with using those fixes so that anyone wanting to fully implement it had slightly less work to do).

As some people may remember from the old forum, motu99 was working on combined metamagic for all casers for the PRC. I will try find time to look over the bits of the old forum I pulled from google cache to see if that discussion was one of the ones I managed to grab. If so, I'll post it somewhere as it might be useful to someone. I can't even remember if he sent us the actual code or not :( .

I need more free time and brain cells :|

edit: also do feel free to go on irc to ask questions. Someone might even answer one...
« Last Edit: September 23, 2009, 08:52:40 AM by fluffyamoeba »


September 23, 2009, 11:49:29 AM
Reply #17
  • Jr. Associate
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile

Thanks for the invite to IRC, but I dare not install an IRC program again. It used to be an addiction of mine. ;)

All metamagic would be combined. Everything from Sudden Extend, to Empower Spell and Maximize Spell, as well as the metamagic spell-feats. A player casting a spell higher than level 9 through metamagic is stopped and informed.

It's not easy to figure out which metamagic feats are active, but as they only affect one spell, it should be easy to remember. You can determine precisely which level the spell was cast at based on the floating feedback message that says You have X castings of spells of level N left remaining."

I already added a switch and everything incase a person doesn't want metamagic combining used.

I again don't know why this didn't occur to me before, but it should be possible to support this for prepared casters too! That thought never crossed my mind, as the actual combining idea came second to just adding in spontaneous metamagic. I'll look at that perhaps later tonight.


September 23, 2009, 04:35:39 PM
Reply #18

There would be one more issue that would need some work. At the moment, where possible, the PRC uses the bioware spellbook. As it's easier to use than ours, it's reasonable to expect that's what people want. I think some people would want the option of using the PRC spellbook for their wizard/sorc/bard/prepared divine caster if that gave them combined metamagic, whereas others would want to keep using the bioware one. :)


September 23, 2009, 06:32:40 PM
Reply #19

Well at least if you did add metamagic combining to all spellcasting classes, it would also give a reason to put in classes that are based more on metamagic.


September 24, 2009, 01:19:39 AM
Reply #20
  • Jr. Associate
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile

I see three problems remaining with it so far:
1. Metamagic combining for prepared casters.
2. Although it will lower the number of radials for spontaneous casters, sometimes you may want to always cast Empowered Fireball, or Extended Globe of Invulnerability. Activating the feat ability could sometimes be annoying. I think a dialog will need to be added so that metamagic spell-feats can be given on an individual basis.
3. Quicken spell, arguably the most important metamagic feat for selectable metamagic, doesn't work. I say it would be the most important because with the new feats, it becomes a lot more useful. Many times you won't have the quickened spell you want quickslotted when you actually need it, but if it could be activated at will....

#3 could perhaps be solved by making all spell-feats instantaneous, and then casting the real spell after, no? I'll look into that.

As for it making the new spellbook system more favorable, it's certainly a legitimate point. I can't disagree with it either. But personally, I would almost never play a Bioware-spellbook caster again. The number of build options the PRC gives you with the new caster classes are already much more powerful than those without.


September 24, 2009, 08:38:46 AM
Reply #21

Quicken is done by making the quickened spell's feat have instantaneous casting time (can't remember if that's in the feat or its spell entry). I think you'd have to leave the quickened spells on the radial for that to work. Unless psionics does something to get around that. The spellbooks are something i don't know much about, otherwise I'd have been more helpful.


September 24, 2009, 10:06:08 AM
Reply #22
  • Jr. Associate
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile

That's what I meant to say. I guess I phrased it badly. Turning all spell feats into instant actions, and then doing ActionCastSpellAtObject() for the real spell. I don't know. It seems so obvious that I suspect I'm missing something fundamental.

Maybe it's a contestation issue, i.e., accidentally activating 3 spells in 1 second. Nothing a lock can't fix.

I haven't had a lot of time to do any additional work on this thing, but I hope to get something done by the weekend at least.


September 28, 2009, 04:00:44 AM
Reply #23
  • Jr. Associate
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile

If you had read my deleted posts you would have witnessed my less-than-apt self struggling earlier with the inevitable conclusion that the hide-based spell feat system is flawed by design and cannot be fixed in any user-friendly way.

Prepared metamagic combining is impossible as the spellbook system stands now. (I'm probably the last person on these forums to figure that out.) It could prepare an existing feat of course, but that would be confusing at best.

So I'll just post what progress I made on the spontaneous metamagic ability/combining system so that others may find a use for it. I didn't fix any of the actual spells, but a lot do work with combining (any Bioware ones should). I wanted to include changes allowing quicken to function, but for some reason the game engine was ignoring the metamagic flag at casting.

Here are the replaced hakpaks/2da's (from SVN r71) and diffs:
meta_r1.7z (3.4MB, 50:1 compression ratio -- oh my how much faster NWN could be loading)
meta_r1_diffs.7z (63 kB).

I did a quick analysis of the available spells that might assist someone wanting to replace the PRC spell system.
Code: [Select]
8,526 spell feats                 (columns 10001-18526)
2,591 valid spells                (columns 0-3858; has Innate level)
1,268 invalid spells              (columns 0-3858; no Innate level)
1,707 meta-aware spells           (of valid spells; Metamagic row is 0+)
898   meta-supporting spells      (of meta-aware spells; Metamagic row is 1+)
6,371 meta-spell variants         (of meta-supporting spells)
2,282 meta-spell single variants  (of meta-spell variants)

Spells by level:                  0(29), 1(596), 2(153), 3(212), 4(160), 5(174), 6(89),  7(79),   8(71),   9(144)
Meta-spell variants by level:     0(0),  1(16),  2(414), 3(699), 4(766), 5(715), 6(988), 7(1189), 8(1029), 9(555)
Meta-spell variants by level (S): 0(0),  1(16),  2(403), 3(344), 4(325), 5(292), 6(364), 7(262),  8(189),  9(87)
[/size]


September 28, 2009, 03:49:36 PM
Reply #24
  • Adept
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile

Quote from: N-S

Prepared metamagic combining is impossible as the spellbook system stands now. (I'm probably the last person on these forums to figure that out.) It could prepare an existing feat of course, but that would be confusing at best.


Its not impossible, but its hard work. And you were on the right track...

The way to do it, is to
- make all (fake) spell casting feats instant feats
- throw out all metamagic fake spell versions (including the quickened fake spells, see below how to handle quickened spells)
- add one metamagic activation (instant) feat for each metamagic (the feat. when activated, toggles the particular metamagic on/off for the next casting)
- change the spellhook (and the spell scripts), so that
    --- all spells go through the spellhook
    --- the spellhook checks the metamagic setting, looks for a valid spontaneous spell slot (or prepared spell) compatible with the metamagic setting
    --- continues the spell or aborts it (if a prepared caster cast a spell with a metamagic combination that he did not memorize)

As fluffy said, I have been developing such a system.

It was 90% finished (it worked in a test environment, however, a lot of 2da work still was left to do).
But then real life kicked in very hard (and the PRC website went down at approximately the same time), so I didn't have any time  to finish it.
Dont have any time now, either.

Basically the only major work I had to do (besides the always required bug-fixing during extended player testing) was to rewrite the java routines that are used to build the PRC fake spell 2da-entries (in feat.2da, spells.2da and iprp_feats.2da). In my test environment I had rebuilt the 2das by hand (for roughly 100 test spells), but in order to have the PRC make process work automatically, the java routines definitely have to be modified. Started to rewrite them, but then RL came in the way.

Here are the features that are working:

- multiple metmagics, including the [not to easy to implement] quicken, silent and still for spont and prep casters (100& tested)
- new metamagics, such as heighten, lasting, permanent, delay, repeat, twin, energy substitution, energy admixture, etc. (100% tested)
- improved spell-capacity, improved metamagic and multispell feats implemented (90% tested)

All necessary includes were up and running. Also all spell scripts were appropriately modified to accept all Bioware and the additional metamagics (except for some "newer" spells scripts mostly added by Tenjac in the last year).

If you are interested, I can send you the stuff. As I said, I currently dont have the time to finish it off, but I would be willing to help, if you are willing to look into it more deeply.


Quote

I wanted to include changes allowing quicken to function, but for some reason the game engine was ignoring the metamagic flag at casting.


That is a known limitation of the Bioware provided ActionCastSpellAt* () functions, not only for quicken, but also for silent and still. Another limitation of these functions is, that they don't accept metamagic as a parameter if the cheat-parameter is used. But there are workarounds:
For instance, the way to implement quicken (+still + silent) is to give the caster the autoquicken, autosilent, autostill feat before the fake spell fires. It can be done by an extensive rewrite of the PRC-function ActionCastSpell() in combination with the spellhook. Now, there are some tricky timing issues involved and there is the potential of exploits; however both problems can be handled by - rather extensive - coding and additional checks for exploits.

The advantage of a new metamagic system are (besides the possibility to use multiple metamagics as in Pnp):

- the nr of fake spell entries is dramatically reduced (just one fake spell entry for every "real" spell instead of one entry for every metmagic version)
- the class radial gets a lot less entries
- additional metamagics can be easily added
- new feats, such as improved spell capacity, improved metamagic, multispell etc. are possible, behaving (almost) exactly as the PnP rules

The disadvantages are (obviously)
- extensive rewrite of the includes necessary (not only the x2_inc_spellhook must be changed)
- new java routines necessary for the new fake spell structure (although the new structure is simpler than the old, the routines still have to be written and tested)
- the prc make routine must be changed to reflect the above changes
- some players might not like the process of selecting the metamagic first (by activating the appropriate metamagic feats) and then casting the spell (by activating the spell casting feat). Although once the system is in place, it is fairly easy to customize it, for instance by giving each caster say ~100 customizable feats where they can prepare often used metamagic variants for their spells)

motu99


September 28, 2009, 04:35:50 PM
Reply #25
  • Jr. Associate
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile

Wow! I didn't expect such a detailed response. :)

Quote from: motu99

- some players might not like the process of selecting the metamagic first (by activating the appropriate metamagic feats) and then casting the spell (by activating the spell casting feat). Although once the system is in place, it is fairly easy to customize it, for instance by giving each caster say ~100 customizable feats where they can prepare often used metamagic variants for their spells)

This was exactly the concern I had with adding metamagic abilities for prepared casters. Activating the feats feels natural to a spontaneous caster, but not at all for a prepared one (not to mention, they would literally be required to memorize all their metamagic variants).

Giving bonus customizable feats is a brilliant idea! I would still however be troubled about user-friendliness, i.e., the feats missing a name/icon.

The only other idea I could come up with was to give the player some sort of spellbook container, with activatable memorized/known spell "pages" stored inside. It's still ugly though.

Quote from: motu99

That is a known limitation of the Bioware provided ActionCastSpellAt* () functions, not only for quicken, but also for silent and still. Another limitation of these functions is, that they don't accept metamagic as a parameter if the cheat-parameter is used. But there are workarounds:
For instance, the way to implement quicken (+still + silent) is to give the caster the autoquicken, autosilent, autostill feat before the fake spell fires. It can be done by an extensive rewrite of the PRC-function ActionCastSpell() in combination with the spellhook. Now, there are some tricky timing issues involved and there is the potential of exploits; however both problems can be handled by - rather extensive - coding and additional checks for exploits.

I wish I had known of this sooner! Thank you. Actually, another one of my concerns with making fake spells instant-cast was that (as far as I know) there's no way to determine when a new round starts. How would you accurately implement the "only one quickened spell may be cast per round" restriction? Is that handled automatically by the casting functions?


Thanks again for the in-depth reply. If you would like to send out the work you have I would be interested at the very least. I can't guarantee I'll look at it anytime soon. I was finally getting excited about moving on to another project!


September 29, 2009, 02:12:57 AM
Reply #26
  • Adept
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile

Quote from: N-S

Activating the feats feels natural to a spontaneous caster, but not at all for a prepared one (not to mention, they would literally be required to memorize all their metamagic variants).


Wouldn't the nr of variants they'd have to memorize be limited by the nr of spell slots they possess?

Quote

Giving bonus customizable feats is a brilliant idea! I would still however be troubled about user-friendliness, i.e., the feats missing a name/icon.


Thats exactly the problem. Now renaming feats in-game would be an elegant solution. But, as far as I know, it doesn't work for NWN running under Windows. It might work for Linux with the nwnx-func plugin from acaos, but then I wonder how it would function in multiplayer... [renaming feats would affect all players].

Quote

Actually, another one of my concerns with making fake spells instant-cast was that (as far as I know) there's no way to determine when a new round starts. How would you accurately implement the "only one quickened spell may be cast per round" restriction? Is that handled automatically by the casting functions?


The trick is to make the feats instant, but then to cast the spells normally, e.g. with the instant flag set to FALSE. Then the spells will go into the action queue and the engine will handle the timing. So it will work exactly as if you had cast a quickened spell from the Bioware spellbook.

Once the spells are in the action queue, the trick is to do the necessary setup & cleanup, so that quicken, silent, still work and the metamagic parameter is properly passed to the spell script (or rather the spellhook). The trick is to insert a Pre-Spell Action and a Post-Spell Action into the action queue before and after the spell cast action. The Pre-Spell Action fires just before the spell action, and it checks whether its associated spell (to come) was cast with any of the three "problemematic" metamagics (quicken, still, silent). In that case it applies the appropriate auto-feats. The post-spell action fires after the spell action has been completed, and it does some cleanup, such as stripping the auto-feats off again. That is the general idea, a working implementation follows these guidelines, but must be slightly different because of some tricky timing issues... (sometimes the pre-spell action of the next spell in the queue fires BEFORE the post spell action of its predecessor)

Quote

If you would like to send out the work you have I would be interested at the very least. I can't guarantee I'll look at it anytime soon.


No problem. Thats the case with most of us. Just PM me your Email.


September 29, 2009, 01:47:35 PM
Reply #27
  • Jr. Associate
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile

Quote from: motu99

Quote from: N-S

Activating the feats feels natural to a spontaneous caster, but not at all for a prepared one (not to mention, they would literally be required to memorize all their metamagic variants).


Wouldn't the nr of variants they'd have to memorize be limited by the nr of spell slots they possess?

I just meant that unlike a spontaneous caster they would need to keep a running track of metamagicked spells in their head. A 40-int wizard would have 64 slots, before a modified int score and spell slot bonuses. It could get really annoying.

It's what the bonus feats idea aims to accomplish. It would still mainly only be for PW's though (if you went the renaming route). I don't think most people use nwnx in single player.

I still hesitate though. It's what I meant by "fundamentally flawed." It's absolutely great for spontaneous casters, but can actually hinder prepared ones.

Maybe a middle ground solution would be to keep the current system (with the single-metamagic spell feats), but simply allow prepared casters to use the metamagic ability feats.

Quote from: motu99
Quote

Actually, another one of my concerns with making fake spells instant-cast was that (as far as I know) there's no way to determine when a new round starts. How would you accurately implement the "only one quickened spell may be cast per round" restriction? Is that handled automatically by the casting functions?

The trick is to make the feats instant, but then to cast the spells normally, e.g. with the instant flag set to FALSE. Then the spells will go into the action queue and the engine will handle the timing. So it will work exactly as if you had cast a quickened spell from the Bioware spellbook.

Oh, I see. That's what I did, I was just worried that by calling the cast functions directly it would avoid the limitation and let someone cast a quickened spell 3 times per round.


Again thanks for taking the time. Maybe I will have the time/motivation to do something next month. If your main obstacle was really only the 2da's and you would like to complete the project I might be able to help with that sooner. I can throw out a 2da-rewriter in no time. (I already turned all the feats into instant-cast from before.)


September 30, 2009, 09:05:17 AM
Reply #28

The reason the 2das are so much work is that the generator does all the spellcaster spellbooks from scratch, populates feats, iprp_feat, spells, generates most of the tlk entries and then is used as part of the basis to build the scrolls. It also has the potential to screw up the manual generator as well. Motu redid the 2da cache as well to deal with the changes he was making, which would be needed as well. It is not trivial.

Much of the PRC is auto-generated and breaking the system would break pretty much the entire PRC. Which means that, unlike most things in the PRC, it would need so much testing :(


September 30, 2009, 09:29:20 AM
Reply #29
  • Jr. Associate
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile

I haven't looked at the Java routines (and I won't, disgusting language) but it would only take a single regex line to strip out all the redundant spell feats. tlk is another matter, but then again, not something an expression can't automatically match.