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
  #41  
Old 10-31-2012, 08:50 PM
Razorflame Razorflame is offline
Approved Member
 
Join Date: Apr 2009
Posts: 721
Default

Quote:
Originally Posted by Bhruic View Post
Ok, time for someone to fact check me here, because if I'm reading this correctly, I'm very confused:
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 = false
            is_weakness_lore = true
          end
        end
      end
Basically, what this is doing it checking if someone made a critical hit. kritProb is the chance of performing a critical hit, kritProbRnd is a random number from 0-99.

Now, if I'm understanding this right, if a critical hit was made (kritProbRnd is less than kritProb), it then subtracts the value from "weakness_lore", which is the Sense Weakness skill. However, let's assume that you don't have the Sense Weakness skill. Shouldn't skill_power("weakness_lore", 2) return 0? And if that's the case, then kritProb = kritProb - skill_power("weakness_lore", 2) becomes kritProb = kritProb - 0, or kritProb = kritProb. In which case the second if kritProbRnd < kritProb then is guarunteed to also be true because kritProb hasn't changed. Which means that iskrit should automatically be set false, and the game should think Sense Weakness kicked in.

Even worse, I'm sitting here and I can't remember if I've actually had the enemy perform a critical hit on me. It could be my memory letting me down, or it could be that you can't actually get a critical hit on your troops until you take the Sense Weakness skill. Unfortunately I can't set up a test case for "enemy performs a critical hit". So have I mis-analyzed the code? Can anyone without the Sense Weakness skill verify that they've taken (not given) a critical hit?

ah i also was wondering that since sometimes i got a msg about sense weakness
and i was like wtf i don't have that skill tagged


i thought it maybe was a viking ability or something

but seeing this
this is just a bad write up fix plz
Reply With Quote
  #42  
Old 10-31-2012, 08:56 PM
Bhruic Bhruic is offline
Approved Member
 
Join Date: Oct 2012
Posts: 233
Default

Quote:
Originally Posted by Razorflame View Post
ah i also was wondering that since sometimes i got a msg about sense weakness
and i was like wtf i don't have that skill tagged


i thought it maybe was a viking ability or something

but seeing this
this is just a bad write up fix plz
It's an easy fix, but I just want to verify that I'm not misreading it first.
Reply With Quote
  #43  
Old 10-31-2012, 09:17 PM
camelotcrusade's Avatar
camelotcrusade camelotcrusade is offline
Approved Member
 
Join Date: Apr 2009
Location: San Francisco, CA
Posts: 448
Default

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?
Reply With Quote
  #44  
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
  #45  
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
  #46  
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
  #47  
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
  #48  
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
  #49  
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
  #50  
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
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 02:13 AM.


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