Skip to content

Chance to learn spell

I have long-term suspiction that there must be a bug in the learnig of spells but today the suspiction has changed to almost certainity. My non specialist mage with 23 intelligence (19 + Potion of Genius) has 99 chance to learn spell. I tried to learn four spells and he has failed three times.
Was it just extremely bad luck or is there any bug with learnig the spells? Because I think that during the years of playing the BG I have failed more often not.

Comments

  • ThacoBellThacoBell Member Posts: 12,235
    I'd say extremely bad luck. If you succeeded 100 spells in a row, you probably wouldn't notice. But the bad stuff tends to stand out more.
  • BelgarathMTHBelgarathMTH Member Posts: 5,653
    There are also a lot of hidden variables in how the success percentage is determined, including mage specialist school and spell level versus caster level. (I may be wrong about that last one.)

    We've had really long threads about this before, with much arguing, and some experimentation, but I've not seen anybody be able to dig up the actual formulae in the program. Or maybe they did, and I missed it in one of those other threads.

    Also, keep in mind that computer RNG isn't really random. Computers use long strings of pre-determined numbers to come up with a simulation of "random" numbers. We've had threads about that, too.

    I've noticed similar anomalies to what you're experiencing in the way the computer rolls "to hit" figures. I've always insisted that numbers 1-10 occur far more often than numbers 11-20 than 50 % of the time, but I can't prove it. so nobody ever believes me.

    We've even had threads discussing the nature of randomness in general, and how the only thing you can expect from it, no matter the odds, is the unexpected.
  • jmerryjmerry Member Posts: 3,829
    edited March 2020
    Here's how I'm pretty sure it works:

    The in-game numbers shown are almost accurate for a generalist mage or unkitted bard. There's an off-by-one bug which makes the actual chance 1% higher than shown, but that's it. A character such as Garrick, Aerie, or Nalia with no kit would actually be 100% certain to learn a spell at 23 Int.
    Specialist mages have a 15% bonus to learning spells in their school and a 15% penalty to learning spells outside of their school. This is intended, and is included in the kit description in the EE. The off-by-one bug also applies here.

    Anyone with a kit - such as a wild mage, a blade, or a kensai-mage dual class - takes the same 15% penalty for spell learning as a specialist mage. On the other hand, as they don't have an actual specialty, they don't get the 15% in-school bonus on any spells. This is a bug.
    Imoen, in both games, has no kit assigned rather than having "Base Class". This causes the game to treat her as if she had a kit, and take that 15% penalty. This is also a bug.

    Was your non-specialist mage actually a dual-class from a kit? If so, you were working off an 85% chance to learn. You got unlucky, but not unfathomably so.

    Incidentally, 24 or 25 Int is shown as 150% spell learning chance, and is certain success regardless of that specialist penalty. Two potions gets you to the safe zone, for your character or any of the standard mage NPCs. Bard NPCs might need three.
  • sarevok57sarevok57 Member Posts: 5,975
    There are also a lot of hidden variables in how the success percentage is determined, including mage specialist school and spell level versus caster level. (I may be wrong about that last one.)

    We've had really long threads about this before, with much arguing, and some experimentation, but I've not seen anybody be able to dig up the actual formulae in the program. Or maybe they did, and I missed it in one of those other threads.

    Also, keep in mind that computer RNG isn't really random. Computers use long strings of pre-determined numbers to come up with a simulation of "random" numbers. We've had threads about that, too.

    I've noticed similar anomalies to what you're experiencing in the way the computer rolls "to hit" figures. I've always insisted that numbers 1-10 occur far more often than numbers 11-20 than 50 % of the time, but I can't prove it. so nobody ever believes me.

    We've even had threads discussing the nature of randomness in general, and how the only thing you can expect from it, no matter the odds, is the unexpected.

    i swear this happens in NWN EE with attack rolls, out of 20 attacks, only 5 of them will be above 10 while the rest are below

    this is what makes low level battles SO boring because my warriors are missing 90% of the time with their arduous 1 attack per round

    and then at later levels it doesnt matter as much because eventually warriors start hitting things with 2s so i no longer notice it
  • velehalvelehal Member Posts: 299
    jmerry wrote: »
    Anyone with a kit - such as a wild mage, a blade, or a kensai-mage dual class - takes the same 15% penalty for spell learning as a specialist mage.

    This explains it. It was dual-class from berserker. Thank you.
  • ChroniclerChronicler Member Posts: 1,391
    velehal wrote: »
    jmerry wrote: »
    Anyone with a kit - such as a wild mage, a blade, or a kensai-mage dual class - takes the same 15% penalty for spell learning as a specialist mage.

    This explains it. It was dual-class from berserker. Thank you.

    If I understand correctly, and interesting quirk of this is that you get a saving throw bonus on some of your HLA's like Dragon's Breath.

    As a non-specialist kit, you're considered a specialist of the "None" School of magic, which for most of the game doesn't exist.

    However, none of the 9th level spells have a spell school. They are all accessible regardless of your specialty. This means that they by default fall into the "None" school of magic, for which you receive bonuses as a Kensai.

    There's only two or three of those HLA's to which it even applies but it's nifty.
  • BubbBubb Member Posts: 1,000
    jmerry is 100% right. In case anyone wanted to see exactly what the engine does, here's some pseudocode, (extracted from BG2:EE v2.5.16.6):
    roll = ((rand() & 0x7FFF) * 100) >> 0xF; // Random from [0-99] (inclusive)
    
    if (m_nDifficultyMultiplier < 0) // Below Core difficulty
        roll = 1;
    
    percentSucceed = (INTMOD.2DA) => LEARN_SPELL[INT]
    
    if (kit != 0x4000)
    {
        if (<mage kit matches spell school>)
            percentSucceed += 15
        else
            percentSucceed -= 15
    }
    
    if (roll <= percentSucceed)
    {
        // Success
    }
    
  • jmerryjmerry Member Posts: 3,829
    And how to fix it so that the specialist modifier is only applied for specialist mages...
    Just replace one line.

    [if (kit != 0x4000)] to [if (kit & 0x3FC0)]

    That's a bitwise "and" operation, exploiting the fact that mage specialist kits use eight dedicated bits out of the kit ID code. As a slight quibble, that ID is actually 32 bits in the EE rather than the 16 shown; the other half are zero for all standard kits except wild mages and barbarians.
  • gorgonzolagorgonzola Member Posts: 3,864
    edited March 2020
    on a side note this is one of the reasons why a party sorcerer is very useful, specially if you run small parties so he levels up fast.
    because a sorcerer can easily spam wish to get the temporary 25 in all stats for all the parties.
    so you can use and stack all the potions of genius you find before he gets wish, after are redundant as he can set the int of anyone at 25 at will, and thanks to his clones and his flexibility in using the spells he knows no preparation or special memorization is needed. in the process he probably will also get the rest option so it is cost free if not beneficial.

    anyway i think that as it si possible both to stack genius potions and use wish to be sure to learn every time the spells at the end to have a chance to fail to learn them is only a waste of player's time, as there is plenty of potions if the player does not want to learn each scroll immediately, but mass learns them every time a really useful spell's scroll is found.

    stacking potions makes some in game stats and skill values only apparent, but not really substantial.
    every mage, even with a low int, can learn the spells without ever failing and a thief with no skill points can become potentially the best one in pick pocket and lock picking, as there are few people that is really worth to pick pocket and many locks can be opened with high str from a belt stacking potions a mage with low int and a thief with low pick pocket and open doors skills are just as good as ones with high values in them.
    somehow making those stat and skills meaningless.

    i personally never stack potions of the same kind, it is a custom roue of mine that adds value to my gaming (according to my personal taste).
    if i have minsc in the party i can use a single potion to have him a little more resilient to the mind flyers int drain, but no more then that, if i use nalia or imoen as thief i know that is better to not try to pick pocket, if i use jan and i want to pick pocket i have to make some sacrifice in other skills developing them later.

    this is also true, at least from bg2 on, for the str, i see some people roll for long time to try to get that 18.xx str that will be overridden as soon as you enter ribald's shop. and the mage spell that give 18:50 str is also low level as well as the clerical one that gives 18.75 str to all the party members inside its aoe (if you happen to have someone with more than 18.75 just send him more then 15 ft. away before casting.
    the str items and spells make a high natural str almost not useful for a fighter.

    in the way the game is implemented, if a player knows how to counter certain things, it is probably better to min max an average stat roll in a way that give to fighters and mages low score in their primary stat and there is almost no reason to spend too much points in pick pocketing for a thief.

Sign In or Register to comment.