Jump to content

lowest-overhead way to detect and respond to proficiency values


subtledoctor

Recommended Posts

Example of desired outcome: use a proficiency as a "Dodge" feat. Each pip you put in it will give you a 1-point bonus to AC.

Possible methods:

1) A permanent repeating effect casting a spell every round. The spell has five op326 effects. Each one checks against the value of the proficiency, and if it is 'true' (the prof value is  equal to or greater than 1, 2, 3, 4, or 5), then it casts a subspell. The subspell gives an AC bonus and applies op206 protection against itself.

Pros:  simple. Cons: the repeating spell will return 'true' every six seconds and constantly try to cast up to five subspells. (And this will be expanded, this could ultimately be more  like 100 subspells  for various different effects.) The subspells won't take effect because of the op206 effects... but the repeating spell will constantly try to cast them. Seems like it  would take a toll on the engine performance.

2) A permanent repeating effect casting a spell every round. The spell has five op326 effects. Each one checks against the value of a higher, unused bit in the proficiency ((1 << 8), (2 << 8), etc.), and the value of the proficiency.  If the higher-bit check is false and the proficiency check is true, it casts a subspell.  The subspell applies the AC bonus, and sets the appropriate value of the second bit of the proficiency stat (e.g. (1 << 8)).

Pros:  The repeating spell will almost always return false, so it will not constantly try to cast subspells. So it should have low overhead.  Cons: This would use up as many as five bits in the second byte of each proficiency stat used in this system. I plan to use about 10 stats, so this would tie up ~50 bits that could no longer be used by other mods. There would still be 300+ more... still, 50 is kind of a lot.

3) Add a block to baldur.bcs, checking Player1 for a Local Variable = 0 and the proficiency value. If true, it would apply the subspell to Player1. The subspell would apply the AC bonus, and set the local variable to 1. Add identical blocks for Player2 through Player6, and for the four other ranks in this proficiency, and for the nine other proficiencies I want to use like this.

Pros: low overhead, I think, since all these checks will almost always return false. And this would not use any stat bits, but only a bunch of local variables, which are a functionally infinite resource. Cons: It means adding (6x5x10) ~300 blocks to baldur.bcs. I assume it's low overhead if all those checks are always false... but still, that's a lot of stuff to add to the game script. I think it's a fairly conscientious way of doing it, but still, I've never done that before and I'm not sure I want to.

Thoughts?

Link to comment
6 minutes ago, morpheus562 said:

Some can be applied directly to the item (weapon, armor, accessory, etc.) and checked via on-equip. This is the lowest overhead approach.

Heh, yeah, once upon a time I had an idea to zero out wsepcial.2da and wspatck.2da, and apply all proficiency-based bonuses by equipping effects. it would add some flexibility... but the benefits never seemed to outweigh the costs.

But this would involve combat-adjacent bonuses that would not be dependent on weeapons. Similar to some of the stuff you have in Skills & Abilities, in fact... I haven't looked at how you do it there...

Link to comment

I use a few different methods. Armor prof applies directly to the armor, shield prof applies to shields, updated 2h weapon prof applies directly to 2h weapons, archery weapon style applies directly to ranged weapons (while excluding ammo since Item Revisions makes ammo use the same prof points as the launcher), and opcode 177 (use eff) gets added to clab files.

Link to comment

Wait wait wait... I'm going crazy. I don't know why I was operating with the assumption that proficiencies wouldn't be picked up in time to affect CLAB-applied spells. But they are! So I can just have a detection spell fire once after each level-up,  and it will catch and apply any new proficiency-driven effects.

I don't know what kind of mental block I was having before. But this simplifies things considerably.

Link to comment

Will that option work for enemies since they start at a level instead of going through the level screen? Enemies getting to use the new profs was one of my requirements, and if they can with it once during level up, then that is a great benefit. What about level drain? Will that remove anything then since it's set for the level? For what is worth, I've ran tests with six fighter/mage/clerics and decked out in profs with no ill processing effects since that was also one of my concerns with the route I chose. Only issue I saw was I had a type of memory leak in an early draft version that kept assigning new eff's of the same prof and after about a hundred or so checks at once did it start to slow down.

Edited by morpheus562
Link to comment
9 hours ago, morpheus562 said:

Will that option work for enemies

Only options 1 and 2 from the initial post will work for enemies.  Every creature in the game gets a repeating spell that evaluates stats and applies effects reactively. This is what Scales of Balance does to apply modified ability score bonuses to enemies.

But for proficiencies... I'll do some moderate proficiency combinations, like putting bastard swords and long swords together. So maybe my 'Dodge' feat will use the old bastard sword proficiency. The code will run through every enemy and, if they had specialization in bastard swords, I will move that over to specialization in the long sword spec - that way they will still be expert in using the weapon they have equipped. Then I will zero out their bastard sword proficiency, because there is no reason to think someone specialized in bastard swords will have ranks in the Dodge feat. So I will have to run through enemies manually and decide which ones should have these feats. And as long as I'm handling them manually... I can forgo the proficiency stats entirely and just apply a brute AC bonus. (Or do both, so the .CRE file comports with my new system if it ever gets inspected in NI, or something.) I'm still working on this but at the moment I'm coding all the  bonuses with the "first effect is op321" design,so I'm not worried if something gets applied twice for some reason. (Go ahead and ctrl-Q that NPC  and level him up... his Dodge proficiency will work as intended.)

The biggest issue I anticipate with this (after having the idea about an hour ago) is that several of my mods have a "bonus proficiency by dialogue" feature, where you can  bump up a proficiency at a time when you're  not levelling up. So I'll need to run my prof-detection spell manually as part of those dialogues.

Edited by subtledoctor
Link to comment
1 hour ago, subtledoctor said:

Only options 1 and 2 from the initial post will work for enemies.  Every creature in the game gets a repeating spell that evaluates stats and applies effects reactively. This is what Scales of Balance does to apply modified ability score bonuses to enemies.

But for proficiencies... I'll do some moderate proficiency combinations, like putting bastard swords and long swords together. So maybe my 'Dodge' feat will use the old bastard sword proficiency. The code will run through every enemy and, if they had specialization in bastard swords, I will move that over to specialization in the long sword spec - that way they will still be expert in using the weapon they have equipped. Then I will zero out their bastard sword proficiency, because there is no reason to think someone specialized in bastard swords will have ranks in the Dodge feat. So I will have to run through enemies manually and decide which ones should have these feats. And as long as I'm handling them manually... then I can forgo the proficiency stats entirely and just apply a brute AC bonus. (Or do both, so the .CRE file comports with my new system if it ever gets inspected in NI, or something.) I'm still working on this but at the moment I'm coding all the  bonuses with the "first effect is op321" design,so I'm not worried if something gets applied twice for some reason. (Go ahead and ctrl-Q that NPC  and level him up... his Dodge proficiency will work as intended.)

The biggest issue I anticipate with this (after having the idea about an hour ago) is that several of my mods have a "bonus proficiency by dialogue" feature, where you can  bump up a proficiency at a time when you're  not levelling up. So I'll need to run my prof-detection spell manually as part of those dialogues.

That is a good point. I do go through all enemies, evaluate profs, count them, then reassign to what the new category is. I then go through and assign new profs based on their level. Feel free to take a look at how I do it, but applying spell effects directly is definitely something to think on.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...