@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?
@Grond0: Well, from what I can tell it is in the game. In the gifs I put at the end I forced the roll's outcomes to their extremes, and you can see a slight delay in the first gif after giving the attack command. The variance is so slight that it is very easy to miss.
Also, every creature rolls for their own delay when they go to target a creature. In my examples I forced the roll to the same value for every creature, to make it more clearly visible.
You should be able to reproduce the delay by consistently telling a party member to attack, and then disengage. 12.5% of the orders should immediately start moving the PC, while others make them stand and wait for a brief moment before they start moving towards their target. I can see the delay on completely vanilla install using this method.
If you want to get fancy with it, give a party member 7 Luck. They will always move instantaneously after being given a command, as the Luck forces the roll to 0.
Edit: I was working off of a pre-kjeron version of the page. Ninja'd
@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 .
@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.
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
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.)
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.
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?
Any action that requires the player to move towards another creature before acting. Off the top of my head I can think of attacking, talking, using an item ability, casting a spell, pickpocketing, and *probably* scripts that directly call MoveToObject().
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?
@AndreaColombo's reasoning, that it is supposed to prevent characters from seeming too perfect, sounds good. There's no technical reason for the mechanism to be there, so the devs must have thought it would serve some purpose.
By the way, how come you can access the game code? Do you work for Beamdog?
I don't have access to the source code. I am reading the assembly code directly from the .exe files using a disassembler, and then using EEex to test / force certain cases like I did in the gifs. (That's the reason why if you closely at my gifs, you can see "(EEex)" in the game's version string)
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?
@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.
@Alonso
Hide() is the script action that activates/deactivates the Stealth Modal.
PickLock() is the script action for the Open Locks skill, the Knock spell uses op125 for automatic success.
BashDoor() is the script action for attempting to bash open a lock (attacking it).
op252, Spell Effect: Set Trap is the opcode used by the thief's Set Snare / Set Special Snare abilities. It checks their Set Traps skill to determine if it should succeed/fail/critically fail, and which spell to cast in each case.
@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.
@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.
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.
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.
@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.
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).
- 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:
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).
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.
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.
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.
Comments
Also, every creature rolls for their own delay when they go to target a creature. In my examples I forced the roll to the same value for every creature, to make it more clearly visible.
You should be able to reproduce the delay by consistently telling a party member to attack, and then disengage. 12.5% of the orders should immediately start moving the PC, while others make them stand and wait for a brief moment before they start moving towards their target. I can see the delay on completely vanilla install using this method.
If you want to get fancy with it, give a party member 7 Luck. They will always move instantaneously after being given a command, as the Luck forces the roll to 0.
Edit: I was working off of a pre-kjeron version of the page. Ninja'd
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.
@gorgonzola: Sure thing. Jaheira has had the worst roll forced, while Minsc has had the best roll forced:
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...
What is the meaning of these lines?
By moving to another creature you mean moving to attack another creature, or does this also apply to other situations?
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?
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.)
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.
Any action that requires the player to move towards another creature before acting. Off the top of my head I can think of attacking, talking, using an item ability, casting a spell, pickpocketing, and *probably* scripts that directly call MoveToObject().
@AndreaColombo's reasoning, that it is supposed to prevent characters from seeming too perfect, sounds good. There's no technical reason for the mechanism to be there, so the devs must have thought it would serve some purpose.
All good.
I don't have access to the source code. I am reading the assembly code directly from the .exe files using a disassembler, and then using EEex to test / force certain cases like I did in the gifs. (That's the reason why if you closely at my gifs, you can see "(EEex)" in the game's version string)
Probably we would have Baldur's Gate in Unreal engine.
- 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?
I can't understand these mechanics. Can you elaborate a bit, maybe with an example?Yeah, I'm quite impressed as well, specially because I know a little bit about reverse engineering and know how difficult it is.
Hide() is the script action that activates/deactivates the Stealth Modal.
PickLock() is the script action for the Open Locks skill, the Knock spell uses op125 for automatic success.
BashDoor() is the script action for attempting to bash open a lock (attacking it).
op252, Spell Effect: Set Trap is the opcode used by the thief's Set Snare / Set Special Snare abilities. It checks their Set Traps skill to determine if it should succeed/fail/critically fail, and which spell to cast in each case.
in the other games @semiticgod mentioned you can rise luck gaining levels, like in our games an other innate score, hp, rises with levels.
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.
never use a spell trigger to post, or maybe you are a wild mage and had a wild surge with post cast 2 times .
only joking, happens to everybody...
The only one it excludes is op250 (Luck - Weapon Damage only).
Your Luck value is added to the roll, with the final value capped to the rolls natural range (1 - 10).
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.
Failure of other thief skills (like stealth, find traps, set traps) could have more serious consequences.