September 08 2010 11:14:58
Users Online
Guests Online: 2

Members Online: 0

Total Members: 548
Newest Member: fokl
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Member Poll
Who should our first Dragon Age class be for?







You must login to vote.
Player Resource Consortium » Neverwinter Nights » Spells, Feats, and Skills
Selectable metamagic for spontaneous casters?
Username
Password
Register FAQ Members List Today's Posts Search

Print Thread

  Selectable metamagic for spontaneous casters?
by: N-S, 24-09-2009 01:19 AM (#21)

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.
N-S
General Member
Member

Posts: 62
Joined: 16.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: fluffyamoeba, 24-09-2009 08:38 AM (#22)

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.
User Avatar
fluffyamoeba

Super Administrator

Posts: 81
Joined: 03.06.09

RE: Selectable metamagic for spontaneous casters?
by: N-S, 24-09-2009 10:06 AM (#23)

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.
N-S
General Member
Member

Posts: 62
Joined: 16.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: N-S, 28-09-2009 04:00 AM (#24)

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.
Download source  Code
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)


N-S
General Member
Member

Posts: 62
Joined: 16.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: motu99, 28-09-2009 03:49 PM (#25)

N-S wrote:
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.



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
motu99
General Member
Member

Posts: 7
Joined: 28.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: N-S, 28-09-2009 04:35 PM (#26)

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

motu99 wrote:
- 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.

motu99 wrote:
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!
N-S
General Member
Member

Posts: 62
Joined: 16.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: motu99, 29-09-2009 02:12 AM (#27)

N-S wrote:
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?


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].


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)


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.
motu99
General Member
Member

Posts: 7
Joined: 28.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: N-S, 29-09-2009 01:47 PM (#28)

motu99 wrote:
N-S wrote:
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.

motu99 wrote:

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.)
N-S
General Member
Member

Posts: 62
Joined: 16.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: fluffyamoeba, 30-09-2009 09:05 AM (#29)

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 Sad
User Avatar
fluffyamoeba

Super Administrator

Posts: 81
Joined: 03.06.09

RE: Selectable metamagic for spontaneous casters?
by: N-S, 30-09-2009 09:29 AM (#30)

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.
N-S
General Member
Member

Posts: 62
Joined: 16.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: motu99, 04-10-2009 06:15 AM (#31)

Fluffy is right, as usual.

A new spellcasting system, that reorganizes the spellbook-related 2das, requires a lot more work "under the hood",
than the - relatively straightforward, but tedious - rewriting of the spell-related includes and the spell scripts.

In particular, it is essential that the PRCs automated make process must be functional all the time (one does not
need Stra'ts occasional reprimand to understand that). The PRC make process is not easy to understand. For
instance, the make file is auto-generated, relying on a complex interplay of external programs to auto-generate
the make file. One essential ingredient to that process are several java routines, that extract information from
the source files (*.nss), use it to generate the make-file, and also build the spellbook-related 2das (spells.2da,
feat.2da, iprp_feat.2da), the tlk- entries, and even the manual from a set of "base" 2das. These java routines have
to be partially rewritten, and one has to have a pretty good understanding of the *whole* make process in order to
minimize unwanted side-effects (such as the manual generator screwing up - Fluffy knows about that Wink ).

Without implementing these changes (and properly testing them before updating the PRC's CVS) multiple metamagics
will remain a private project, only. That has been clear to me from the beginning, however, I must admit that I somewhat
underestimated the "additional" work that must be done within the PRC make process.
motu99
General Member
Member

Posts: 7
Joined: 28.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: N-S, 05-10-2009 10:04 PM (#32)

I wasn't trying to suggest how to run things, just remarking on how bad that setup seems to be. Java is the last language I'd choose for a build system due to its inherent verbosity. But why change what already works?

Anyway, about the metamagic stuff. Unless you guys decide that you're OK with spontaneous users being given a significant advantage over prepared casters I can't ever see metamagic combining adopted. It just serves to further break what's already broken (feat-based casting system, to a feat-based casting system with no icons or text for spells).

Doing a container-scroll system like I brought up earlier is probably the only way it could work in a friendly way. One book for each spellcasting class, with custom spell "pages" assigned for each spell variant. It still has its disadvantages: item based, and a little unintuitive.

But until then, I'll be happy to play in singleplayer with my uber sorcerers. Unlike multiplayer it doesn't matter if I'm overpowered.
N-S
General Member
Member

Posts: 62
Joined: 16.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: xwarren, 06-12-2009 02:06 PM (#33)

Edited the build process to generate single spell-feats for spontaneous casters that would work with selectable metamagic feats.

I don't intend to add combined metamagics at this stage (although combining metamagic and sudden metamagic would be nice).

We'll see how it works Wink
User Avatar
xwarren
PRC Staff

Notice: Undefined variable: locale in /f5/nwnprc/public/infusions/fusionboard4/includes/func.php on line 788


Posts: 503
Joined: 05.06.09
Location: Poland
Age: 26

RE: Selectable metamagic for spontaneous casters?
by: motu99, 07-12-2009 03:10 PM (#34)

Nice!
motu99
General Member
Member

Posts: 7
Joined: 28.09.09

Warn Level 0

RE: Selectable metamagic for spontaneous casters?
by: xwarren, 03-01-2010 10:55 AM (#35)

Well... I've analyzed the code N-S send to me, read motu99's hints, and wrote the code with some improvements.

Everything seems to work fine Smile although it's not perfect yet. I have made spell-feats to be instant cast (no action required) but in consequence spell use is decreased when I start casting (was decreased at the end of the casting - which was wrong anyway ;p ) I'll think of a way to fix this.

Combining sudden and normal metamagic should work as well (need to test that).

So... More testing Wink
User Avatar
xwarren
PRC Staff

Notice: Undefined variable: locale in /f5/nwnprc/public/infusions/fusionboard4/includes/func.php on line 788


Posts: 503
Joined: 05.06.09
Location: Poland
Age: 26

RE: Selectable metamagic for spontaneous casters?
by: xwarren, 29-01-2010 07:33 AM (#36)

Sorry it took so long.

Here is the test PRC build with selectable metamagics for spont casters:
http://www.easy-s...h_TEST.rar

It's not revolutionary but IMHO there are some improvements over the old system.

Features:
  • single spell-feats for spontaneous casters
  • normal & sudden metamagic combining (works with sudden & sudden too)
  • almost perfect quicken metamagic (thanks Motu99)
  • spell use decreased from spellhook
  • ...


Please test it and tell me what you think (is it worthy to be included in PRC?)
 
Edited by xwarren 29-01-2010 07:43 AM
User Avatar
xwarren
PRC Staff

Notice: Undefined variable: locale in /f5/nwnprc/public/infusions/fusionboard4/includes/func.php on line 788


Posts: 503
Joined: 05.06.09
Location: Poland
Age: 26

Options
Jump to Forum:
Forum powered by fusionBoard
Share this Thread
URL:
BBcode:
HTML:

281,975 unique visits

Powered by PHP-Fusion copyright © 2002 - 2010 by Nick Jones.
Released as free software without warranties under GNU Affero GPL v3.
Warhammer-theme is a modification of Simplicity_div.
Modified by Wolphard.
Special thanks to Mangee.