You are here

Spellbook rework

77 posts / 0 new
Last post
Rasael
Spellbook rework

I've been working on class custom spell books the last day. What I was able to come up with surpassed my expectations.

I have replaced the game's default slot system with a custom spell book (for all classes), using virtual slots. This means you will no longer lose slots on login or when you shapeshift / polymorph. We do away with the default system all together. It has the added benefit that we now no longer have any spell's related crashes (too many spells known), or metamagic limits. We can add new metamagics, like heighten spell; Let you combine them on a single spell even. And you can memorize Epic spells and use metamagic with them. Instead of 9 there are now 12 spell levels.

With it we can also very easily set the spells a character knows and memorized via script this way. Not to mention all the game's hardcode limits. You can create feats to let a warlock learn an extra [y] level spell for example. Or create classes with their own actual spell books.

See the attachment for my proof of concept. You can see its for both the Cleric and Pious Templar classes in this case. It also displays a tooltip if you hover over the spell in the quickcast menu, and you can right click in either the spell book or quickcast UI's to get a spell description. (examine) The casting also works, though I still have to add a UI for selecting sub spells. (if a spell has multiple sub spells you can choose from, like Prot v. Alignment). Which is where we'd circumvent another hardcode limit. You could have an indefinite number of sub spells to a spell. Not just the current five.

Ofcourse this is only a proof of concept. I haven't made the spell lists for other classes yet and so forth. And the project can still be scuppered in case an un unforeseen engine limit turns up. But so far the most important parts work. Any thoughts or complications you think I might run into??

I am very excited about this project. :D

Attachments: 
  • up
    50%
  • down
    50%
Rasael

Yes I am certain now that this project will work. The proof of concept version works as a spell system. It also lets us choose targets conveniently, which was an essential step. It even lets us be more flexible in target selection than the engine allows currently. (by default can't have custom spells which target both hostiles & friendlies: but with this system you can) I also added an examine window for the spells. So you can see the descriptions.

 

Picture:

 

  • up
    50%
  • down
    50%
Rasael

I've done some more development (and steam flash sale purchases.

After these developments I am now dead certain this project will succeed. I've found a way to make the quickcast UI work with the custom spellbook and custom classes. The Quickcast UI turned out to be the biggest challenge. Without it the entire system would be mostly useless because it'd be so inconvenient for actual gameplay. But now that its working its doing really well.

Once I finish it only comparatively minor projects remain to finish the custom spellslot system. I need to add a UI which lets you level up your known spells, and a rest mechanic to switch memorized spells to being ready.

I also need to decide if I want to code in support for allowing multiple metamagics being used on a single spell. But I am estimating this could be easily added later on still.

I will try to compile a short feature list of the system:
-Complete control of the spell list for a class via script (add conditions, like variables, or deities)
-Supports Custom spellcasting classes as well as default game ones, spellbooks for everyone you'd care to make one for.
-Supports an infinite amount of new metamagic feats for any and all classes you'd care to give access to them (think: Heighten)
-Supports multiple metamagics being applied on a single spell
-Instead of 9 spell levels it supports 12 levels
-Allows memorization and casting of Epic spells instead of as feats
-Lets you create feats which let you learn additional spells (warlock, sorcerer etc.)
-Lets you create feats which give you additional spells per day for a spelllevel (takable multiple times instead of once)
-Domains become fully scripted like spell lists. You can make feats which add a domain to a Cleric. Or make a Domain Wizard class. (D&D)
-Full control of casterlevel & spell DC
-Full control of spell targeting (hostiles & friendlies both now possible)
-More

  • up
    50%
  • down
    50%
Rasael

Another development log update for anyone interested.

I've now gotten the custom spellbooks fully working with the Quickcast UI. I'm testing if all the classes are working and if all features are okay. While working this I've also managed to test if the casterlevels and DCs are being treated properly. Which they are, fortunately. No work needed in that department.

Once I progress to testing classes which learn new spells I'll code a mechanic to support that into the spellbook. But that should be peanuts compared with what's already been achieved. Mostly code re-use.

I'd post a screenshot but this forum is oncooperative. It considers them spam unless I use the HTML format which doesn't work well. 

 

  • up
    50%
  • down
    50%
kamal

Very interesting, and revolutionary if further testing shows it allows custom spellcasting classes without any issues. You might want to post on the official boards. More people still read those than this.

  • up
    50%
  • down
    50%
Rasael

Thanks Kamal :)

I have progressed further in the intervals I've had to work on the project. The spell learning UI is now also almost done. When that is finished the project is as good as complete. I will ask some people to put it through its paces for bugs and gameplay issues. And then we can see how it holds up.

But so far it looks really good in my playtesting. It opens up a whole new avenue for custom content classes and spells, as well as new metamagics. I am definetly going to put in Heighten spell (metamagic) before releasing it for testing.

  • up
    50%
  • down
    50%
Rasael

More progress: I've also gotten the spells known window to function properly with the system. Along with spellswapping and everything.
I also added the ability to level up in one go for multiple casterlevels. Like from 1 to 5 without having to enter the levelup screen 5 times.
To help with that I added a neat summary window, which presents an overview of all you've picked. Once you press finish the spells properly show up in your spellbook and are castable after you rest via the quick cast UI.

I'm probably going to redo the quickcast UI so that it shows metamagic spells next to regular ones. So that you don't need to press clumsy buttons to switch. Which costs time and is inconvenient in my experience. The spells with metamagic are clearly marked. I've already got it working apart from a few cosmetic tweaks.

http://neverwintervault.org/sites/neverwintervault.org/files/u1248/2014-...

  • up
    50%
  • down
    50%
Rasael

The replacement spell system has now entered beta testing, Huzah! :)

  • up
    50%
  • down
    50%
Loki_999
Loki_999's picture

Good stuff. Have often given thought to adding custom spellbooks and realized it might be possible using the existing system, but much better just to strip it all out and replace.... of course, a monster task which i was never prepared to take on.

So kudos for the effort you must have put into this!

  • up
    50%
  • down
    50%
Rasael

Good stuff. Have often given thought to adding custom spellbooks and realized it might be possible using the existing system, but much better just to strip it all out and replace.... of course, a monster task which i was never prepared to take on.

So kudos for the effort you must have put into this!

Yea, half of it is theory - trying to think how it might work. And the other half is actually testing it because it sometimes turns out to work differently. :O

Thanks! Its been a challenging project :)

 

Working on this again now because I have a small break. :)

 

- Radial spells are now supported. Radial expanded to support more than 5 choices.

- Got rid of some lagginess / slugish UI.

- Added Blackguard spellbook

- Further testing in progress, looks promising

 

  • up
    50%
  • down
    50%
Rasael

The system now also supports memorizing lower level spells in higher level slots. (minor cure on level 2 slot, or a fireball in a level 9 slot)

The UI is working nearly flawlessly.

I still need to spend some time on Spontaneous casters and how best to let them use lower spells in higher level slots. And adding Heighten metamagic.

 

  • up
    50%
  • down
    50%
Rasael

More progress. The project is now essentially a success. The Blackguard spellbook is working really well in internal testing. The amount of control over the spellbooks, spell lists, metamagic and targeting code is unparralled. I've added Heighten spell (metamagic).

I have asked our staff and DM team to take stock and see where we want to take this. The system supports the possiblity of memorizing epic spells for example. It is in any case quite likely we will tie some spells to possession of particular classes, feats, or characteristics. For example that you might learn / memorize certain spells from a deity, but not others that he forebids. Or classes which let you lear spells from other class lists. And so on. Not to mention having custom spellbooks for custom classes.

  • up
    50%
  • down
    50%
Rasael

Assassin spellbook now also included, as well more bugfixes. Progress continues :)

  • up
    50%
  • down
    50%
colorsfade

First time seeing this thread; looks really interesting. I'm going to keep an eye on this... 

My campaign: The Darkening Sky (Nexus) (Vault)

Guide to the MoTB Wandering Monster & Rest System

  • up
    50%
  • down
    50%
Rasael

Thank you Colorsfade that is nice to hear :)

 

More work done:

-All classes are now supported, except for the Warlock. Including Blackguards, Assassins and the Pious Templar.

-The spells are usable via the hotbar, very important online.

-Spell level is now correctly calculated, including for heigthened spells.

-Spell level is not affected if you memorize a lower level spell on a higher spell level, so the DC isn't affected unless you get Heighten metamagic.

-Spontaneous casters now get an overlay menu for their metamagic choices

-Spontaneous spell conversion now also implemented.

 

To do:

- Warlock spellbook (might be a tad complicated with all the metamagic)

- Arcane spell failure (this will be easy)

  • up
    50%
  • down
    50%
Rasael

- Implemented the Warlock

- Implemented spell scribing into spell book from scrolls, for wizards

- And implemented Arcane spell failure for bards, wizards, sorcerers, and warlocks.

Its all working so far. I've made it so that you can choose lower level invocations like a wizard can learn lower level spells on levelup. One of the Dungeon masters said that was the way it works in PnP, and that it would be a good idea.

 

To do:

- Refining code for the targeting overlay selection

- Coding the spell switching mechanic for spontaenous casters, to determine which and how many spells they may switch when leveling up.

 

  • up
    50%
  • down
    50%
Rasael

-Verified that hotbarred spellslots work quickly in combat (tested & verified, no round loss)
-Verified that Warlock abilities and essence work (tested & verified, very cool).

-Added Spell Swapping code for spontaneous casters, as per NWN2 rules.
-Change: Swapping progression now counts until level 30 (e.g. levels 20, 22, 24 etc.)
-Change: Spirit Shamans have a one in twenty-five chance upon opening their spell's known of receiving a free spell exchange, one spell per spell level. Only possible once per reset (online). This is because according to D&D they can always exchange their spells by communing with spirits. I think I will leave out this limitation for offline play. Or perhaps think of something better to trigger this. 

-Added red text color for when metamagic is selected during memorization (Eclypticon's idea)
-Also added red text color on the quickcast spell menu, for when it is enabled.
 

  • up
    50%
  • down
    50%
Rasael


- All Spell Lists: fixed wrongly referenced spell entries for the custom Kaedrin package spells.
- All Spell Lists: removed spells that BGTSCC doesn't have and other mistakes.
- Clerics must now memorize one domain spell on a given spell level, if that level has a domain spell available.
- Specialist Wizards must now memorize a specialist school spell every spell level.
- Verified that spell swapping appears to be working right.

 

We're now moving towards a live test of the system :)

  • up
    50%
  • down
    50%
Rasael

Further progress, the system is now essentially feature complete. 

I am however considering adding a number of other features, including new metamagics. (besides heighten, which is in already) In particular reach spell, sacred spell, corrupted spell, and rapid spell. Perhaps also some Elementalist metamagic like Blazing spell and Numbing spell. Apart from that I'm also considering throwing together the Archivist base class. It shouldn't be much of a challenge now that the spell books are done. Just copy the Cleric book and write a small feature that allows it to learn spells from the druidic / ranger / paladin lists as well, via scrolls.

The Blackguard spell list is working well. I've added four more custom spells to it, and the Assassin list has also received another custom one.  

We've also assembled a small testing team in the months prior to run it through its paces in multiplayer. Sorry for the people we have to turn down, your offers were appreciated but working with too many people means no work will get done. :)

The early testing results are looking very bright!

  • up
    50%
  • down
    50%
Rasael

Another small update,

I've added the Archivist class with its ability to learn all divine spells from scrolls and other items. This includes druidic, ranger and paladin spells, but not arcane spells.

I was also able to add Reach metamagic, so that you can transform touch spells to spells usable at range. Like casting cure or inflict spells from a distance. :)

And several bugfixes for issues reported by our testing crew :)

 

  • up
    50%
  • down
    50%
enemys

This whole thing looks just great. I've found some way to create custom spontaneous spellcasters without rewriting the whole magic system, but I haven't completed any classes yet, and the workaround I found is ugly and a bit buggy. Your work, however, seems to be a complex and painless (at least painless for users) solution.  Are you going to release it for multiplayer use outside your PW when it's ready? I think it would be a huge added value to the whole game. And you would be like a superhero to the whole community :>.

BTW: Does this system require modyfing spell scripts, or can it work without any specific scripting applied to a spell? I suppose that custom metamagics force changing the spell to make use of it, but I'm wondering, if the other stuff (learning/swapping/memorizing spells, stacking metamagics, creating custom spell lists) can do without it?

Also, I see you've introduced a way to swap shaman spells outside the levelups. Have you considered adding the PnP casting rules for shamans? In PnP they can choose spells each day like wizards (they need to prepare metamagic-modyfied spells, for example), but they later cast them spontaneously like sorcerers (except they can't apply metamagics on the fly). I think that such a feature, even if optional, would be a cool thing and it would really make playing spirit shaman different and more interesting.

  • up
    50%
  • down
    50%
Sir Adril
Sir Adril's picture

Also, I see you've introduced a way to swap shaman spells outside the levelups. Have you considered adding the PnP casting rules for shamans? In PnP they can choose spells each day like wizards (they need to prepare metamagic-modyfied spells, for example), but they later cast them spontaneously like sorcerers (except they can't apply metamagics on the fly). I think that such a feature, even if optional, would be a cool thing and it would really make playing spirit shaman different and more interesting.

That would be really neat.

  • up
    50%
  • down
    50%
Rasael

Hello enemys and Sir Adril, thank you for responses and questions. :)

"Are you going to release it for multiplayer use outside your PW when it's ready? I think it would be a huge added value to the whole game. And you would be like a superhero to the whole community :>."

I intend to release spellbook rework for the entire NWN2 community. I am on staff for custom content development at BGTSCC but my role there is more akin to a developer than an administrator or owner. I simply enjoy developing things, and seeing other people enjoy them. I also wouldn't have created this topic if the project was purely for BGTSCC. 

When I release it I intend only to add a standard dev licence / notice so that the user shares any improvements or fixes he comes up with, and credits me as the developer, for my work developing the system. That's all.

A lot of the content on BGTSCC is / was publically available on the NWN2 vault, and we always give credit to other developers for their content. There's a load of loading screens, posts,  wiki entries, and comments by in-game monsters which do that. We believe very strongly in crediting people. Sharing improvements will also help the community as whole, since this project could be a big step forward in custom content development for spells, metamagic, and caster classes. :)

"Does this system require modyfing spell scripts, or can it work without any specific scripting applied to a spell?"

The spellbook rework does not require modified spell scripts. Features like Heighten spell and the other metamagic won't work without it however. Reach metamagic will work without modifying the spellscripts. So it depends on the features you want but for the most of it its not necessary. 

"Have you considered adding the PnP casting rules for shamans? In PnP they can choose spells each day like wizards (they need to prepare metamagic-modyfied spells, for example), but they later cast them spontaneously like sorcerers (except they can't apply metamagics on the fly)."

I hadn't! I wasn't aware Shamans worked that way in PnP. I'm glad you brought it up. I will try to make it work that way. :)  

[Edit:] It now works that way!

  • up
    50%
  • down
    50%
Rasael

Spirit Shaman now memorizes spells and metamagic:


And I have also implemented a casting time system. Specified spells that have a longer casting time than one round are now automatically queued multiple times, and each casting gives a progress update. (e.g. Planar Ally 25%) or (Planar Ally Completed). When the last queued spell is cast the entire spell is completed and triggers. It looks quite neat and its a great way to balance powerful spells without nerfing their effects. The list and casting time can be adjusted by script.

 

And I have gotten around to condensing the spell icons in the quickcast menu so that identical spells overlap / are subsumed under a single icon. One of our testers felt it was a bit cluttered if we represent every individual memorized spell seperately.

  • up
    50%
  • down
    50%
enemys

Woah, it gets better every time I look at it. Longer casting times is something that I missed in NWN2 - it might be a great balancing factor for many spells.

When I release it I intend only to add a standard dev licence / notice so that the user shares any improvements or fixes he comes up with, and credits me as the developer, for my work developing the system. That's all.

That's great to hear! It would be great to see this modification on the PW I play and work on. I'll be watching you... I mean your progress on this project :P.

The spellbook rework does not require modified spell scripts. Features like Heighten spell and the other metamagic won't work without it however. Reach metamagic will work without modifying the spellscripts. So it depends on the features you want but for the most of it its not necessary.

Are you going to provide some guide or scheme about modifying spells to make use of the script-dependent features? PWs usually use some spell modifications, either their own or ones provided by someone else. I know I might be asking about things like that too early, since you're still testing and modifying the whole system, I'm just curious, because I got super-excited about this mod and I already started thinking what custom content would be possible with it :).

It's cool to see that you used my suggestion about shamans. Have you thought about the number of their memorized-spells slots they should have in this variant, though? In PnP, they get a very limited amount of slots, only up to 3 of each spell level (on 20th class level: 3 slots of every spell level). While I think that limiting them to such amount might be a bit too drastic for players that got used to the shaman class, letting shamans memorize as many spells as now and change them every rest while they still cast them spontaneuosly gives them just too much fluff. Of course this is only an issue for SP version, as I suppose that someone using your mod on a PW will be able to balance the number of slots easily.

I've also got some other questions and ideas for you to consider:

1. Are metamagic-related feats like sudden metamagic, metamagic song, talfirian song, divine metamagic, practical metamagic, metamagic school focus etc. possible? The first one lets you apply a metamagic effect to any prepared/known spell without using a higher level slot once a day, the following two let you burn bard's songs uses for each extra level imposed by the metamagic feat instead of using a higher level slot, the next one works the same, but uses turn undead uses, while the last one lets you reduce the cost of metamagic applied to spells of one spellschool three times per day. I'd just link their descriptions here, but I'm not sure, if it's permitted. You can easily find the feats' descriptions online though.

2. Would it be possible to add a versatile spellcaster feat? It lets spontaneous spellcasters use two slots of the same level to cast one spell one-level higher - for example, a sorcerer with this feat could cast fireball using two 2nd level slots instead of one 3rd level slot.

3. What are the possibilites of changing spell-related variables and stats? I've actually got a whole lot of questions about this - that's because I'm really curious about possibilities and limitations of this system. Don't panic, I'm not asking you to make these, I'm just wondering :).

For example, would it be possible to create a feat that gives a bard additional spells known, but forces them to have Int or Wis 10+spell level to cast spells (kinda like bardic sage or divine bard from PnP)? Or a spell/feat/class feature, that lets you memorize your wizard spells in cleric or ranger (or any other) slots? Is progressing caster level without progressing spells per day/spells known (like Sublime Chord's caster level increase in former spellcasting classes) possible? Could one change the kind of spells (arcane vs divine)  of a class on the go, without modifying classes.2da? Or create an arcane disciple feat, which gives an arcane spellcaster access to single domain's spells, but makes him use wisdom as a spellcasting attribute for these spells? Finally, is temporary or permanent caster level change with things like class features, bardic songs, spells or feats easily possible, or would it require rewritting each spell separately (I know that pure NWN2 uses hardcoded CL handling)?

4. Is creating new warlock blast shapes and essences possible with this system? I know that it allows new metamagics, but warlock's blasts work a bit different, at least it seems so. I've never scripted anything related to them, so I'm not sure.

Keep up the good work!

  • up
    50%
  • down
    50%
Rasael

enemys, thank you for your entheusiasm and the many questions :)

I don't have the time to answer them as thoroughly as they deserve but I will try to adress the underlying themes.

Are you going to provide some guide or scheme about modifying spells to make use of the script-dependent features? PWs usually use some spell modifications, either their own or ones provided by someone else. I know I might be asking about things like that too early, since you're still testing and modifying the whole system, I'm just curious, because I got super-excited about this mod and I already started thinking what custom content would be possible with it :).

I hadn't put any thought into this . For BGTSCC I developed a framework which lets us customize practically all variables in all spell scripts. And I rewrote spell resistance, spell effect ID's, the dispel code (hasn't gone live yet, but it fixes the character level vs casterlevel issue), and effect appliance (don't apply damage to friendly targets). I will have to think about, and ask a few people. I imagine that most persistent worlds have their own code already though. And its not a good idea to to mess with spell scripts because of conflitcts in singleplayer modules, which sometimes change spell code for their story purposes. So I'm leaning to releasing a default version without a framework attached, and then perhaps an optional extra download for developers.

It's cool to see that you used my suggestion about shamans. Have you thought about the number of their memorized-spells slots they should have in this variant, though?

Well spotted! bonus spells slots were being applied. I've fixed that now, just a few lines of code in the wrong place. Its now as in PnP.

(My abbreviation) What is possible, what does this system support, how easy is it to adapt it for your own purposes?

In essence the system supports an infinite amount of new metamagic and spells, as well as feats which interact with spells or the spellbook, or metamagic. On BGTSCC I've developed a feat which does sacrifice Turn undead uses in exchange for a casterlevel increase. Its called Divine Spell Power. But its a feat, not an actual metamagic. I also developed Blood Magic, Circle Magic and Shadow Weave Magic casting modes. Practical metamagic would work like those feats I imagine.

New metamagic depends on what you want it to do, and how far you're willing to go. Not all variables can be easily manipulated. Like damage, damage caps and damage types. Those are things which aren't variables in the regular spell scripts. You'd need to filter through them and change each one manually to suit your metamagic. If your metamagic only affects a limited number of spells (10 to 20) then its no big deal to do that though. That's about the only limit I can think of. 

So yes, you can make new blast shapes. You can make them quite easily. Just like any other metamagic in this system. Its all done by script, and you can build from the examples included. If I have time I'll try to add more thorough documentation. I developed the custom spell slot / spellbook rework system to be very modular and flexible. I also wrote it for efficiency. So I avoided constant 2da file lookups. As a byproduct of that everything is script driven. The types of metamagic that are available, the spell lists, the spells per day, the spell slots, bonus spell slots and so on.

Right now it does appear to be less demanding than the default spellbook UI. Which is kind of strange. It is also good that the spellbook rework removes the limit of 255 spells known, or the game / entire server would crash. Now I can continue my hobby of spell development without having to worry.

  • up
    50%
  • down
    50%
Rasael

This project appears to be mostly complete now. I still need to write several functions to replace GetKnowsSpell(), GetHasSpell(), and DecrementSpell() though. And then live testing to see how it holds up in a multiplayer environment. What also still needs to be finished are Sacred and Corrupted metamagic. We're still discussing internally which effects should be attached.

 

The spell casting appears to work flawlessly though. :)

  • up
    50%
  • down
    50%
Rasael

Our testers are going to conduct a live multiplayer test tonight. Results will follow soon :)

  • up
    50%
  • down
    50%
Loki_999
Loki_999's picture

Amazing work.

Well, like others i have lots of question, but just one that is important.

Have you modifed lots of spell scripts to get this working? I ask because we have modified lots of spell scripts for things like sneak attacks on touch spells and other customizations.  So would i need to merge a lots of scripts to get them working with your system?

And wasn't aware you were doing it for BG... goddamn, how are we ever going to get top spot if you keep making things like this? Ha, well, just wait until you see what i have in store for enchanting and crafting next year! That will put you in your place! Pfft! :D

  • up
    50%
  • down
    50%
Rasael

Hello Loki :)

Have you modifed lots of spell scripts to get this working? I ask because we have modified lots of spell scripts for things like sneak attacks on touch spells and other customizations.  So would i need to merge a lots of scripts to get them working with your system?

No spell scripts were modified, its not necessary. enemys was asking the same. Its only necessary if you want the full package with heighten spell and other metamagics. Those do require spell script alterations.

And wasn't aware you were doing it for BG... goddamn, how are we ever going to get top spot if you keep making things like this? Ha, well, just wait until you see what i have in store for enchanting and crafting next year! That will put you in your place! Pfft! :D

Its not strictly BG. I am an associate Developer for BGTSCC but many of the projects I develop for them I also release seperately. I don't think its a competition. Most players on NWN2 play on multiple servers, so its a good thing if the game has a vibrant and evolving online community. That is also part of the reason I want to release this project. It has a lot of potential with custom content for caster classes and spells.

One important aspect for me is that I can now add more than 5 radial choices to a spell, and do so without changing the 2da, its works via script. The script part is the important bit. Because it enables you to add things like polymorph spells which incorporate the entire appearance.2da file, or a large selection thereof.  And the same thing with summoning spells. You could easily give players a menu of available summon choices and work out via script what happens with that choice.

If you had to add all that to the spells.2da it'd be an extremely ineffective and inefficient project to work on.

 

But lets not get a head of ourselves. This project is by no means a slam dunk yet. Its not done and we still have to do a multiplayer test. It got delayed.

  • up
    100%
  • down
    0%
Loki_999
Loki_999's picture

Cool beans.

  • up
    50%
  • down
    50%
Rasael

More progress, 

The multiplayer test hasn't happened yet but in the mean time I have made further code adjustments ran singleplayer tests. I particularly had to update some spell lists because of spells I forgot to include, and wrong spells.2da references. I've also sorted out all crashes related to the targeting UI code. Also some adjustments to the metamagic code, which spells can use metamagic, which cannot, which types. 

What I still have to do is write the effects for Corrupt and Sacred Spell (metamagic). And I want to test how the system works with the DM Client. I may need to make a few slight adaptions if it interferes. Because I want Dungeon Masters to retain their regular quickcast menu. [Edit] Good news, it doesn't interfere with the DM client :)

I also want to incorporate a mechanic that allows wizards to choose their opposition spell school, and then have that prevent you from learning new spells from that school. The code to choose opposition schools already works and is tested thoroughly. I just need to add the part where it influences learnable spells. Should be trivial but I just thought of it. :)

 

  • up
    100%
  • down
    0%
Rasael

The prototype now includes Sacred Spell:

Type of Feat: [Metamagic]
Prerequisites: Spell Level 1, Cleric 6
Specifics: This feat adds the good descriptor to one damaging spell you can cast. If the spell deals damage, half of the damage is holy divine damage. For example, a sacred fireball cast by a 6th-level wizard deals 6d6 points of damage: 3d6 points of firedamage and 3d6 points of holy damage. Thus, creatures immune to firestill potentially take 3d6 points of damage. Holy damage normally does not affect good creatures. Only divine spells can be sanctified, and a sacred spell occupies a spell slot two levels higher than the regular spell.
Use: Selected

And Corrupted Spell:

Type of Feat: [Metamagic]
Prerequisites: Spell Level 1, Cleric 6
Specifics: This feat adds the evil descriptor to one damaging spell you can cast. If the spell deals damage, half of the damage is unholy divine damage. For example, a corrupted fireball cast by a 6th-level wizard deals 6d6 points of damage: 3d6 points of firedamage and 3d6 points of unholy damage. Thus, creatures immune to firestill potentially take 3d6 points of damage. Unholy damage normally does not affect evil creatures. Only divine spells can be corrupted, and a corrupted spell occupies a spell slot two levels higher than the regular spell.
Use: Selected

 Although these are not final yet. They aren't balanced, they are too weak as they are.  :)

 

I have also modified the level up proces so that it now skips the spell gain windows, which this system replaces via the spell book UI. And that includes a bunch of prototype code to disable the default game spell book, in case spells of that book were put on the hotbar. The modified spell gain UI's can be left out if the developer wishes to retain the default spell book on level ups (but not for casting), so that a switch from the replacement spell system the default system is possible with minimal effort. E.a. No messed up characters. This would particularly be an issue on persistent worlds, though its also of interest to me for singleplayer use.

  • up
    100%
  • down
    0%
Rasael

Good news. I have verified that the fix to prevent spells from the old spell book being used works, at least for wizards. Presumably also for spontaneous casters. So pre-existing characters which already know spells from the default spell system will be prevented from using them under the replacement spell system.

This means that we don't have to muck up how such characters work, and that we can keep the spells picking as part of the levelup proces for the default spell system, in case we'd ever wish to go back to the default system.

What I am getting at is that the replacement spell system is very painless to install and run, and that it can be easily backed out if it screws something up, or has a game breaking bug. :)

This was an essential milestone for the system. :D

  • up
    100%
  • down
    0%
4760

I just discovered this. Waouh! I'd be happy to get it when it's released!

  • up
    50%
  • down
    50%
Rasael

Here is the semi-final feature list,

Replacement Magic System
-Easy to implement, minimal effort to remove. Pre-existing characters are not screwed up.
-Custom spell books made possible, assassin, archivist, blackguard, and pious templar included
-Custom metamagic made possible
-Heighten, sacred, and corrupt spell code included, need feats to be enabled
-Metamagic combinations can be added
-Too many spells known crashes fixed
-Spell slot duplication exploit fixed
-Spells are no longer lost on login when items get unequipped / equipped
-Spells related hacks fixed
-Casting time implemented as possible balancing tool
-Spells are no longer limited to 5 radial choices, made unlimited
-Spell targeting is now customizeable from script
-Spells learnable and amounts per day and learnable for each class now set from script
-Spell slots are now automatically sacrifced for the Archmage
-DM's can now reset spell lists in the game, no need for character RCRs or edits
-Spirit Shaman now memorizes spells as a wizard, gains these per day as a spont. caster, as in PnP
-Warlock may now choose lower level invocations with his higher level choices, if he wants, as in PnP
-Feats can now be made to give spontaneous casters new spells known, not just more per day
-Epic spells can be made memorziable under spell levels 10, 11, and 12. However you want it.
-More

  • up
    50%
  • down
    50%
Raygereio

This might be outside the scope of your project, but is it possible for the AI handle your spellbook?

  • up
    50%
  • down
    50%
Rasael

Hello Raygereio,

I added functions to retrieve whether a spell slot is filled with a spell, to retrieve that slot's ID, and to decrement that slot.
It is possible to adjust the AI therefore. The difficulty I foresee with AI is that you also have to give them spells. The toolset does that seperately from the game, and the game itself has level up files for that. So a work around for that would have to made.

I don't intend on supporting AI. Its easier if the AI continues to use the regular system while players switch over the custom system. :)

Howver, I imagine that if someone wants to they could probably way to do it.

  • up
    50%
  • down
    50%
Raygereio

Its easier if the AI continues to use the regular system while players switch over the custom system.
To clarify: I was refering to non-player-controlled NPCs in the player's party. So singleplayer instead of a pw enviroment.
Letting them continue to use the vanilla system when they should be casting from the new spellbook would be a bit problematic. But I reckon those functions you mentioned will be usefull for solving that.

  • up
    50%
  • down
    50%
Rasael

Yes I considered that issue a short while ago. What I came up with is that it should be easy to give the same leveling mechanic that player characters have to cohorts and party members.

The companion AI would have to be adjusted. I haven't done that. Right now I have submitted the system to our PW Admin so that we can try a live test some time. It is easy to plug in and take out again, but hopefully we can just leave it on if it works. And then develop it further as we go. That would help spot any issues I missed, before doing a general and public release.

Before doing the general AI I will take a look at companions to see how much work it would be. If its too much I will release it as is and invite the community to see what it can come up with. :)

  • up
    50%
  • down
    50%
Rasael

Time for another update. smiley

 

This project hasn't been abandoned. Its creeping ever close to succes. The reason for the delay(s) is that there are little bumps in the roads with each improvement added. crying But there is defintely progress!

 

 

  • up
    100%
  • down
    0%
rjshae

Thanks for the update. I just have a couple of questions:

  • In your image above, is the spell list on the left the available spells? I'm just curious why it shows Cause Fear over and over.
  • Is the middle column of metamagic buttons used to modify the right hand column, or do you select from the left and then the middle?
  • up
    50%
  • down
    50%
Rasael

rjshae,

There was a bug with spell learning from scrolls which caused the spell to be added in a loop instead of once only. That's why Cause Fear is in both the right colum and in the left. Normally the left column lists the spells you know, and the right one is for what you want to memorize. As you reasoned. (The bug was fixed, caused by a forgotten break; statement)

You can sort of see how its supposed to work in the earlier pictures. The metamagic column in the middle affects both columns, the left showing what you can memorize for the given spell level , and the right what you selected to memorize for the spell level you are on (eg. for extend spell at spell level 2 = 2 - 1 = level 1 spells can be chosen for extend spell at spell level 2). The level offset for metamagic can be set in script and is otherwise automatic. 

 

  • up
    50%
  • down
    50%
Rasael

A new update entry right before the new year. mail

I am pleased to say the Archivist class is now working entirely the way it should! I have also applied some more bug fixes after tracking down a number of issues. One had to do with the targeting code not working properly on selected items because several spell scripts use their own target identification routine to determine whether to cast at the creature's main weapon, or a specific item. 

What's more, I have also implemented new summoning menu's so that you get to choose which creature you wish to summon or bind. (See picture) It works very well so far, faultless even, which is a first in this project. I did adjust the available selection later on to prevent evil people from summoning angels, but that was a preference by the quality control and Dungeon Master team at BGTSCC. I also added a bunch of polymorph options to the spell of the same name.

The regular summoning spells now offer entirely different selections to account for the D&D split between 'Summon Nature's Ally' and the arcane 'Summon Monster'. Nature's ally gives a pick from animals, Fay, and Elementals. While Summon Monster offers a choice between Astral spririts / vestiges / echoes (my neutral option, I called them spirits) , Celestials, Demons, Devils, and Elementals. The planar binding and gate summons were also expanded as you can see in the picture.

Finally I also worked on code to accommodate this framework in singleplayer, such as a campaign or a testing module like we have for BGTSCC. I've been able to make the system work only for main characters and not for NPC companions, even if they are possessable. However, before that's done I still need to make the spell book and quick cast interfaces change depending on which creature you control. For the main character you should get the custom ones from this framework, and for other characters you get the default NWN2 interface elements. 

I am positive that this can be achieved. I am hoping to avoid putting a heardbeat on the quick cast with a script that removes and opens the appropriate UI screens. 

That's all for this update, I hope it piques anyones interest. smiley

 

  • up
    50%
  • down
    50%
Raygereio

I hope it piques anyones interest. 
It most certainly has.

I've been able to make the system work only for main characters and not for NPC companions, even if they are possessable.
A couple of questions here:

What's the reasoning behind not giving the player's NPC companions access to the new spelbook? AI troubles? If so, what'll happen when you switch control to the NPC companion and the AI handles the player's main character?
Also how would this work with a campaign like SoZ where you have a party consisting of multiple "main characters"

I am positive that this can be achieved. I am hoping to avoid putting a heardbeat on the quick cast with a script that removes and opens the appropriate UI screens. 
It's been a while since I messed with NWN2's GUI, but perhaps you could add a 
OnLeftClick that runs a script handling this to partybar.xml?

  • up
    50%
  • down
    50%
Rasael

Hello Raygereio :)

What's the reasoning behind not giving the player's NPC companions access to the new spelbook? AI troubles? If so, what'll happen when you switch control to the NPC companion and the AI handles the player's main character?
Also how would this work with a campaign like SoZ where you have a party consisting of multiple "main characters"

The reasoning is that my own focus is on multiplayer and not singleplayer modules so if it comes down to a choice I'll be happy if I can just get it working for online gameplay - without companions. That said, I am currently investigating how much trouble it is to make the AI work with the system. I have set up some AI wrappers and modified the AI to call those. I still have to check whether it works. If so then AI companions will use the reworked spellbook just fine, like they do the current stock spell system.

If the AI doesn't work then I will go back to the solution of limited the system to just the main character. It would disable spell casting AI for the main character because the game wouldn't see that any spells were memorized and ready. Apart from that the AI would work normally. The system would only work with possessable companions, not with henchmen. I believe that Cohorts are technically just henchmen, though they could also be setup like companions. If they are possessable it will work.

It's been a while since I messed with NWN2's GUI, but perhaps you could add a OnLeftClick that runs a script handling this to partybar.xml?

That's a good idea although one issue that comes to mind with it is that many folks use custom party bar UI's in their override folder. It'd disable using those. What I am currently thinking of is to attach a very very light script to the quick spell menu which closes and reopens that window if you possess a different character. 

Another thing on my agenda is to see about making Epic spells appear in the quick cast, instead of having them cast as an uninterruptible feat. But that's a lesser priority compared to making the system work with companions and their AI. I'd like to be able to use it in singeplayer. :)

  • up
    50%
  • down
    50%
Rasael

Here is the system with the companion Casavir added. :)

  • up
    100%
  • down
    0%
ghowriter

This is awesome. If you need a tester, I am in. This will allow me to make the "Witch" class mentioned in the dm guide.

 

Curious question: would this allow me to implement the required spell components before the spell fires?

  • up
    50%
  • down
    50%
Rasael

Hello Ghostwriter :)

"This is awesome. If you need a tester, I am in. This will allow me to make the "Witch" class mentioned in the dm guide."

I appreciate the offer very much but right now testers is one thing I am not short of! I am currently working on the AI and trying to make it work with the custom slot system. Its promising but it also requires me to verify results myself, test things. Its not something I can delegate to make things go faster.

"Curious question: would this allow me to implement the required spell components before the spell fires?"

Yes, you could do a check and sacrifice spell components (1)the moment the spell is selected (2)or targeted, (3)or right before its spell script executes. The system doesn't let you run a script at the exact point when the action cast spell for the spell is being executed. I imagine that option two works best.

With a little more work you could build on my spell queue design to add an ingredient queue which tracks whether the caster has enough ingrediets left at the moment a spell is selected or targeted (options 1 / 2). Contrary to the other implementations you then only remove ingredients when the spell script fires after the casting (option 3), not both at the same time - So you get a mix of all options.  If you don't do it that way then players would not get back spell components if they cancel a queued spell. But that might not weigh heavily enough to bother with the added work / code.

I hope that answers your questions!

  • up
    50%
  • down
    50%
Rasael

An update for the tenth of January, with happy news :)

After some wrestling with the AI code I have now managed to build in a switch which makes the AI use the replacement spell system if a creature - like a companion - is set up to use it. Getting it to work entailed doing away with the random talent selection and instead reading readied spells directly from the spell book. This has the benefit of giving the existing AI a wider pool of spells to work with, while at the same time it appears to have a lesser performance impact than the original AI code. I have yet to do extensive performance testing though - its only a first observation.

Screenshot because otherwise it didn't happen ;)

http://dl.dropboxusercontent.com/u/107960246/companion_update2.jpg

If the findings hold up then I imagine the replacement spell system could be a good way to set up casters that act as boss creatures, or any caster who should act as something of a challenge instead of encounter fodder. A bigger selection of spells should make the AI far more versatile.

An issue I have yet to adress is making the UI screens lock to a single character, or switching them once you possess a companion or familiar. Right now its possible to memorize Casavir's Paladin spells by opening the spell book while possessing him, and then switching back to your main PC character to select spells and rest.

What I think I will do is simply add some code in the UI scrips to lock the screen and close and re-open if that creature is no longer the one the player is using. Then optionally I can include a version of the GUI portraits which automatically check this for you if you click on a party member's portrait. That way users could decide for themselves whether they want to replace the party member UI, or perhaps keep an override they are already using. And you could always copy the code used into the override UI version being used, but most folks probably wouldn't bother.

 

  • up
    50%
  • down
    50%
Raygereio

 That´s awesome news.

 

  • up
    50%
  • down
    50%

Pages