Author Topic: Weapon Switching Exploit  (Read 1237 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #15 on: August 30, 2015, 10:15:41 pm »


               

Just a quick thought....


 


Since SetBaseAttackBonus() doesn't work on PCs, would this function work to reduce the PC's attacks to 1 for one round?


 


 


void ReduceAttacks(object oTarget)

{

    int nAttacks = GetBaseAttackBonus(oTarget);

    int nModify = 0 - (nAttacks -1);

    effect eAttack = EffectModifyAttacks(nModify);

    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAttack, oTarget, 1.0);

}

               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #16 on: August 30, 2015, 10:24:38 pm »


               


Really?  So if an orc is charging at me and I shoot at it with a bow until it reaches melee range and then I pull out a sword and shield, you think I should be effectively stunned for 6+ seconds?


 


I thought the concern here was people getting extra attacks that they shouldn't, through a method I'm trying not to elaborate on here.  But it seems to me at least that not punishing people who *aren't* trying to exploit should be one of the main priorities.




as mad poet said, in DnD you wouldnt be allowed to do this anyway, the problem I see is something I encountered on epic action loot server both as DM and player


 


most players carry at least 10 items they are swapping by situation, thats all right when it comes to the weapons etc. but then there are players that have over 40 such items, and they change the whole equip in one second, hell even I am doing that, my main char has 6 rings Im swapping by situations, one for sneak attack, 3 to get resist 30 on one element, +6 saves one and +4 regeneration. Then 3 amulets, my main one, one with +20 taunt, and +7 saves one. Im also swapping bracers, usually going with HIPS bracers, swappng for damage reduction 10/+5, +30 concentration and then bracers with blind fight- And thats my wiz/AA build where I cant really swap weapon as I can fight only with bow, bards and WMs really utilizing around 30 such items and they are able to change 15 of them just when fighting boss creature for no penalty, as the server in question doesnt even use clearallactions. This is not okay in my opinion. Its too beneficial, and some of the cases are really ridiculous like when this bard goes with improved expertise, then swap cloak for +30 perform, then curse enemies, then swap back for charisma cloak, then use divine shield and cancel expertise, then swap cloak to the one he uses normally ie. regen, then swap weapon with MD onhit to dispel enemies divine favor they casted, then swap on main weapon, then swap bracers that gives him disarm and disarms their weapons, then he swap for strength bracers and equip chaotic shield as now they dont do damage. Repeat for every encounter lol.


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #17 on: August 30, 2015, 10:32:42 pm »


               


 


Just a quick thought....


 


Since SetBaseAttackBonus() doesn't work on PCs, would this function work to reduce the PC's attacks to 1 for one round?


 


 


void ReduceAttacks(object oTarget)

{

    int nAttacks = GetBaseAttackBonus(oTarget);

    int nModify = 0 - (nAttacks -1);

    effect eAttack = EffectModifyAttacks(nModify);

    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAttack, oTarget, 1.0);

}

 




it does work for players


 


from readme to the CP 1.71: Note for SetBaseAttackBonus function corrected to inform it does works for PC actually.


               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #18 on: August 30, 2015, 11:09:56 pm »


               

Shadooow so the coding would look something like this for the OnEquip and OnUnEquip events?


 


....


 


SetBaseAttackBonus(oPC, 1);


DelayCommand(6.0, RestoreBaseAttackBonus(oPC)));


 


....



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #19 on: August 30, 2015, 11:49:21 pm »


               


Shadooow so the coding would look something like this for the OnEquip and OnUnEquip events?


 


....


 


SetBaseAttackBonus(oPC, 1);


DelayCommand(6.0, RestoreBaseAttackBonus(oPC)));


 


....




yes that should work, just need to use restorebaseattackbonus also in OnClientEnter to fix players who logged off during the 6.0 delay


               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #20 on: August 31, 2015, 12:02:17 am »


               


yes that should work, just need to use restorebaseattackbonus also in OnClientEnter to fix players who logged off during the 6.0 delay




 


Thanks, didn't think of that.


               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #21 on: September 07, 2015, 09:14:19 am »


               

How much can one person reasonably do in six seconds? I doubt make four attacks, ready a shield, and sheathe (cause they don't drop them) a previously held weapon, and draw a new one. Too much.


Where did I even mention four attacks? I'm talking about a low level character with 1 attack per round. He fires a shot, sees that the enemy will be in melee range soon, and spends the next few seconds switching weapons. According to Shadow he should be flatfooted for 1+ rounds -- meaning he'll go a minimum of 12 seconds between attacks.

0: Fire bow
1: decide to switch, become flat footed
4: enemy enters melee range, still flat footed
6: would do a melee swing now but still flat footed
7: flat footed wears off but have to wait until start of next combat round to attack since enemy is meleeing him
12: first melee swing

Also, why are you assuming the weapon is sheathed? Under NWN rules a 16 strength character could be wearing full plate armor, be carrying 11 Greatswords, and still have another 15 pounds for assorted equipment before being encumbered. Are those 11 Greatswords all sheathed? Give that fighter Bull's Strength (DnD version for flat +4 or at least a 4-5 bonus in NWN) and he can now carry the full plate, 23 Greatswords, and still have a few pounds of capacity left over. And this is all achievable at level 1 with a buff potion or with a level 2 universal spell -- not even getting into the ridiculous results you get later on.

A lot of things are abstracted out of necessity in things like NWN. Firing a shot and placing the bow on the ground while grabbing a set-up sword(or other melee weapon) to fight in close quarters? Doable quite quickly -- and I'm thinking of actual historical battles like this one:

"As the French Vanguard drew closer to the English position, they found themselves brought under ever more intense and effective archery fire from the flanking wings and wedges of longbowmen. Arrows fell like hail, finding creases in armor, or at closer ranges piercing mail and the lighter armor on arm or leg. Lowering their heads so to protect their vulnerable eye-slots from chance arrow, the French edged away from the arrow storm to either flank; bunching ever tighter till their line began to resemble instead three deep columns approaching the English men-at-arms like the forks of a trident.

Now the very heavy armor that the French counted upon to provide some measure of protection against the galling English archery undermined their attack. In the soft clay-based mud, the heavily armored knights sank up to their calves; advancing only at a slow and exhausting pace. When the French Van reached the English line, they were already winded from this exertion.

At last at close-quarters, the French mass pushed into Henry’s line; the sheer weight of their numbers pushing the English back several yards. But as the furious melee bogged down to a slogging match, the English archers took up the heavy sledge hammers they had used to pound in their stakes; and charged into the slow-moving, quickly tiring French. Such heavy mallets crushed armor or concussed the man beneath. Unencumbered by armor, the lightly armed archers were able to swarm over and slaughter the French Chivalry, much less effected by the mud."

Those English archers weren't carefully sheathing bows on their back or anything. And if we're really trying to get into realism here...why is 99 arrows the default stack size and why do people carry hundreds of thousands of them?

This is not okay in my opinion. Its too beneficial, and some of the cases are really ridiculous like when this bard goes with improved expertise, then swap cloak for +30 perform, then curse enemies, then swap back for charisma cloak, then use divine shield and cancel expertise, then swap cloak to the one he uses normally ie. regen, then swap weapon with MD onhit to dispel enemies divine favor they casted, then swap on main weapon, then swap bracers that gives him disarm and disarms their weapons, then he swap for strength bracers and equip chaotic shield as now they dont do damage. Repeat for every encounter lol.


So...

1, don't allow swapping of non-weapons in combat (not literally the combat check but within a certain distance of an enemy or if a nearby enemy had perceived you or something)

and/or

2, don't create items that encourage that sort of behavior

Again, this goes back to my original statement: find a solution that doesn't hurt people playing legitimately.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #22 on: September 07, 2015, 11:21:08 am »


               


Again, this goes back to my original statement: find a solution that doesn't hurt people playing legitimately.




 


Hence, my "solution" opted to just reduce attacks to one for one round and includes a module switch to bypass the "solution" for those Builders that don't like it.


 


BTW, that is an excellent example you give, but it doesn't really address the original point of just "...how much can you do in 6 seconds?" in NWN. In your example the archers dropped their bows then took up mallets (which were lying all along their line or just behind it) - an action that would have approximated to more than one round in DnD terms (i.e drop bow, move to mallet, pickup mallet, ready weapon, attack enemy). In NWN, characters don't drop weapons when they are unequipped, they are placed in inventory, and continue to be readily available. However, the exploit allows you to do way more in that 6 seconds then the game was intended to allow - hence, its an exploit.



               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #23 on: September 07, 2015, 06:37:26 pm »


               


Where did I even mention four attacks? I'm talking about a low level character with 1 attack per round. He fires a shot, sees that the enemy will be in melee range soon, and spends the next few seconds switching weapons. According to Shadow he should be flatfooted for 1+ rounds -- meaning he'll go a minimum of 12 seconds between attacks.


0: Fire bow

1: decide to switch, become flat footed

4: enemy enters melee range, still flat footed

6: would do a melee swing now but still flat footed

7: flat footed wears off but have to wait until start of next combat round to attack since enemy is meleeing him

12: first melee swing


.........




 


As you say it is an approximation. DnD generally assumes your character swings a sword way more than 1 time in a six second span. Only one of those attacks are counted in actual combat. No one is going to swing once, wait six seconds, swing again. As your level, and thus your skill, increases you gain more attacks, approximating ones skill increasing in combat. 


 


Carrying 11 greatswords... well... it depends on how you play PnP. Characters should only be able to carry one greatsword logically. I've seen DM's handle this differently. My way is just by saying you can carry up to 25 lbs of weapons on you at any one time. I find it the easiest method as it allows a player to carry two different greatswords and a dagger, which I think is more than enough for one player. Another DM I played with allowed only one weapon on the back, two on the flanks (one-handed only), and four small weapons anywhere else. That worked fine too. I've played games where the DM let players carry 11 greatswords.... they were likely VERY encumbered considering that is 132 lbs of sword... but that's another issue.


 


Regardless of how many weapons you have any weapon that is not in your hands at the start of combat is considered not drawn and at the ready. Requires a move action to ready that weapon. To put a weapon away to be drawn later is a move action (sheathing, or whatever method you want to use), and it draws an attack of opportunity. Dropping a weapon on the floor is a free action. So if you want to put a weapon into your 'Inventory' and draw another weapon it would take 2 move actions, or basically require all of your actions for that turn. Simply drop the weapon in hand and draw the next and you can make one attack. Either way you will not get a full attack action, which limits you to only one attack in that round.


 


Clearing all actions and leaving them flat-footed for a moment is more than fair considering the PnP way of putting away a weapon and drawing another would keep them from attacking at all and invoke an AoO. 


 


Like I said though, many people consider trying to match PnP methods in NWN a bad idea. I'm not attached to them, but I feel it is better to default there unless someone comes up with a better idea.


               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #24 on: September 16, 2015, 07:59:00 pm »


               

Hence, my "solution" opted to just reduce attacks to one for one round and includes a module switch to bypass the "solution" for those Builders that don't like it.


Indeed, I was mostly talking about Shadoow's "I think people should be stunned for a minimum of six seconds" quote.
 

In NWN, characters don't drop weapons when they are unequipped, they are placed in inventory, and continue to be readily available. However, the exploit allows you to do way more in that 6 seconds then the game was intended to allow - hence, its an exploit.


Exactly -- any weapon unequipped is in an equivalent state to any other weapon in your inventory.

My point is that the whole "inventory" idea is a massive abstraction for sanity's sake in a game -- I strongly disagree with the notion that "unequipping" a weapon is equivalent to "sheathing" it, for example (and you seem to agree with me on this). Unless someone wants to try to argue that every single weapon in their inventory is also sheathed...and that still brings up massive questions about entire suits of armor even if we get past the problem of over 20 Greatswords in sheathes. Whatever your equipped weapon(s) is/are, it's "sheathed" when not being actively used.

Things like the Dragon Age series show this quite clearly while NWN didn't have the technology to animate it as easily -- see stuff like this random video. You're running around with your sword and shield sheathed/stowed. See an enemy, draw your weapons, and attack -- but that sword and shield are *equipped* the entire time and the game handles the sheath/stowing animations before and after combat. Is the 0.5 seconds it took the DA character to pull out the sword/shield probably a bit unrealistic? Sure, but I don't see that "realistically" translating into 6+ seconds or something.

The example I gave also had nothing to do with the exploit. I was talking about wanting to fire a shot at the beginning of round one, switch to a melee weapon, and then take my first melee swing at the start of round two. Which is not the exploit being discussed (or any exploit at all).
 

As you say it is an approximation. DnD generally assumes your character swings a sword way more than 1 time in a six second span. Only one of those attacks are counted in actual combat. No one is going to swing once, wait six seconds, swing again. As your level, and thus your skill, increases you gain more attacks, approximating ones skill increasing in combat.


Except your AB increasing is already approximating ones skill increasing in combat (along with other things like damage per hit and crit chance). If your statement is correct, then why not have multiple attacks per round early on?

While I'm not a medieval knight or fantasy warrior, I have done a few types of swordplay ranging from martial arts to fencing to even some medieval style combat (with padded weapons so bruises are (hopefully but not always) the worst thing that happens). Something very common across those (especially as a beginner) is that you aren't actually attacking a lot of the time -- you're maneuvering, watching your opponents, and looking for an opportunity to strike. As you get more comfortable you're able to strike/recover more quickly and see more opportunities to launch an attack, even if some of those opportunities aren't as good. To me that's what the increasing attacks (at progressively *lower* AB, mind you) represent -- the ability to (relatively safely) strike more often at the cost of those extra attacks not being as good as the "best" attack.

I just searched YouTube for "medieval combat" and this was one of the top results -- I don't know what the rules/gear/etc are but apparently it's some international event. Even if you just watch 20-30 seconds of that you'll notice that people aren't actually swinging that much unless they have a massive opening (like a target with their back turned who's being grappled by a teammate or something). It's not Flynning where you're constantly swinging at the other person's weapon or something. And yes, you might do some things like feints and parries but those aren't actual strikes at the opponent intended to hit -- the feint is to try to open up an opportunity to land an "actual" swing and thus it makes sense it wouldn't be rolled as an actual attack.
 

My way is just by saying you can carry up to 25 lbs of weapons on you at any one time. I find it the easiest method as it allows a player to carry two different greatswords and a dagger, which I think is more than enough for one player.


Er, by my calculations that'd be 31 pounds. 2 * 15 + 1 = 31. Or do you mean 25 pounds in addition to whatever is equipped?
 

Simply drop the weapon in hand and draw the next and you can make one attack. Either way you will not get a full attack action, which limits you to only one attack in that round.


Which is all I was even hoping for in my example as you might recall. Fire one bow shot, spend rest of round switching to melee weapons, start next round in melee. Shadow was talking about stunning me for 6+ (emphasis on the +) seconds upon switching after the bow shot...which not only costs me any remaining attacks in the current round (fair) but also every attack in the next round (not so fair). And that's assuming the minimum of 6 seconds.
  

Like I said though, many people consider trying to match PnP methods in NWN a bad idea. I'm not attached to them, but I feel it is better to default there unless someone comes up with a better idea.


The better idea in NWN is just to transition smoothly when swapping from melee to ranged? From what I understand (referring to both this thread and other discussions) the concern is about literally gaining *extra* attacks that should not exist in the first place (as in you have two attacks per round but use weapon switching to gain three or more attacks, for example). That's the exploit.
               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #25 on: September 16, 2015, 08:23:56 pm »


               



Except your AB increasing is already approximating ones skill increasing in combat (along with other things like damage per hit and crit chance). If your statement is correct, then why not have multiple attacks per round early on?


While I'm not a medieval knight or fantasy warrior, I have done a few types of swordplay ranging from martial arts to fencing to even some medieval style combat (with padded weapons so bruises are (hopefully but not always) the worst thing that happens). Something very common across those (especially as a beginner) is that you aren't actually attacking a lot of the time -- you're maneuvering, watching your opponents, and looking for an opportunity to strike. As you get more comfortable you're able to strike/recover more quickly and see more opportunities to launch an attack, even if some of those opportunities aren't as good. To me that's what the increasing attacks (at progressively *lower* AB, mind you) represent -- the ability to (relatively safely) strike more often at the cost of those extra attacks not being as good as the "best" attack.


I just searched YouTube for "medieval combat" and this was one of the top results -- I don't know what the rules/gear/etc are but apparently it's some international event. Even if you just watch 20-30 seconds of that you'll notice that people aren't actually swinging that much unless they have a massive opening (like a target with their back turned who's being grappled by a teammate or something). It's not Flynning where you're constantly swinging at the other person's weapon or something. And yes, you might do some things like feints and parries but those aren't actual strikes at the opponent intended to hit -- the feint is to try to open up an opportunity to land an "actual" swing and thus it makes sense it wouldn't be rolled as an actual attack.




 


Why can't both be approximations of improved skill?


 


I can't quote it, but I do recall Monte Cook, or Skip Williams, or one of those people responsible for 3.0 design talking about just this thing at some point. I think I recall it in dragon magazine or something.


 


Either way trying to match reality point for point is pointless (HA!). If it was perfect most people would drop with one good attack. Since that would be as fun as dental work I'll just appreciate the fantasy of it '<img'>


 



 


MagicalMaster, on 16 Sept 2015 - 2:59 PM, said:


 


Er, by my calculations that'd be 31 pounds. 2 * 15 + 1 = 31. Or do you mean 25 pounds in addition to whatever is equipped?



 


Actually we're both wrong. I was referring to PnP weight, not NWN. Obviously restricting a character to 25 lbs of weapons in NWN would be a major hindrance. Greatsword is 8 lbs in PnP, while the Greataxe is 12 like I was thinking. 


 


 



 


MagicalMaster, on 16 Sept 2015 - 2:59 PM, said:


 


Which is all I was even hoping for in my example as you might recall. Fire one bow shot, spend rest of round switching to melee weapons, start next round in melee. Shadow was talking about stunning me for 6+ (emphasis on the +) seconds upon switching after the bow shot...which not only costs me any remaining attacks in the current round (fair) but also every attack in the next round (not so far). And that's assuming the minimum of 6 seconds.



 



 


I don't particularly like that solution either, but it's not inherently unfair 'IF' the person is trying to use the exploit. Personally I like the ClearAllActions approach. Stops the exploit and doesn't harshly punish people who are switching weapons for reasons like trying to pick a better one.


 



 


The better idea in NWN is just to transition smoothly when swapping from melee to ranged? From what I understand (referring to both this thread and other discussions) the concern is about literally gaining *extra* attacks that should not exist in the first place (as in you have two attacks per round but use weapon switching to gain three or more attacks, for example). That's the exploit.



 


Yeah, which I feel that ClearAllActions fixes the exploit while also bringing it closer to PnP without being overly complicated. 


               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #26 on: September 16, 2015, 09:30:43 pm »


               

Thanks for the clarification MM, your position is much clearer to me now and definitely makes sense. Losing the rest of one round's actions is one thing, but losing a potential two rounds of action would be too much penalty for just switching a weapon out.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #27 on: September 17, 2015, 08:29:18 am »


               

Which is all I was even hoping for in my example as you might recall. Fire one bow shot, spend rest of round switching to melee weapons, start next round in melee. Shadow was talking about stunning me for 6+ (emphasis on the +) seconds upon switching after the bow shot...which not only costs me any remaining attacks in the current round (fair) but also every attack in the next round (not so fair). And that's assuming the minimum of 6 seconds.



 


what I wrote is this:



Personally I would like to delay all equip/unequip calls and make player flatfooted doing some action for 1+ rounds at least.



Doing some action != be stunned, just performing some looping anim that you can anytime cancel (but then equip action wont be performed).


 


The effec I would like to achieve is exactly this.



 


Fire one bow shot, spend rest of round switching to melee weapons, start next round in melee.



 


And btw your advice of not making an item that tempt players into swapping is maybe possible on a low magic world where are items extremely expensive and rare, not in high magic world where are thousands of items to make equip support for every possible build and where items are main focus,. ie. finding better and better items.



               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #28 on: September 29, 2015, 08:25:36 pm »


               


just add


 


AssignCommand(oPC, ClearAllActions()); somewhere in the top of your OnEquip and OnUnEquip scripts.




 


Been looking at trying this, but I'm curious if there is a specific reason you wouldn't use ClearAllActions(TRUE) to stop combat for the PC, instead of just ClearAllActions()?


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Weapon Switching Exploit
« Reply #29 on: September 29, 2015, 08:32:50 pm »


               


Been looking at trying this, but I'm curious if there is a specific reason you wouldn't use ClearAllActions(TRUE) to stop combat for the PC, instead of just ClearAllActions()?




the TRUE parameter cancels "the combat state" which would interfered with things like initiative, armor equipping and death attack.