Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Dark Dreams of Furiae - a new module for NWN:EE! Buy now
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Lower Reaches - Fireball fails to destroy 6 gibberlings



  • AngulimalaAngulimala Member Posts: 79
    edited June 2019
    @Grond0 I wonder if it's by design to ensure all HP rolls are at least half the hit dice, similar to the "NWN style" tweak. Perhaps the designers thought it would enhance game enjoyability for a majority of players.

  • Grond0Grond0 Member Posts: 6,865
    @Angulimala it's not a deliberate change by Beamdog. Nor is it a simple algorithm change. It's still possible to get low HP rolls - they just don't occur as often as high ones.

  • MaurvirMaurvir Member Posts: 922
    That sure looks like a design change. I'm guessing people were grumbling that their fighters were getting crap HP rolls and being taken out by gibberlings.

  • Grond0Grond0 Member Posts: 6,865
    @Bubb - you're my hero :D.

    @JuliusBorisov from what was said in the review by Beamdog before (and what wasn't said in patch notes) this did not appear to be an intended change - though I imagine that reverting to vanilla behavior might not be that popular now people have had so long to get used to this behavior. Will you update your bug report, so the issue can be considered by developers?

  • JuliusBorisovJuliusBorisov Member, Administrator, Moderator, Developer Posts: 21,446
    Tagging @Hurricane as it was he who copied the report to the internal tracker.

  • HurricaneHurricane Member, Translator (NDA) Posts: 730
    Yes, the behavior of rolling twice and using the higher of the two rolls was already considered when the issue was first looked at in 2017, but it is still unclear why this behavior did not occur prior to the v2.0 update because according to the developers' investigation, the way the hitpoints are rolled didn't change between versions. In any case, I've updated the bug report.

  • Grond0Grond0 Member Posts: 6,865
    Bubb wrote: »
    Compare that to the core of v2.5.16.6's function:
    roll1 = (call rand) % nSides
    roll2 = (call rand) % nSides
    higher_of_two = max(roll1, roll2) + 1
    ensure_min = max(nMinRoll, higher_of_two)
    return ensure_min

    @Bubb forgive the ignorance of someone who knows nothing about coding. However, looking at the statements above would suggest to me that you shouldn't be able to get a minimum HP roll as the higher_of_two function doesn't just take the higher of two rolls, but adds 1 to it as well (there's then a further comparison with nMinRoll - possibly to set max HPs if that option is set in Game Options?). It is though possible in the game to get minimum HPs. What am I missing?

  • jmerryjmerry Member Posts: 1,505
    What you're missing? The mod operator (%) has a range from zero to the second argument minus 1. To get a roll from 1 to nSides, we need (rand % nsides) +1 anyway. Putting the +1 in the higher_of_two function rather than applying it to the rolls first as a human would is confusing, but it works.

  • BubbBubb Member Posts: 816
    edited July 2019
    The computer does the + 1 in the higher_of_two step because it saves one add instruction, but that is getting into arbitrary detail.

    @Grond0: The following line:
    ensure_min = max(nMinRoll, higher_of_two)

    is making sure that the minimum allowed value is met. For example, if higher_of_two got set to 1, and yet the minimum allowed roll value is 5 because of godlike constitution, this line would "bump" the roll up to a 5.

    In fact, this whole rolling function isn't even used if the Max HP rolls option is active.

  • Grond0Grond0 Member Posts: 6,865
    Bubb wrote: »
    For example, if higher_of_two got set to 1, and yet the minimum allowed roll value is 5 because of godlike constitution, this line would "bump" the roll up to a 5.

    Even godlike constitution (25) only gives you a minimum of 4 under 2nd edition rules, but I get the point :p. Thanks for your help.

  • The user and all related content has been deleted.

  • StonebearStonebear Member Posts: 4
    Can anyone suggest a workaround for the hp rolls? Doesn't appear to be fixed in the 2.6 beta.

  • jmerryjmerry Member Posts: 1,505
    And what would you consider "fixed"? Using the better of two rolls is something that goes way back - I'm pretty sure it was used to roll HP for the BG2 companions. (See here for the circumstantial evidence)

    I suspect the code change noted above restored the originally intended behavior. All that's left, really, is to document it so that people will see it that way.

  • StonebearStonebear Member Posts: 4
    Whether or not it's really a bug, I'd like to have the option to revert to the old behavior. Perhaps it'd be possible to add it as an option in 2.6? Could someone make a reversion patch like bubb did with the pathfinding code?

Sign In or Register to comment.