#Altrand - Improved Randomization (requires Lovely)

10 messages · Page 1 of 1 (latest)

drifting rivet
#

This improves the way Balatro handles random seeds internally. This doesn’t mean the outcomes are better, necessarily, but they should be “more random”.

Existing seeds will produce entirely different results, and runs with this mod active will be saved separately from those that don't, in the save file save-altrand.jkr.

This also partially fixes the nan seed bug. Technically, the bug still happens, but the way seeds are handled now means it doesn't matter as much. Stuff like the stuck shuffle seed is still bad*, but the all spades seed should be fine.

This works on 1.0.1c, but has not been tested with other mods. If your mod directly stores the return value of pseudoseed somewhere and treats it like a number, it will break, but otherwise it should be fine.
In the near future, I plan to extend this to changing seeds further so that the nan bug can't happen at all, but that will make seeds incompatible again.

*This happens because Balatro changes the shuffle seed after each ante, but all of the shuffle seeds for antes 0-9 will be the same value in that case, so at the beginning of each ante, the shuffle sequence is reset to the beginning.

drifting rivet
#

Altrand - Improved Randomization (requires Lovely)

gusty pier
#

To fix pseudohash bugs you should just be able to add like 0.1 to the number before it gets divided, so it can never be nan

#

This sort of mod would be cool as a QoL RNG change for modpacks

drifting rivet
#

I’m probably just going to replace pseudohash completely (i’m already working on that)

gusty pier
#

Yep, that would be good for making it even more statistically random

drifting rivet
#

For the hash i’ve ported SipHash to luajit (i just have to verify the outputs match) and i’m going to use SipHash-1-3 with a fixed key which should be more than good enough, i think the whole “pseudoseed space” is like 43 bits or something right now with an 8 character run seed but having a 128 bit output makes the probability of collisions even lower i would hope

patent bluff
#

Oops! The game crashed:
[lovely altrand "altrand.lua"]:18: bad argument #1 to 'lshift' (number expected, got cdata)

Additional Context:
Balatro Version: 1.0.1n-FULL (best guess)
Modded Version: 1.0.0~ALPHA-1229b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.6.0

Stack Traceback

(3) field C function 'lshift'
(4) main chunk of file 'altrand.lua' at line 18 (from lovely module altrand)
(5) global C function 'require'
(6) main chunk of file 'functions/misc_functions.lua' at line 2178
(7) global C function 'require'
(8) main chunk of file 'main.lua' at line 871
(9) global C function 'require'
(10) LÖVE function at file 'boot.lua:323' (best guess)
Local variables:
c = table: 0x041ff0a0 {identity:false, version:11.5, accelerometerjoystick:true, modules:table: 0x041ff0f0 (more...)}
openedconsole = boolean: false
confok = boolean: true
conferr = nil
(11) global C function 'xpcall'
(12) LÖVE function at file 'boot.lua:362' (best guess)
Local variables:
result = boolean: true
(13) global C function 'xpcall'
(14) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
I don't know what to do with it, other than write here and hope for an explanation by someone else.

#

Oops! The game crashed:
[lovely altrand "altrand.lua"]:18: bad argument #1 to 'lshift' (number expected, got cdata)

Additional Context:
Balatro Version: 1.0.1n-FULL (best guess)
Modded Version: 1.0.0~ALPHA-1229b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.6.0

Stack Traceback

(3) field C function 'lshift'
(4) main chunk of file 'altrand.lua' at line 18 (from lovely module altrand)
(5) global C function 'require'
(6) main chunk of file 'functions/misc_functions.lua' at line 2178
(7) global C function 'require'
(8) main chunk of file 'main.lua' at line 871
(9) global C function 'require'
(10) LÖVE function at file 'boot.lua:323' (best guess)
Local variables:
c = table: 0x041ff0a0 {identity:false, version:11.5, accelerometerjoystick:true, modules:table: 0x041ff0f0 (more...)}
openedconsole = boolean: false
confok = boolean: true
conferr = nil
(11) global C function 'xpcall'
(12) LÖVE function at file 'boot.lua:362' (best guess)
Local variables:
result = boolean: true
(13) global C function 'xpcall'
(14) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
Please help

patent bluff
#

Oops! The game crashed:
[lovely altrand "altrand.lua"]:18: bad argument #1 to 'lshift' (number expected, got cdata)

Additional Context:
Balatro Version: 1.0.1n-FULL (best guess)
Modded Version: 1.0.0~ALPHA-1229b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.6.0

Stack Traceback

(3) field C function 'lshift'
(4) main chunk of file 'altrand.lua' at line 18 (from lovely module altrand)
(5) global C function 'require'
(6) main chunk of file 'functions/misc_functions.lua' at line 2172
(7) global C function 'require'
(8) main chunk of file 'main.lua' at line 871
(9) global C function 'require'
(10) LÖVE function at file 'boot.lua:323' (best guess)
Local variables:
c = table: 0x1d70e6a0 {identity:false, version:11.5, accelerometerjoystick:true, modules:table: 0x1d71a668 (more...)}
openedconsole = boolean: false
confok = boolean: true
conferr = nil
(11) global C function 'xpcall'
(12) LÖVE function at file 'boot.lua:362' (best guess)
Local variables:
result = boolean: true
(13) global C function 'xpcall'
(14) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])