The allow customization of hardcoded feats card discussion
JuliusBorisov
Member, Administrator, Moderator, Developer Posts: 22,758
Greatings, NWN:EE enthusiasts!
Please, provide more details and feedback for
https://trello.com/c/cZRsT9s9/31-allow-customization-of-hardcoded-feats
in this thread.
Please, provide more details and feedback for
https://trello.com/c/cZRsT9s9/31-allow-customization-of-hardcoded-feats
in this thread.
Post edited by JuliusBorisov on
0
This discussion has been closed.
Comments
https://neverwintervault.org/project/nwn1/other/patch/prestige-spellbook-pack
It has two main drawbacks:
1) You can only really simulate spellcasting classes that exist, it doesn't work too well with new spellcasting concepts, but it can probably be adapted to many Vancian variations. With access to the engine, it should be possible to add more options.
2) It doesn't grant new spells on levelup for Bard/Sorcerer PrCs. The CPP does allow you to go back and learn the spells you "missed" when taking Bard or Sorcerer levels. The rules as written during 3e weren't very clear on this, but most people agree that the Rule as Intended is that spontaneous casters gain new spells known as well as spells per day. 3.5e clarified the wording on these classes.
UNARMED DAMAGE:
If I wanted to create the Brawler class at the moment I'd have to create a script that equips a character with a creature weapon of the appropriate damage output. I couldn't also simulate a ki strike (magical weapon) without also adding +1 or more to attack rolls, so it takes a lot of weird scripting workarounds just to enable this feature. (This is how the PRC Brawler works -- I coded it myself back in the day.) If all the game had to do is refer back to a couple of tables set in 2da's, it would work without all the weird workarounds.
I'm not sure how the Shou Disciple is coded in the engine, but it does unarmed damage increases. It's also available (without NWNCX) in the Community Patch Project 1.72.
Another possibility is to make everything 100% feat based. That is, very few of the engine calculations should use class levels, instead looking at feats on the character. Instead of knowing that a Level 4 monk has 1d8 bludgeoning damage, give a feat to level 4 monks that gives 1d8 bludgeoning damage. This would break backwards compatibility with old characters without a lot of workarounds in the code. HOWEVER, the benefit would be immense. It would make it possible to mix and match class features without multiclassing, through the use of feats.
SNEAK ATTACK/ATTACK FEATS:
For this one, we just need the ability to run a couple of scripts "on hit", if certain feats are present . For a character with a Sneak Attack feat from any source, just have the engine run "x3_sneak_attack" script when an attack hits. This script could also arbitrate whether the sneak attack works (i.e. is the character immune, flanked/flat-footed/etc.) If done in this way, new feats and or item properties could be added which change the way sneak attacks work. This would allow unhardcoding stuff like Assassin's Death Attack and Rogue's Crippling Strike. Modders could even add means to bypass sneak attack immunity (there are a ton of ways in PnP.) The possibilities open wide up.
While we're on Sneak Attack, the Duelist class has "Precise Strike" which is almost basically sneak attack without as many conditions. The reason I bring it up is that it should be possible to trigger "on hit" class abilities other than just Sneak Attack with some careful tweaking of feat.2da.
For attack feats like Smite Evil, I would make the change in feat.2da. It would be like instantaneous feats that are already in there, except they'd also run alongside the normal attack flurries and require a target. It would be almost exactly like "Sneak Attack" above, but it would require activation.
METAMAGIC:
This one seems like it would be almost easy, though I can't be certain. The effects of metamagic are handled through spell scripts, so the main thing the engine needs to know is where to put stuff into the spellbook GUI. If the engine referred to a 2da to see how to handle that, we could add and modify metamagic to our heart's content. Arcane Scholar of Candlekeep from NWN2 further modifies existing metamagic feats. I'm not sure how to recreate that in 2das, but that's something to think about, because that would be a cool class to have.
The way I approached sneak attack was to remove it and add a new set of feats, allowing a click on feat then click on target approach similar to stun fist. Since sneak attack is supposed to apply once on the first attack it was easier to do it this way because the three attack phases meant all phase 1 attacks in NWN are sneak attacks which is kind of a rules bug. To help with automatic sneak attack in flanking I used an onhit property.
This allowed me to make Craven feat (+2 per sneak die while not immune to fear), the various ambush feats (reduce sneak attack dice to add an extra debilitating effect), and the sneak die size (d8, d12, d8 vs evil like in the exalted book) increase feats , I also found it easier to stack class sneak attacks by counting levels instead of checking feats.
There were some issues most of which if I remember correctly came from the combat phases and hardcoded initiative which presented some obstacles to changing sneak attack.
I think Beamdog can go two directions on this, either with something like an OnSneakAttack (even maybe OnCombatEvent with EVENT_TYPE_SNEAK_ATTACK as something you can check) event. Otherwise by making sneak attack something that can be changed by altering parameters in a script like SetSneakDiceAmount(object oTarget, int nDice, int iVsType)
SetSneakDiceSize(object oTarget, int nSize, int iVsType)
SetSneakAttackPostEffect(string sScriptName, string sCommaDelimParameters)
The way I approached unarmed damage was by managing the creature weapon on the PC and adjusting the item properties with each event that captured a change in monk levels. It was possible to handle other classes individually then improve them with a conversion of the dice progression tables on the system reference document. It was also possible to do size based scaling too, but I think I remember I had some trouble with the gargantuan and colossal style fists because the damage dice constants didn't go that high. EffectModifyAttacks helped to make the proper attack adjustments but I think I remember it had some constraints to it.
I didn't have like a whole lot of difficulty messing with this that I remember, actually the creature weapon method made it easier for spells such as greater magic weapon to function on monk fists. It also made it easier to make things like the monk belt which gives monk fist levels.
One of the concerns was for things that could mess with creature weapons so optimally it would be better to have a third "tab" of "equipment" with permanently equipped fists, presence of a creature claw/fist weapon should override the fists, and presence of a held weapon should override the claw/fist weapon.
Issues seemed to be more prevalent when it looked like I needed more control on the combat sequences, like trying to get a sneak attack attempt before it hit so I could modify the attack accurately depending on feats and conditions.
Better control over the number of attacks would help a lot too, especially for monk weapons and several rare feats out there.
Metamagic was a completely different world. Unlike the previous two some parts just didn't have any real work about at all. Certain cast speed altering metamagic effects would have required setting all spells to the minimum delays and removing all casting animation, sounds, and effects, and then rebuilding it all from scratch in the spell script so that you can simulate faster and slower casting.
A metamagic that changes the element type of a spell or other various nature of a spell would similarly have to get access to casting visuals before the spell is properly cast.
The worst part of metamagic was trying to come up with ways that a caster could take the epic feats to reduce metamagic costs (minimum is still 1) and allowing for two or more metamagics to be applied to a single spell with cumulative costs.
Epic level spell slots were problematic too because you might be able to simulate additional 10th, 11th, 12th, 13th level slots for higher metamagic stacking but there wasn't a satisfactory way you could have the spell cast for free or actually tax it with a combination of lower level slots.
Metamagic for longer ranged spells was problematic because of rendering and other ranged based factors. Not to mention there wasn't a satisfactory way to have the spell adjust it's range by script to make such metamagic possible without affecting all spells.
I came to the conclusion like some others that the only way to get the necessary results was that a content creator had to completely replace the entire system which seemed only possible with NWN2 UI. Someone actually did that but there were some issues with the replacement system even then, and I believe the game interface didn't recognize it as proper spells.
Finding ways to change the engine to alleviate some of those custom metamagic roadblocks would be like literally a godsend to a lot of ppl.
There is a problem with catching the "OnSneak" because the sneak is calculated way before any OnAttacked/OnDamaged event will fire. It is always possible to fire new script but then we are heading into running 5+ scripts per each attack in flurry which is just not efficient.
Imo, the better way to do what you want would be the ability to create new special attack and ability to make that attack sneaky - this was done in my nwnx_patch/nwncx_patch so it is possible to do.
I also made possible to catch whether the last attack was sneak, but you could not change that (as that calculation was made long time before OnDamaged fired) so not sure how usefull it was.
Tl'dr. Softcoding sneak is not good idea, at least for official release. NWNX can handle this. Providing more informations about attack in OnPhysicalAttacked/OnDamaged would be nice though.
----------------------------------------------------------------------
Regarding unarmed damage:
This can be done using creature weapon. I know this is not very "user-friendly" however I used to have unarmed damage softcoded in my nwnx_patch plugin and I had to remove this feature.
First problem with this is that the unarmed damage calculation runs very very often and reading values from ini/2da might have impact on game, in long term at least. Also, it become soon clear that no 2da can allow things like unarmed damage stacking.
I would let this to NWNX, we can easily make a plugin that will replace unarmed damage with value from variable. I don't think this is good idea for official release.
-----------------------------------------------------------------------
Regarding custom metamagic:
This is very hard to do. It would be nice if beamdog changed function CNWRules::GetMetamagicCost to have creature object argument so we could change this via NWNX.
If I am not mistaken, there are 2 extra "slots" in radial menu for metamagic so it would be nice if we could add 2 new metamagics.
However it would required, OnStartCastSpell event at least. To define what happens when the spell casting is started with new metamagic.
So yes, if possible im for this one.
Speaking as someone that isn't as much a fan of Vancian magic as some other things that simply can't be done with NWN, and with the interest of creating a PW along the lines of 3.5e/Pathfinder -- or GURPS preferably, if at all possible -- as much customization of... everything... as can be rendered in nwscript is preferable.
If I can render a persistent world without being entirely bound to the D&D 3e framework and feel, I can attract /So/ many more people to my world. D&D is great and all, but it's not the ideal framework for modelling, for example, low-level, low-magic survival RP settings that don't use classes, don't have any use for Charisma (different magic and/or stat systems), or have skill based progression instead of linear, adventuring progression (individual crafting tradeskills or character traits that should have their own experience). A lot of this can be done, yes, and has been done (including by myself), but only by working around and ignoring large parts of the underlying game and retrofitting in janky-at-best systems using conversations and chat messages and items and all kinds of workaround.
Heck, in modules you can't even turn off certain game features you don't want to use in the module -- don't want casters, or certain feats? Disable them in the module settings. Not an option on character creation, or in gameplay, etc. Certainly easier said than done in some cases, I'm sure, but a simple "toggle whether or not player characters can access/use these feats/skills/classes/etc" would be handy for starters. Just turn Devastating Critical right off in the module, no need for NWNX plugins, or a future update that universally takes the feature away from everybody, to do it for you, lol.
Edit, because I should take more time to say the other things that come to mind:
It's indirect hardcoding, in a way but currently adding weapons is awkward - sticking with Melee as an example. It's currently possible to add them, but there's no 'hard' support for it. Weapon Focus feats need to be scripted to add attack bonuses to characters, which needs to be scripted to stack ontop of any actual enchantment bonus the weapon has. It gets even messier with Finesse weapons. Then there are Improved Critical feats and weapon master bonuses which wouldn't quite work.
The real mess encountered here, though, is a lot more clear with trying to add a finessable weapon. On a high magic, high level server you could expect to see a finesse build reach 40 or more dexterity, with just a +5 weapon that's already hitting the current +20 Enhancement cap on attack bonus. A base weapon would outperform due to this.
Custom Skills face a similar problem with lacking support from Skill/Epic Skill focus feats because they have their own +50 cap
That way modders would be able to recreate their functionality of permanent “true” attribute bonus’s that are not secretly buffs/effects. Unlike the effect based feat implementations we currently must adopt in non-extended NWN "true" attribute bonuses can be used to qualify for feats/prestige-classes and are not limited by the +12 ability cap.
There are all manner of 3.0/3.5 classes (besides RDD) which are meant to have a permanent “true” impact on character attributes, Oozemaster and Heartwarder to name a few. But currently the only way to implement classes like these properly is through NWNX.
Personally, there are some things from Savage Species I’d quite like to implement, which I’d really love people to be able to experience without necessarily having to do so via NWNX.
Similarly, ways to add permanent “true” skill bonus’s and immunities would be nice. Though I’m less concerned about these. Likewise, I’d also love an easier way to have classes make players qualify as other races/types. For example, there are classes that end with you becoming an outsider that should render you immune to humanoid (playable-race) targeting spells like dominate person. There are classes that end with you becoming undead that should make you vulnerable to turning. There are classes that cause you to gain the shapechanger type and should make you vulnerable to rangers with favoured enemy shapechanger etc.
Admittedly the features above have been more or less already achieved by the geniuses who contributed/contribute to the player resource consortium via, I’m guessing, tireless overhauling of vanilla feats/spells and NWNX. However, a lightweight way to have custom classes achieve these things in vanilla nwn could lead to a lot more creation and adoption of fancy classes.
And I for one like fancy classes.
All we need is possibility to modify character abilities. But this would also mess with ELC if turned on so it should be done as effect.
We need a new effect that can raise ability score and won't count towards +12cap. That way it will avoid all the problems with ELC.
Solution #1: Just new EffectAbilityIncreaseUncapped or something similar
Solution #2: Alter the way ability bonuses works on Skin item and make them not count towards +12 cap. That would be easiest to implement and would already automatically do this for those who used skin to grant racial/class abilities in past despite in that time it counted towards +12 cap.
It can be added feats like.
Racial Strength I to X
Racial Intelligence I to X
Class Strength I to X
So we can attach them into custom races and classes
Maybe instead of exposing the feats to scripting, attribute bonus columns could be added to the end of the feat.2da and the ELC could just be tweaked to read those. Likewise HDA's solution also seems preferable, assuming i'm correct regarding feat qualification and effect/hides.
How come NWNX driven attribute bonus's don't conflict with ELC? (Or do NWNX servers have it turned off? )
I'll admit I know next to nothing about ELC, is it necessary for servers that don't allow local characters, how vulnerable is the server vault?
Servers using NWNX to add ability bonuses does indeed have ELC disabled. Even adding ability points from DM console commands will make character invalid if ELC is on.
Going back to my earlier example lets say that they tweaked the level up to recognize the +2 INT hide/skin effect as part of the "base" and subsequently my hypothetical character is allowed to take expertise. I worry that later the ELC will notice the expertise feat, realize the character doesn't meet the requirements, and flag the character as illegal.
Of course, they could just change the ELC, like they'll have to do with the other suggestions. I just assumed that changing the ELC to recognize more 2da data would probably be easier then getting it to check hides, effects and alike. But i'm just speculating at this point, I still have no idea what the ELC does and doesn't check or how/when it does it.
Anyway, ideally i'd prefer they did find a workaround to make a hide/skin/effect driven solution work for feat requirements. We'll inevitably end up relying on that approach for skill bonuses etc anyway so it would be nicer to have it all in the same place.
Make new itempropertys of feats/skill/ability etc.. that can only be placed on hide parts and the bonuses/negatives that are tagged to not count towards cap and the engine see as core pc (Will return true on feat requirement etc..). This will allow us to just change over our scripts to the new system and still work and we can use the old system on pc equipment that is counted towards caps. This will put more work on scripting for cheaters, but if it hard locked to skins it would be easier.
Other thoughts on ELC is server side check list of what to check for.
I wrote few remarks on unhardcoding stuff. These remarks are based on my nwnx work where I unhardcoded/softcoded: all special attacks, healers kit, animal empathy, taunt, pickpocket, devastating critical, death attack, defensive stance, attack of opportunity, scroll learning, animal companion and familiar
This document should help devs decide what is worth / how to do it and others to understand why/what are problems with unhardcoding stuff in general.
Unhardcoding notes
We have the playertools and dmtools feats which are awesome for creating subracial powers and spell like abilities.
However- the problem with immersion is that they have hard coded names.
Is it at all possible to have feat names overrided by the server?
I know that the current engine gets the name from the tlk file on the client, and it receives merely a number from the server to indicate the actual feat name from the tlk.
I guess if https://trello.com/c/Jk7UmlSa gets solved/implemented - this too would be solved.
Means one server could name 'Playertool01' to be 'Thunderbolt' etc
While another server could name it 'Admin Pointer' or something.
Hopfully whatever the solution, it is seamless.
Maybe it would just be better to to it half-way. We actually don't need it completely unhardcoded. If devs moved the feat-specific, ability-specific code from major engine functions into their owns, ie. in case of devastating critical, move the code handling devastating critical inside CNWSCreature::ResolvePostMeleeDamage and CNWSCreature::ResolvePostRangedDamage into new function CNWSCreature::ResolveDevastatingCritical and call that instead.
This would make it very easy to modify via NWNX then.
For instance, regarding your example of Devastating Critical, it could be modified via NWNX already (and you've actually done it), so the worth of making it easier to modify via NWNX is rather small, I feel.
To my mind, if any time, effort and resources is to be spent on unhardcoding things at all, it should be done fully, otherwise these resources would be better spent on other stuff.
Plus as you can see, ppls cannot agree on anything here (and it is not a BD forum-specific issue, we all know vault forums) which is a real new feature killer.
This would allow coders to create bonuses as needed -- new feats that increase stats, easier custom weapons (for finesse, focus, specialization, etc.), easier softcoded subraces without too many hooks into the engine, etc. I think it would work within the framework of what's there pretty easily, and since it's an effect, it wouldn't break ELC and would greatly ease unhardcoding just about every feat that does something that could be simulated through Effects.