Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!

Members: 0
Guests: 13
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Possible BUG in check_parry, ...
Forum Rules | Mark all | Recent Posts

Possible BUG in check_parry, check_dodge?
< Newer Topic :: Older Topic > Found in skills.c

Pages:<< prev 1 next >>
Post is unread #1 Jan 30, 2011, 12:31 pm   Last edited Jan 30, 2011, 12:37 pm by GatewaySysop
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Simple thing, but apparently nobody has ever caught it (much less noticed in game)? Surprising but it happens. :redface:

If you look at check_parry and check_dodge, as compared to check_tumble, for example, you'll notice that dodge and parry are both lacking a check for having learned their respective skills. Because the chance is incremented by differences in level, it is theoretically possible for PCs to attempt dodge and parry even though they haven't learned the skill yet. Probably not a good thing. :facepalm:

   else
   {
      if( get_eq_char( victim, WEAR_WIELD ) == NULL )
         return FALSE;
      chances = ( int )( LEARNED( victim, gsn_parry ) / sysdata.parry_mod );
   }

   /*
    * Put in the call to chance() to allow penalties for misaligned
    * clannies.  
    */
   if( chances != 0 && victim->morph )
      chances += victim->morph->parry;

   if( !chance( victim, chances + victim->level - ch->level ) )
   {
      learn_from_failure( victim, gsn_parry );
      return FALSE;
   }


Simple fix is to find this piece:

    if ( IS_NPC(victim) && !xIS_SET(victim->defenses, DFND_PARRY) )
      return FALSE;


And change to this, or similar:

   if ( !IS_NPC( victim ) && !victim->pcdata->learned[gsn_parry] > 0 )
      return FALSE;

    if ( IS_NPC(victim) && !xIS_SET(victim->defenses, DFND_PARRY) )
      return FALSE;


And similarly for check_dodge.

Hope that helps! :cool:
       
Post is unread #2 Jan 30, 2011, 6:26 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I dunno. I think instincts would kick in and even without training you would try and get out of the way or put something in the path. I think the chances of it occurring/succeeding would be greater with training.
       
Post is unread #3 Jan 30, 2011, 6:55 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Kayle said:

I dunno. I think instincts would kick in and even without training you would try and get out of the way or put something in the path. I think the chances of it occurring/succeeding would be greater with training.


I agree, however this is inconsistent with, say, the tumble skill, which does perform the same kind of check. Furthermore, it makes the level restrictions on the skill useless. You have no control over who can use the dodge skill and at what level. :huh:

I have no issue if someone wants to use it as you suggest, where it is available to anyone at any level and any proficiency in the skill. I just don't think that the choice should be made for you by an inconsistency in the code. It would also be confusing, I would think, when people don't have the dodge skill or parry, but they see themselves dodging and parrying on a regular basis (and getting better as their level improves vs. their opponent's) :shrug:

Besides, many skills (punch, kick, bash, stun, fighting styles, etc.) exist where you could make the same argument for instinct / no training, but there is absolutely no way to use them until you've reached the appropriate level and burned the pracs to gain at least some minimal amount of proficiency. Why should dodge and parry be special? That's what I don't get and why I believed this to be a bug. :shrug:

Just my $.02 though, please take it at face value. :wink:
       
Post is unread #4 Jan 30, 2011, 9:29 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

I'd say it's a bug just based on the inconsistency of it. Otherwise why have level restrictions on any skill?

Not that I'd mind, that would be more in line with the Elder Scrolls system where you can do whatever you want to attempt even if you suck balls at it :P
       
Post is unread #5 Jan 30, 2011, 10:26 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

I'm not inclined to so quickly call that a bug. Keep in mind that stock Smaug was based on AD&D in which tumbling is a trained only skill (for theives only at that in the older editions) whereas dodge and parry are skills that fighters and thieves (again, in the earlier editions) could be trained in so that they were better at them than untrained folk, but anyone could attempt those. Thus, this particular discrepany is actually fully in keeping with the pen and paper game that the code was based on, not really a bug. As for the other skills Gateway mentioned, I would be inclined to agree that punch and kick really probably shouldn't be level restricted either, but bash, stun, the fighting stances, etc are sort of more specialized attacks. ...I don't know, maybe it should be classed as a bug since it's inconsistant even if it was so intentionally because other skills that also should've been that way weren't either. I suppose one could argue that, in this case, kick and punch aren't just instictive flailing movements but rather basic martial attacks because even without them you still get a base attack.. in fact, if you're using a weapon, a punch might indeed be a rather special attack form that requires a bit of training, or at least practice, and a kick might also require a bit of balancing act to pull off with some weapons in the middle of a set of otherwise normal weapon based attacks... :shrug: I'm kind of leaning toward it being an admin's call as to how they feel it should be handled in their game, but even that calls for at least pointing it out to new admins as something that needs to be considered and altered if they don't want those two defenses to be "instinctive".
       
Post is unread #6 Jan 30, 2011, 10:59 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Conner said:

I'm not inclined to so quickly call that a bug. Keep in mind that stock Smaug was based on AD&D in which tumbling is a trained only skill (for theives only at that in the older editions) whereas dodge and parry are skills that fighters and thieves (again, in the earlier editions) could be trained in so that they were better at them than untrained folk, but anyone could attempt those. Thus, this particular discrepany is actually fully in keeping with the pen and paper game that the code was based on, not really a bug.


Agreement with pen and paper rules for AD&D is a criteria for being a bug in a FUSS codebase? :blink:
       
Post is unread #7 Jan 30, 2011, 11:22 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

No, it's not, but it does offer up one explanation for why there's an inconsistency since Smaug was in fact based on D&D rules. That could mean the discrepancy was intentional, but it could just mean nobody noticed it.

I'm not sure I'd buy the logic that says parry is a skill you'd "just know" since it's related to weapon use and that generally requires some formal training to get right.

Dodge, maybe, as it could be seen as an instinctive reaction to a threat. Although I suspect the kind of dodge we're talking about here is actually some form of martial arts evasive maneuver.
       
Post is unread #8 Jan 30, 2011, 11:50 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

That's kind of what I was saying about punch and kick too, they're probably intended more as a martial arts style punch/kick than just something one does by instinct.

Gateway, as Samson said, it's not that it makes it not a bug in FUSS, but that it's not a "bug" if it was done that way intentionally because it was trying to mimic the pen and paper game's combat rules. The trouble is that, at this point even the oiginal devs my simply not remember what they were thinking about that particular bit of code at the time so we can only speculate on what it should be and try to come to a consensus on how it needs to be from this point forward.
       
Post is unread #9 Jan 31, 2011, 1:15 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

I noticed this long long ago lol. I've never considered it a bug though so didn't fix it. Much like conner I figured that one was done intentionally. I do also agree on it being seen as an inconsistency though since there were never any comments stating other wise.
       
Post is unread #10 Jan 31, 2011, 4:56 pm   Last edited Jan 31, 2011, 4:57 pm by GatewaySysop
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Well, if you're convinced it's not a bug, perhaps someone can enlighten me on one thing. Not trying to stir the pot, but humor me here.

If you code this and specifically check for 0 to prevent incrementing chances when chances = 0,

   if( chances != 0 && victim->morph )
      chances += victim->morph->parry;


Why would you then code the call to chance( ) like this:

   if( !chance( victim, chances + victim->level - ch->level ) )
   {
      learn_from_failure( victim, gsn_parry );
      return FALSE;
   }


and do the exact opposite by potentially allowing 0 to be incremented?

Either you want it to stay 0 or you don't, but it doesn't make sense to have it both ways, does it? Why let level differences play a role at 0 skill but not morphs?

And, bonus points, can anyone explain why we have a call to 'learn_from_failure( ) for a skill that the player might not even have? Do you really think someone intended to needlessly do this for anyone who didn't possess the skill? That seems wasteful at best. :blink:

To each his own, but to me it seems like something needs to be fixed here. Either fix the function to check for the skill, or allow morphs to have an impact and dispense with trying to learn from failure on a skill that you might not have in the first place. Can we agree on one or the other at least? :shrug:
       
Post is unread #11 Jan 31, 2011, 5:14 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005


Samson said:

I'm not sure I'd buy the logic that says parry is a skill you'd "just know" since it's related to weapon use and that generally requires some formal training to get right.
<br />

<br />
Dodge, maybe, as it could be seen as an instinctive reaction to a threat. Although I suspect the kind of dodge we're talking about here is actually some form of martial arts evasive maneuver.


My view on dodge is the same. The kind of instinctive dodge that has been mentioned, I think anyway, would be covered by cases where your attacker misses you. Unless you think the victim just stands perfectly still without having the dodge skill and waits to be hit. :blink:
       
Post is unread #12 Jan 31, 2011, 5:24 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

The whole combat system is full of inconsistencies like these, and if we started looking at it all from a standpoint of what is instinctive and what isn't, and what qualifies as instinctive and what doesn't, we're going to end up tearing up the whole combat system and try and rewrite it, and, yeah, I'm in the middle of a big enough project at the moment, that I really don't want to think about anything that could lead towards rewriting combat to be less inconsistent.
       
Post is unread #13 Jan 31, 2011, 6:14 pm   Last edited Jan 31, 2011, 6:15 pm by GatewaySysop
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Kayle said:

The whole combat system is full of inconsistencies like these, and if we started looking at it all from a standpoint of what is instinctive and what isn't, and what qualifies as instinctive and what doesn't, we're going to end up tearing up the whole combat system and try and rewrite it, and, yeah, I'm in the middle of a big enough project at the moment, that I really don't want to think about anything that could lead towards rewriting combat to be less inconsistent.


We're getting waaaay off base from my bug report and its 2-line fix, but for what it's worth I'm just going to agree to disagree at this point. The post is out there for anyone that cares to change their code and I've done my best to present my argument from a programming standpoint for why they might want to do that. To each his own, I guess. :huh:

I'll post up whatever else I find that's still a bug in SmaugFUSS at this point, maybe I'll have better luck with those. :wink:
       
Post is unread #14 Jan 31, 2011, 6:22 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

From the looks of it, NPCs get one default chance and so do PCs (as long as the PC is wielding something). So they don't know it and have 0 for chances. If chances aren't 0 and they are morphed add in morph->parry. Then give them a chance to parry based on chances + their level + attacker level (So (well go with a level 10 victim and level 5 ch) 0+10-5) so they get a 5 for chance. If they fail chance then learn_from_failure (If they don't know it, it stays 0 so no biggy).

It's a good find Gateway and don't think any of us are really getting on to you about it. There were quite a few standard things that at one time were set up to be skill based and later decided it should be more of a default thing. Take Backstab for example, etc.... This was one of those things that always struck me as a basic one that just if you learn it you get better at it. As for doing it and not learning it though It is fairly small chance unless your level is way higher then something lower and then chances are they will die on your first swing anyways and you won't get a chance to dodge their attack.

GL on more finds later :) I'll probably decide on some change for it later too, just to be more consistent also. Thanks for posting it.
       
Post is unread #15 Jan 31, 2011, 6:30 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005


Remcon said:


GL on more finds later :) I'll probably decide on some change for it later too, just to be more consistent also. Thanks for posting it.


Quite welcome. :cool:
       
Post is unread #16 Feb 6, 2011, 8:37 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

GatewaySysop said:

Unless you think the victim just stands perfectly still without having the dodge skill and waits to be hit. :blink:

As Remcon said, I really don't think anyone here's trying to give you a hard time about it, it is a good find since there's a problem with it no matter how you feel it ought to be as you've already pointed out, but I did want to make one remark about the comment I've quoted. We routinely call that a "deer in the headlights" effect around here. It does happen that someone with no training and the wrong natural bent will literally freeze up and doing absolutely nothing to defend themselves because of sheer terror even while someone else with a different natural bent will attempt to flee or dodge or even fight back from that same sheer sense of terror. (sorry about the late response, this last week has been havoc on my internet through the storms and the rolling blackouts and ... and what spare time I've had when there wasn't storm activity has been needed for errands that couldn't be run while there was. :shrug: )
       
Post is unread #17 Feb 8, 2011, 6:05 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Conner said:


It does happen that someone with no training and the wrong natural bent will literally freeze up and doing absolutely nothing to defend themselves because of sheer terror even while someone else with a different natural bent will attempt to flee or dodge or even fight back from that same sheer sense of terror.


I don't want to continue beating this poor dead horse any further over semantics or anything else. Can we just agree to disagree like I said before? :huh:

I've made my case and highlighted what I thought wasn't correct. That's all I'm able to do. Some things aren't worth a fight, no pun intended given the present context, and I never wanted it to be a fight anyway. My only interest was sharing info with other SMAUG coders that I thought would be useful. Let's leave it at that. :wink:


       
Pages:<< prev 1 next >>