I've looked at the RNG for a bit. I have a real simple script for VBA that, all it does, is predict what the next RNG value will be and count how many RNG rolls the game makes. The counter usually resets if you load state, but if it resets during other times, the game is doing something nifty with the RNG instead. I have no clue as to what the game actually does with the RNG itself, just that I think I got the basic "Next RNG" formula. There's probably other ways the game deals with the RNG, such as exiting the decks menu, but knowing this much might help.
Honestly, I have no clue how much you know already.
16 bytes at address
02034030 looks suspiciously like the RNG.
Download KH_RNG.luaLanguage: lua
local R4s= memory.readdwordsigned
--*****************************************************************************
local function Roll(rTbl)
--*****************************************************************************
return bit.band(0xFFFFFFFF,bit.bxor(
bit.lshift(rTbl[2], 2),bit.lshift(rTbl[4], 1),
bit.rshift(rTbl[1],30),bit.rshift(rTbl[3],31)
))
end
local T= {0,0,0,0}
local Count= 0
--*****************************************************************************
local function CountRNG()
--*****************************************************************************
for i= 0, 1000 do
for j= 1, 4 do
if T[j] ~= R4s(0x02034030+4*(j-1)) then break end
-- If we get here, we matched the RNG! Success! Escape the function now.
Count= Count+i
return
end
-- No match this time. Roll our stored value, and check for a match next time.
table.insert(T,1,Roll(T))
T[5]= nil
end
--Give up. Reset counter and our stored RNG value.
for i= 1, 4 do
T[i]= R4s(0x02034030+4*(i-1))
Count= 0
end
end
--*****************************************************************************
local function Fn()
--*****************************************************************************
CountRNG()
for i= 1, 4 do
gui.text(0,7*i,string.format("%8X",T[i]))
end
gui.text( 0,0,string.format("%8X",Roll(T)),0x00FF00FF)
gui.text( 36,0,string.format("%6d",Count))
end
gui.register(Fn)