Library Of Ruina

Library Of Ruina

161 ratings
Dice Roll Fix
   
Award
Favorite
Favorited
Unfavorite
Tags: Fix
File Size
Posted
Updated
1.002 MB
Apr 20, 2022 @ 1:34pm
Apr 20, 2022 @ 1:38pm
2 Change Notes ( view )

Subscribe to download
Dice Roll Fix

Description
Patches the awful vanilla dice roll implementation to be magnitudes more efficient.
Only has a notable performance impact on dice rolls with extremely large ranges or clashes with an extremely large number of dice.
Also prevents softlocks due to absurdly wide-ranged rolls.


A roll with a maximum value of exactly 2147483647 will overflow, but you probably shouldn't be using a value that large. Also vanilla rolls will break if the result is one higher than that anyways.

MakeDiceResult's tuneLevel still does nothing with this patch, although it already does nothing in vanilla. If tuneLevel does not equal 0, this patch will defer to vanilla logic just in case something else patches tuneLevel back in.

Thanks to Invidia for making the thumbnail.
7 Comments
uGuardian  [author] Oct 13, 2023 @ 1:16pm 
As amusing as it would be, and as much as I'd love to like, be hired to make optimization fixes and such, this mod is so tiny that there's realistically nothing I could even claim took work. Basically I'm just short circuiting a badly designed deprecated system and directly doing the end result instead.
CatMik Sep 30, 2023 @ 3:17am 
They should pay you for the rights to use this and patch it into the game.
uGuardian  [author] Jun 22, 2022 @ 5:46pm 
Yup, that's exactly what it does.
Midwinter Melancholy Jun 22, 2022 @ 1:07am 
So this mod changes nothing but makes the game smoother from a player perspective?
Poom36yu Jun 7, 2022 @ 10:18am 
good mod
uGuardian  [author] Apr 21, 2022 @ 10:24am 
It uses a nearly identical algorithm without the horrific completely pointless intermediary steps that eat a ton of memory and take magnitudes more processor cycles.
Araders Apr 21, 2022 @ 1:39am 
So does the modification purely optimize the dice rolls or does it fix the algorithm itself?