Skip to content

Luck: What it is and how it works

12346

Comments

  • kjeronkjeron Member Posts: 2,367
    Grond0 wrote: »
    @Bubb that delay isn't actually implemented in the game though. Can you see why in the engine - does it look like the idea was deliberately abandoned or just not coded properly?
    But it is in-game, and quite easy to test.
  • Grond0Grond0 Member Posts: 7,318
    @Bubb interesting - thanks for the clarification. I can see what you mean now, but the delay is very small. I'd been thinking in terms of segments, but the range of delay is more like 1/10ths of a segment. I'd previously put that sort of very brief hiatus down to pathing issues (which can have a much greater impact on how quickly an attack initiates), but I can now see it's a separate feature. Another day, another thing learned - keep up the good work :D.
  • AlonsoAlonso Member Posts: 806
    edited March 2019
    @Bubb: Do you know how long those delays are?
  • gorgonzolagorgonzola Member Posts: 3,864
    @Bubb
    can you please create a gif like those you posted, but with 2 toons close by, with forced roll's outcomes to their extremes, then while paused give them the order to reach a 3rd toon. unpausing it should be more evident how much is the difference then comparing 2 different gif and comparing them.
  • gorgonzolagorgonzola Member Posts: 3,864
    edited March 2019
    thank you, now the difference is much more evident.

    EDIT: it is funny how the poor keldorn give them his back, probably is trying to run away, korgan would have probably charged them as he notice that his companions betray and attack him...
    i am only joking obviously and i know that he turns only cause bumped by the bossy jaheira that wants to lead the attack even if misc is faster then her
  • AlonsoAlonso Member Posts: 806
    edited March 2019
    @Bubb: I'm trying to incorporate your findings to the article about luck and some doubts come up as I write:
    Bubb wrote: »
    #18 (0x12) - Hide()
    #28 (0x1C) - RemoveTraps(O:Trap*)
    #145 (0x91) - PickLock(O:Object*)
    #148 (0x94) - BashDoor(O:Object)
    #252 (0xFC) Spell Effect: Set Trap
    What is the meaning of these lines?
    Bubb wrote: »
    there is intentionally a random wait time between when a creature attempts to move to another creature, and when they will actually start pathing.
    By moving to another creature you mean moving to attack another creature, or does this also apply to other situations?
    Bubb wrote: »
    Every unit of delay is 1/15th of a second. The worst roll you can get will have you waiting for 7/15ths of a second.
    Any idea of why the game creates these delays? Are they meant to simulate reaction times or something like that?

    I'm using the info and one of the pictures you have provided to update the article. Hope that's fine with you. If not, let me know.

    By the way, how come you can access the game code? Do you work for Beamdog?
    Post edited by Alonso on
  • AndreaColomboAndreaColombo Member Posts: 5,525
    edited March 2019
    The delays are to prevent characters from moving in perfect sync like a party of robots. A random delay of a fraction of a millisecond is enough to make movement seem more natural.

    Fun fact: in vanilla the delay is actually slightly longer. It was decreased in the Enhanced Edition during the early days (possibly the pre-release closed beta of BG:EE) to make characters more responsive to player input. It was done by Cori, if memory serves :)

    EDIT:

    Just caught up with @Bubb's original post in which he mentions the delay.

    I was referring specifically to a delay between the player's issuing a command (including the command to move to a given destination) and that command's being executed. To the best of my knowledge, there should be such a delay for on-ground destinations, even though Luck may not affect it (and that might be the reason why @Bubb's algo didn't pick up on it, as he was scanning the code specifically for applications of Luck.)
    Post edited by AndreaColombo on
  • moody_magemoody_mage Member Posts: 2,054
    Apologies for not reading the whole 6 pages in case this has already been answered. Do all characters have the same starting base luck value?
  • AlonsoAlonso Member Posts: 806
    Bubb wrote: »
    Alonso wrote: »
    Bubb wrote: »
    #18 (0x12) - Hide()
    #28 (0x1C) - RemoveTraps(O:Trap*)
    #145 (0x91) - PickLock(O:Object*)
    #148 (0x94) - BashDoor(O:Object)
    #252 (0xFC) Spell Effect: Set Trap
    What is the meaning of these lines?

    Those are all the scripting actions that use luck internally. The first two numbers are just the id represented in decimal and then hexadecimal, which is useful for modders.
    I guess these lines correspond to the game actions with similar names, but some things are unclear to me:
    • Is Hide() just the thief ability Hide in the shadows? Does it also include Move silently? Does it also include the same ability used by other classes, like stalkers?
    • PickLock(O:Object*): Is this just the lockpicking ability of thieves or does it also affect the Knock spell?
    • Spell Effect: Set Trap: Does this have something to do with spells?
    Bubb wrote: »
    #28 (0x1C) - RemoveTraps(O:Trap*)
    #145 (0x91) - PickLock(O:Object*)
    #148 (0x94) - BashDoor(O:Object)
    #252 (0xFC) Spell Effect: Set Trap
    I can't understand these mechanics. Can you elaborate a bit, maybe with an example?

    Raduziel wrote: »
    I keep thinking what @Bubb would be able to achieve with access to the source code.

    Probably we would have Baldur's Gate in Unreal engine.
    Yeah, I'm quite impressed as well, specially because I know a little bit about reverse engineering and know how difficult it is.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @moody_mage: All characters have base zero luck. It's not like Morrowind/Oblivion/Skyrim or anything like that; luck is a spell effect rather than a character's innate score.
  • AlonsoAlonso Member Posts: 806
    semiticgod wrote: »
    @moody_mage: All characters have base zero luck. It's not like Morrowind/Oblivion/Skyrim or anything like that; luck is a spell effect rather than a character's innate score.
    Base zero luck sounds like an innate score. If there is an effect that modifies luck, there must be an innate score to modify, otherwise the effect wouldn't do anything.
  • AlonsoAlonso Member Posts: 806
    kjeron wrote: »
    @Alonso Hide() is the script action that activates/deactivates the Stealth Modal.
    My understanding (correct me if I am wrong) is that the success of the Stealth Modal depends on both the Hide in the Shadows and the Move Silently skills. If that's correct, I'm wondering how many rolls there are for a Stealth Modal, one or two (because two skills are involved). If there are two, I guess the chances of critical failure would double.

  • gorgonzolagorgonzola Member Posts: 3,864
    edited March 2019
    Alonso wrote: »
    Base zero luck sounds like an innate score. If there is an effect that modifies luck, there must be an innate score to modify, otherwise the effect wouldn't do anything.
    is an innate score, but is always set to 0, and there is no way to increase it if not with items or spells.
    in the other games @semiticgod mentioned you can rise luck gaining levels, like in our games an other innate score, hp, rises with levels.


    Alonso wrote: »
    My understanding (correct me if I am wrong) is that the success of the Stealth Modal depends on both the Hide in the Shadows and the Move Silently skills. If that's correct, I'm wondering how many rolls there are for a Stealth Modal, one or two (because two skills are involved). If there are two, I guess the chances of critical failure would double.
    if i am not wrong a single roll is used and the average of hide in shadows and move silently is used. the old belief that his and ms are different and to rise ms is better is proved false, they work in the same way.

  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @gorgonzola: Luck only increases with levels if you have a kit or class mod that implements it, like rogues in semiOverhaul for IWD2. It won't increase with levels in an unmodded IE game.
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    Does "luck" for these purposes mean the entire underlying luck score? Behind the scenes, does Chant just apply a modifier to luck? Or is the Chant version of luck effects a parallel-but-separate effect?
    op22 (Luck-STAT), op133 (Luck-STATE), op131 (Chant), and op137 (BadChant), as well as Fatigue and Intoxication all contribute to the same luck score.

    The only one it excludes is op250 (Luck - Weapon Damage only).
  • AlonsoAlonso Member Posts: 806
    Bubb wrote: »
    - Rolls a 1d10 to add to your base ability score when calculating success. Each point of luck will "shift" the probabilities slightly in your favor. For example:

    Luck 1 Probabilities:
    1 => 0%
    2 => 10%
    3 => 10%
    4 => 10%
    5 => 10%
    6 => 10%
    7 => 10%
    8 => 10%
    9 => 10%
    10 => 20%

    Luck 9 Probabilities:
    1 => 0%
    2 => 0%
    3 => 0%
    4 => 0%
    5 => 0%
    6 => 0%
    7 => 0%
    8 => 0%
    9 => 0%
    10 => 100%
    Negative luck has the same effect, but in reverse.
    I don't understand how this mechanic works. Can you elaborate?
  • kjeronkjeron Member Posts: 2,367
    Alonso wrote: »
    I don't understand how this mechanic works. Can you elaborate?
    It's the same as how luck affects the attack roll, the only difference is that these skills roll 1d10 instead of 1d20.
    Your Luck value is added to the roll, with the final value capped to the rolls natural range (1 - 10).
  • AlonsoAlonso Member Posts: 806
    kjeron wrote: »
    It's the same as how luck affects the attack roll, the only difference is that these skills roll 1d10 instead of 1d20.
    I'm wondering if that's really the case. I don't know much about this, but I don't think that thieving actions are resolved using a 1d10 roll.
  • Grond0Grond0 Member Posts: 7,318
    The d10 is the random component. Let's say that you have 85 skill in open locks, but are attempting to pick a lock with a difficulty class of 90. That means you may find that you fail on a first attempt, but if you keep trying you will eventually succeed - because each time you try there's a random d10 added to your skill. If luck is active that increases your roll (up to the maximum of 10), though for open locks that doesn't really matter as there's no penalty for repeated attempts anyway.
  • AlonsoAlonso Member Posts: 806
    OK, one step at a time. I feel that in order to understand this I need to understand first how open locks work. Is that explained somewhere?
  • The user and all related content has been deleted.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    It's not particularly relevant in practice. Picking a lock is extremely fast; even without a hotkey, you can attempt it about once a second. Even if you're 10 points shy, it will only take a few seconds to get that 1d10 roll, so a luck bonus will have almost no visible impact. The luck effect alone won't increase the level of lock you can pick; even +20 luck won't let a thief with 25 in Open Locks pick a lock value of 36.

    The Luck spell, though, does give a 5% bonus to thief skills, so it does have the ability to let you pick a lock you otherwise couldn't.
  • Grond0Grond0 Member Posts: 7,318
    I agree positive luck isn't often relevant to open locks, but negative luck could be. You will sometimes come across that for instance when being unable to open a lock because you're fatigued.

    Failure of other thief skills (like stealth, find traps, set traps) could have more serious consequences.
Sign In or Register to comment.