Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > King's Bounty > King`s Bounty: Warriors of the North

King`s Bounty: Warriors of the North Next game in the award-winning King’s Bounty series

Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2012, 09:22 PM
Bhruic Bhruic is offline
Approved Member
 
Join Date: Oct 2012
Posts: 233
Default

Quote:
Originally Posted by camelotcrusade View Post
I don't think I've been critted now that you mention. And I actually think we see the sense weakness text come up when we should have been critted but we aren't.

Just last night the AI cast DOOM on my wolves (ermahgerd attack the summons?!!) and when they were hit by the enemy they were not criticaled. I did see the sense weakness appear in the text, though.

Does that help?
Yup. Ha. And people were complaining about spells/rage not doing critical hits. The poor enemy wasn't getting crits for anything!
Reply With Quote
  #2  
Old 10-31-2012, 09:52 PM
camelotcrusade's Avatar
camelotcrusade camelotcrusade is offline
Approved Member
 
Join Date: Apr 2009
Location: San Francisco, CA
Posts: 448
Default

Oh dear. Double facepalm.

So how should we bug this one? Sense Weakness prevents critical hits from enemies? It's kind of a whopper if we are understanding this correctly.

Edit: Attempt at an entry.
  • Sense Weakness bug appears to prevent enemy critical hits: A look at the sense weakness code (link to thread) reveals an error where sense weakness is effectively preventing enemies from inflicting critical hits - but only if you don't have any ranks in the skill. When they would normally inflict a crit you instead see a "sense weakness" mention in the combat log and the crit is averted. Some players are also reporting they never been hit with a crit.

I'll just replace what I have in the thread now with this.

Last edited by camelotcrusade; 10-31-2012 at 10:36 PM. Reason: Added bug text
Reply With Quote
  #3  
Old 10-31-2012, 10:30 PM
Zechnophobe's Avatar
Zechnophobe Zechnophobe is offline
Approved Member
 
Join Date: Nov 2009
Posts: 991
Default

Code:
    
 iskrit = ( kritProbRnd < kritProb )
      if iskrit then
        if receiver_human and not receiver_glot then
          kritProb = kritProb - skill_power("weakness_lore", 2)
          if kritProbRnd < kritProb then
            iskrit = true
          else
            iskrit = false
            is_weakness_lore = true
          end
        end
      end
Logic was just all topsy turvy. They intend to check IF IT IS STILL A CRIT, but instead of letting it be a crit, they instead cancel it. I believe the above should fix it unless I'm misremembering lua 'else' syntax.
Reply With Quote
  #4  
Old 10-31-2012, 10:39 PM
camelotcrusade's Avatar
camelotcrusade camelotcrusade is offline
Approved Member
 
Join Date: Apr 2009
Location: San Francisco, CA
Posts: 448
Default

Nice, Zechnophobe. I'll link to it once it's confirmed and Bhruic adds it to the summary. Too bad getting crit isn't easy to test. You almost need to keep a save near a hero who casts doom.
Reply With Quote
  #5  
Old 10-31-2012, 10:57 PM
Bhruic Bhruic is offline
Approved Member
 
Join Date: Oct 2012
Posts: 233
Default

Quote:
Originally Posted by Zechnophobe View Post
Code:
    
 iskrit = ( kritProbRnd < kritProb )
      if iskrit then
        if receiver_human and not receiver_glot then
          kritProb = kritProb - skill_power("weakness_lore", 2)
          if kritProbRnd < kritProb then
            iskrit = true
          else
            iskrit = false
            is_weakness_lore = true
          end
        end
      end
Logic was just all topsy turvy. They intend to check IF IT IS STILL A CRIT, but instead of letting it be a crit, they instead cancel it. I believe the above should fix it unless I'm misremembering lua 'else' syntax.
Well, what they were trying to do is check if Sense Weakness would prevent it from being a crit. Which they did correctly. Unfortunately what they didn't do is consider the case where you didn't have Sense Weakness.

Your code does mostly fix it, but I already posted a different fix in the main post. Both do roughly the same thing but different ways. The main point is that it should be working correctly now.
Reply With Quote
  #6  
Old 10-31-2012, 11:04 PM
Zechnophobe's Avatar
Zechnophobe Zechnophobe is offline
Approved Member
 
Join Date: Nov 2009
Posts: 991
Default

Quote:
Originally Posted by Bhruic View Post
Well, what they were trying to do is check if Sense Weakness would prevent it from being a crit. Which they did correctly. Unfortunately what they didn't do is consider the case where you didn't have Sense Weakness.

Your code does mostly fix it, but I already posted a different fix in the main post. Both do roughly the same thing but different ways. The main point is that it should be working correctly now.
Heh, the 'correct' way to fix it is actually just make the operand be >= in that second check, which I realized after I just saw my silly solution again.
Reply With Quote
  #7  
Old 10-31-2012, 11:09 PM
Bhruic Bhruic is offline
Approved Member
 
Join Date: Oct 2012
Posts: 233
Default

Quote:
Originally Posted by Zechnophobe View Post
Heh, the 'correct' way to fix it is actually just make the operand be >= in that second check, which I realized after I just saw my silly solution again.
That'd involve less steps, certainly. I think mine's slightly more elegant in that it requires less steps if you don't have Sense Weakness. Of course, I might be biased.
Reply With Quote
  #8  
Old 11-01-2012, 01:02 AM
Zechnophobe's Avatar
Zechnophobe Zechnophobe is offline
Approved Member
 
Join Date: Nov 2009
Posts: 991
Default

Quote:
Originally Posted by Bhruic View Post
That'd involve less steps, certainly. I think mine's slightly more elegant in that it requires less steps if you don't have Sense Weakness. Of course, I might be biased.
Hmm, just for the sake of discussion...

I wasn't optimizing for speed, since that is no doubt a non-issue with something like this. More just for how clarity and ease of debugging. Calling in additional functions to do your logic like that makes the code slightly weightier. And then, any edit to an external source should generally be simple so as a diff is easy to understand. Seeing:

Code:
Blah blah < bleh bleh
Turn into

Code:
Blah blah >= bleh bleh
Is pretty clear what the problem was, and the solution for it.

Er, not that any of this really matters... I've just been doing code reviews at work recently and it has me thinking about Ivory Tower code production stuff.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:47 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.