Skip to content

The allow customization of hardcoded feats card discussion

2

Comments

  • voidofopinionvoidofopinion Member, Moderator Posts: 1,248
    Being able to more easily edit and work around feats would make it so much easier to perform transformative work. It would make working outside the D&D ruleset so much easier. Especially those of us who would rather see NWN:EE as more OGL when it comes to our creations.
  • PlokPlok Member Posts: 106
    edited January 2018
    Some thoughts on some of these:

    Stat/Skill bonuses

    Why not do it the way that Temple of Elemental Evil does it? In TOEE, whenever you add a bonus to a character, you also supply a constant or a short string of characters as the source of those bonuses. Bonuses that have the same source don't stack.

    The advantage of doing it this way is you can make the parameter optional and have the default be the standard NWN behaviour (so you don't break things). You can also do proper DnD stacking; currently you can only sort of do this with AC bonuses.

    For example, for a Heartwarder you could have the level give +1 Charisma, "Heartwarder" so it will always be applied. You could also make a PRC or Feat that gives +1 Charisma, "Enhancement" that wouldn't stack with gear. You could also put together the common bonuses in DnD pretty easily, e.g.: Enhancement, Insight, Inherent, Luck, etc.

    You can also implement things like the Paladin's Divine Grace really easily this way too. Just run a script that adds the Paladin's CHA to their saves with the source "Divine Grace". You could make it not stack with Dark Blessing by giving them both an applicable source, say "Divine".

    Because of how attribute stacking works in standard NWN, you'd probably also need some sort of opt-in feature to turn off Enhancement bonuses to attributes stacking. Otherwise you'd be able to really easily get some insane numbers with really low level equipment and spells.

    Metamagic

    I'm not a modder, but I have played around with some mild scripting/2da editing in NWN and NWN2. There's one huge issue to de-hardcoding Metamagic that I remember bumping into.

    IIRC the 2das/scripts store applicable metamagics for each spell as an integer bitfield - a string of binary digits where each binary digit stores whether or not a metamagic can be applied to a particular spell. This means there are a maximum of 32/64 different metamagics (I think NWNscript uses 32 bit integers, so probably 32).

    While 32/64 different metamagics sounds like a lot, there's two big problems with this approach:

    Firstly, different mods that add metamagics will be constantly stepping on each others toes as they all use the same bits. Unlike with feats, there's a very small finite set so there's no possibility of reserving ranges to get around this.

    Secondly, Warlocks are a thing people are going to want to make. People will probably try and implement them in a similar way to how NWN2 does it - which is every Blast Shape and Eldritch Essence is a Metamagic with a bit in the metamagic bitfield (Bioware only really needed to use one or the other but they used both). Kaedarin's PRC pack has to work around this by adding extra Eldritch Essences as these weird Invocations that all behave like Call Lightning.

    You'd probably also need to still support the old way of doing it in order to not break existing mods and (in programming parlance) deprecate how it's currently done and encourage modders to use the new method, whatever that ends up being.

    --EDIT--

    Whoops, it was Obsidian who made NWN2, not Bioware. Apologies for besmirching Bioware as being wasteful with the Warlock class.
    Post edited by Plok on
  • ThorssonThorsson Member Posts: 190
    It's not for nothing that they're lovingly called Bugsidian...
  • HousePetHousePet Member Posts: 12
    This is a really difficult one to comment on.
    I obviously want to be able to tweak everything so that I can keep the PW I code for balanced and bug free, but that tells you absolutely nothing...
    Also I'm so used to working around the limitations that I can't think of what they are without a lot of effort. XD

    Some suggestions
    Active feats that don't run through a script: Put them in a script, even if the script just then calls a hardcoded action function. This will let us at least hook on to it, and add temp modifiers or replace the effect as desired.

    Modifier caps: Custom AC sources have been a huge headache. We really need the ability to grant base AC minimum. Being able to alter the existing hardcoded AC sources would also be nice, but tricky. I can see any solution to this short of exposing a GetAC function hook.
    Various caps could potentially be made alterable by a script command.

    Metamagic: Obviously things that change casting visuals/times aren't going to be doable, but it should be fairly easy to throw in some blank metamagic lines that modders can then utilise as they want.
    (As far as Warlock goes, I wrote my own implementation which just has the essences and shapes as separate actions, which has the added benefit of meaning I can stick cooldowns on them and stop spamming of the same combination ad infinitum. So I'm not fussed about using metamagics for Warlock, nor do I think its a good idea.)

    Combat Modes: These could potentially be implemented by a script (with some extra scripting functionality that would help with other issues), then you just need a new flag on the feat/spell to state that it is an action mode and make the quickslot button work as a toggle.

    Spellbooks: It didn't really bother me to implement Blackguard/Assassin spell books as just activatable sub feats, but Bard/Sorcerer not being able to get new spells from prestige classes = horrible.
  • voidofopinionvoidofopinion Member, Moderator Posts: 1,248
    Unhard coding of feats, races, spells etc means projects like PrC and modules with custom rulesets have a far easier time creating content that in the long and short run will help extend the life cycle of NWN thus creating more sales for Beamdog and a thriving player community.

    The fewer limits the more we can do the more we can create.

    I'm not sure what more I can say or what needs to be said.


  • PlokPlok Member Posts: 106
    HousePet said:

    This is a really difficult one to comment on.
    Modifier caps: Custom AC sources have been a huge headache. We really need the ability to grant base AC minimum. Being able to alter the existing hardcoded AC sources would also be nice, but tricky. I can see any solution to this short of exposing a GetAC function hook.
    Various caps could potentially be made alterable by a script command.

    I'll just quickly mention that Temple of Elemental Evil does the same thing for AC as for stat/skill bonuses. It makes adding custom AC types and stacking $stat to AC really simple.

    It uses that approach for everything that's a number - attack bonus, damage bonuses. It's a really flexible approach and I think that with no modifications whatsoever it'd sort out pretty much everything that isn't a scaling class feature (e.g. sneak attack dice, caster level etc.).
    </cheerleading-toee>
    HousePet said:

    Spellbooks: It didn't really bother me to implement Blackguard/Assassin spell books as just activatable sub feats, but Bard/Sorcerer not being able to get new spells from prestige classes = horrible.

    I know there's a topic specifically for this here, but just want to say, as someone who's used both Kaedarin's PRC pack for NWN2 and the NWN1 PRC consortium, active sub feats really suck. Not as much as trying to memorise spells known as an Archivist/Wizard/Mystic Theurge, but it's still awful.

    You can't read spell descriptions (who knows what Hexblade's Hound of Doom spell does? I sure don't), you can't have bonus spell slots for high stats and you can't use them from your keyboard hotkeys (in NWN 2 at least, dunno about NWN 1). Also Blackguard is a prepared caster like a Cleric in PnP.
  • Dark_AnsemDark_Ansem Member Posts: 992
    I also would like to point out that I would like the spells per day uncapped: most of them cap at 4, don't day? And there are no level 10 spells either...
  • Sunssarathi2029Sunssarathi2029 Member Posts: 32
    Unhardcoding feats would benefit whole community.
    First it would benefit builders, who would build new cool modules, maybe in different settings.
    Those modules might lure another people intro buying nwn EE.
  • HousePetHousePet Member Posts: 12
    HousePet said:

    Spellbooks: It didn't really bother me to implement Blackguard/Assassin spell books as just activatable sub feats, but Bard/Sorcerer not being able to get new spells from prestige classes = horrible.

    To clarify, yes it is a rather horrible and limited solution, but its better than some other things that have no reasonable solution at the moment.
    Obviously I would like to see everything fixed, but resource limitations suggest not everything can be done instantly (if at all) so some things should be prioritised.
  • Dark_AnsemDark_Ansem Member Posts: 992
    HousePet said:

    HousePet said:

    Spellbooks: It didn't really bother me to implement Blackguard/Assassin spell books as just activatable sub feats, but Bard/Sorcerer not being able to get new spells from prestige classes = horrible.

    To clarify, yes it is a rather horrible and limited solution, but its better than some other things that have no reasonable solution at the moment.
    Obviously I would like to see everything fixed, but resource limitations suggest not everything can be done instantly (if at all) so some things should be prioritised.
    Unlocking spellbooks and feats, including metamagic, would be the paramount undertaking for greater class options.
  • FreshLemonBunFreshLemonBun Member Posts: 909
    Level 10 and higher spells would be about extending the spell casting system into epic levels using the improved spell capacity feats, the slots are used for high level metamagic. So it should probably be softcoded or feat dependent. I think softcoding of spell slots and known spells and memorized spells would be the best for modding.
  • Dark_AnsemDark_Ansem Member Posts: 992

    Level 10 and higher spells would be about extending the spell casting system into epic levels using the improved spell capacity feats, the slots are used for high level metamagic. So it should probably be softcoded or feat dependent. I think softcoding of spell slots and known spells and memorized spells would be the best for modding.

    I agree completely. By the time HotU kicks in, Warriors have outclassed spellcasters.
  • ShadowMShadowM Member Posts: 573
    How about something similar to spellhooking script / module event that we can intercept hardcoded activated feats. This would allow us to add scripting check to stop or add custom requirements or rewrite there functioning or allow them to continue as normal. (like FOB not allowed with shield equipped) we can add more custom functions to handle these over time. This would save hassle of 2da and around about fixes. Just some thoughts
  • SorcererV1ct0rSorcererV1ct0r Member Posts: 2,176
    edited February 2018
    I will love to see that. Be able to create classes like psion will be amazing. I have tried to play with psion in nwn - PRC(non ee) and...

    Can't level up

    https://www.youtube.com/watch?v=eCitWN5KiS0
  • Dark_AnsemDark_Ansem Member Posts: 992

    I will love to see that. Be able to create classes like psion will be amazing. I have tried to play with psion in nwn - PRC(non ee) and...

    Can't level up

    https://www.youtube.com/watch?v=eCitWN5KiS0

    Psion would be a good class for an official beamdog DLC
  • FreshLemonBunFreshLemonBun Member Posts: 909
    It needs a lot of psionic feats and fully fledged psionic crafting to really shine. It's an alternative magic system which can function fully on it's own so it requires more attention than a typical class does.
  • HunterRayder93HunterRayder93 Member Posts: 266


    Psion would be a good class for an official beamdog DLC

    This is one of the many things that Treant does not want to develop, he prefers that the modders to create their own classes and content ... but honestly as already repeated many times I would like things cut and left halfway can be fixed and implemented in EE (this is to say all those missing quests in the official campaigns and premium modules).
  • Dark_AnsemDark_Ansem Member Posts: 992


    Psion would be a good class for an official beamdog DLC

    This is one of the many things that Treant does not want to develop, he prefers that the modders to create their own classes and content ... but honestly as already repeated many times I would like things cut and left halfway can be fixed and implemented in EE (this is to say all those missing quests in the official campaigns and premium modules).
    Then he needs to softcode BAD, including UI because the Power Points system would benefit from it immensely.
  • FreshLemonBunFreshLemonBun Member Posts: 909
    Power points don't really need a UI to work but it would be beneficial to have it displayed as a bar and number similar to hp.

    I don't think they've said anything against classes at all. The issue is that they would probably need to coordinate with Wizards of the Coast for any official stuff.
  • PlokPlok Member Posts: 106

    I will love to see that. Be able to create classes like psion will be amazing. I have tried to play with psion in nwn - PRC(non ee) and...

    Can't level up



    Not EEs fault here. The PRC Compedium checks requirements via script and auto-delevels you if you select a feat you shouldn't be able to (in order to get around limits in feat requirements in NWN). Be very careful with your 1st level feats because it can't delevel you to 0.

    If you feel like hacking this stuff out the enforcement scripts are scripts/prc_prereq.nss, scripts/prc_enforce_feat.nss and psionicobjs/prc_enforce_psi.nss. Dunno which haks they're located in because I just have checked out their source code (which is available via SVN at https://svn.code.sf.net/p/daprc/code/). Building it and installing your changes into NWN is as simple as running the make.bat file provided.
  • SorcererV1ct0rSorcererV1ct0r Member Posts: 2,176

    I will love to see that. Be able to create classes like psion will be amazing. I have tried to play with psion in nwn - PRC(non ee) and...

    Can't level up

    https://www.youtube.com/watch?v=eCitWN5KiS0

    Psion would be a good class for an official beamdog DLC
    I agree. No cRPG allow you to play as a Psion. I have a topic to discuss that.

    https://forums.beamdog.com/discussion/68683/should-new-core-prestige-classes-be-added-to-nwn-ee-if-yes-what

    If a lot of people suggest psion, MAYBE beamdog will add to nwn:ee as a native class.
    Plok said:

    I will love to see that. Be able to create classes like psion will be amazing. I have tried to play with psion in nwn - PRC(non ee) and...

    Can't level up



    Not EEs fault here. The PRC Compedium checks requirements via script and auto-delevels you if you select a feat you shouldn't be able to (in order to get around limits in feat requirements in NWN). Be very careful with your 1st level feats because it can't delevel you to 0.

    If you feel like hacking this stuff out the enforcement scripts are scripts/prc_prereq.nss, scripts/prc_enforce_feat.nss and psionicobjs/prc_enforce_psi.nss. Dunno which haks they're located in because I just have checked out their source code (which is available via SVN at https://svn.code.sf.net/p/daprc/code/). Building it and installing your changes into NWN is as simple as running the make.bat file provided.
    Thanks. I've created my psion via character creator. Din't choose any feats, only used the default feats. Will try again choosing other feats.
  • TarotRedhandTarotRedhand Member Posts: 1,481
    FWIW In the latest custom content challenge over on the vault there is an Occultist (class) by Grymlorde. Don't know how big or small it is as I haven't had time to check yet.

    TR
  • Dark_AnsemDark_Ansem Member Posts: 992
    About this thread: there are also some feats which are hardcoded, such as "Bardic knowledge". I assume that this card also includes the softcoding of such feats?
  • SherincallSherincall Member Posts: 387
    edited February 2018

    About this thread: there are also some feats which are hardcoded, such as "Bardic knowledge". I assume that this card also includes the softcoding of such feats?

    Two ways this customization can be done:

    A) They rewrite the entire combat engine is some JIT'ed scripting language, like Lua, and make it available for modders to modify. This is a ton of work, but the end result is full moddability of the ruleset.
    B ) They go around and unhardcode things on a case by case basis. Each skill/feat/etc would need to be unlocked directly, which is a couple of hours per item. In those cases, we-the-community would need to request each individually. Might even need another trello board or something to vote on it.

    And there's C) where they just let us run compiled code directly, which is essentially NWNX/NWNCX. Not very modder friendly.
  • Dark_AnsemDark_Ansem Member Posts: 992
    edited February 2018

    About this thread: there are also some feats which are hardcoded, such as "Bardic knowledge". I assume that this card also includes the softcoding of such feats?

    Two ways this customization can be done:

    A) They rewrite the entire combat engine is some JIT'ed scripting language, like Lua, and make it available for modders to modify. This is a ton of work, but the end result is full moddability of the ruleset.
    B ) They go around and unhardcode things on a case by case basis. Each skill/feat/etc would need to be unlocked directly, which is a couple of hours per item. In those cases, we-the-community would need to request each individually. Might even need another trello board or something to vote on it.

    And there's C) where they just let us run compiled code directly, which is essentially NWNX/NWNCX. Not very modder friendly.
    A or B sound good, but I'd argue that the most realistic one is B. I really don't think they will rewrite the combat engine. And C sounds extremely impractical.
  • PlokPlok Member Posts: 106

    About this thread: there are also some feats which are hardcoded, such as "Bardic knowledge". I assume that this card also includes the softcoding of such feats?

    Two ways this customization can be done:

    A) They rewrite the entire combat engine is some JIT'ed scripting language, like Lua, and make it available for modders to modify. This is a ton of work, but the end result is full moddability of the ruleset.
    B ) They go around and unhardcode things on a case by case basis. Each skill/feat/etc would need to be unlocked directly, which is a couple of hours per item. In those cases, we-the-community would need to request each individually. Might even need another trello board or something to vote on it.

    And there's C) where they just let us run compiled code directly, which is essentially NWNX/NWNCX. Not very modder friendly.
    I've been spamming this a bit because no-one visits the builders forums, but I made a suggestion there that could handle this: https://forums.beamdog.com/discussion/69148/more-composable-scripting.

    TLDR version of the topic; class features (such as Sneak Attack, Spellcasting, Bardic Knowledge etc.) get callback events. You can register a handler function in nwnscript that get called a particular points in the usage of the class feature, such as before/after dice are rolled or before the feature takes effect. See the examples I posted a good gist of the approach - there's a lot of text to read through.

    The advantages of the approach:
    • It doesn't require binning nwmscript.
    • It's backwards compatible - current behaviour can be left as is and then changed via callback handler.
    • It's composable (main thing I was going for when I suggested it); you can change behaviour without touching a single line of someone else's code and it will stack with other peoples' changes.
    • It's easier and cleaner to use than the current way of doing things.
    The main disadvantage of the approach is that it's a fair chunk of work for Beamdog. Even figuring out where to put the callbacks isn't simple and requires a bit of finesse as to which features need which events. However, this still sounds like a lot less work than A or C and is probably comparable to B.
  • Dark_AnsemDark_Ansem Member Posts: 992
    Plok said:

    About this thread: there are also some feats which are hardcoded, such as "Bardic knowledge". I assume that this card also includes the softcoding of such feats?

    Two ways this customization can be done:

    A) They rewrite the entire combat engine is some JIT'ed scripting language, like Lua, and make it available for modders to modify. This is a ton of work, but the end result is full moddability of the ruleset.
    B ) They go around and unhardcode things on a case by case basis. Each skill/feat/etc would need to be unlocked directly, which is a couple of hours per item. In those cases, we-the-community would need to request each individually. Might even need another trello board or something to vote on it.

    And there's C) where they just let us run compiled code directly, which is essentially NWNX/NWNCX. Not very modder friendly.
    I've been spamming this a bit because no-one visits the builders forums, but I made a suggestion there that could handle this: https://forums.beamdog.com/discussion/69148/more-composable-scripting.

    TLDR version of the topic; class features (such as Sneak Attack, Spellcasting, Bardic Knowledge etc.) get callback events. You can register a handler function in nwnscript that get called a particular points in the usage of the class feature, such as before/after dice are rolled or before the feature takes effect. See the examples I posted a good gist of the approach - there's a lot of text to read through.

    The advantages of the approach:
    • It doesn't require binning nwmscript.
    • It's backwards compatible - current behaviour can be left as is and then changed via callback handler.
    • It's composable (main thing I was going for when I suggested it); you can change behaviour without touching a single line of someone else's code and it will stack with other peoples' changes.
    • It's easier and cleaner to use than the current way of doing things.
    The main disadvantage of the approach is that it's a fair chunk of work for Beamdog. Even figuring out where to put the callbacks isn't simple and requires a bit of finesse as to which features need which events. However, this still sounds like a lot less work than A or C and is probably comparable to B.
    Interesting. And you said you got no feedback about this from @TrentOster or others?
  • PlokPlok Member Posts: 106
    Holy cow! That was a fast response!

    No, no feedback. The post has like 60 views in 10 days. At least 5 of them are me opening it to copy and paste something or reply. I've posted a link to it with an apology for spamming in one of the main suggestion threads in general but it hasn't been picked up.

    I really think it's a good approach so it's a bit disheartening that no-ones seen it. :(
  • SherincallSherincall Member Posts: 387
    edited February 2018
    @Plok yeah, that would be one of the ways B could be implemented. The actual callback implementation aside, it still requires someone to find and hook up each case of feat/skill/mechanic use and register it somewhere. These are not always obvious, as you can see by looking at how NWNX handled some of these in the past.

    On the sneak attack example, you first have CNWSCreature::ResolveSneakAttack(attacker, defender), which checks whether the attacker can perform the sneak (Has feats, defender flatfooted or flanked, within range, defender not immune, etc). It then sets the flag that this attack is a sneak attack. That flag is checked by several other functions during combat processing, such as whether the attack can be blocked, or how much damage to apply, etc.
    At least, you'd add a callback in the ResolveSneakAttack to do the check and potentially set/clear the flag. But if you wanted to modify the attack damage, you'd need another callback.
    Oh, and this is just sneak attack. Death attack for example has its own separate code.

    Sneak attack is a bit above average complexity to expose, but there's many worse ones. Point is, each one has their own quirks that need to be hunted down and modified, and then tested. Sneak attack could easily take a full day to do, assuming the framework is already there.

    And keep in mind that each foray into nwscript is expensive, so doing 100 callbacks per round, per creature can bring the server down really quick. Now, you wouldn't register all hooks, hopefully, but still something to keep in mind. IIRC, Shadooow disabled the OnAttack hook from NWNCX because it caused huge perf issues.
This discussion has been closed.