Jump to content

I wonder if Voltorb coin flip can be used for determining seed/seconds/delay in HGSS...

Recommended Posts

...instead of catching pokemon and looking at their IVs.

Not that I'm much of ASM programmer, but common logic dictates that Voltorb flip minigame board is constructed using several consecutive RNG calls. Since when you lose, the whole board is shown, this can theoretically lead to determine RNG initialization parameters as well which frame you are on (and possibly to advance frames as well).

Anyway, is there any research regarding how this mini-game works? 2bit x 25 tiles is 2 4-byte words, plus, I imagine, there is a check for number of 0/1/2/3 tiles for a given level. Though, more likely that there is one call for specific 0/1/2/3 spread(see below) and one to shuffle these tiles to set the board.

Some thoughts on how RNG for Voltorb flip might work:

I've given my students (I work part-time as a CS teacher in a charity-based remedial school program) the task to emulate Voltorb game using lowest possible number of calls to 16-bit pseudo-random generator. The only parameter to the function that would create the board was level number (number of 0s and points min/max per level was given as constant).

The solution I've granted full credit for was as the following:

1) Call RNG for 16-bit word. Starting from lowest bit, add 2 to each bit getting an array of 2s and 3s until product of its members doesn't reach points minimum for a level. Provided that max points for level 8 is around 6500 (3^8=6561 to be exact), that would make it maximum 12 bits to be used up (2^13=8192).

2) As amounts of 2s and 3s is known now (let it be N2 and N3), use value of highest 5 bits mod (25-N) to determine amount of zeros(N0). N1 = 25-N0-N2-N3.

3) Imagine 0s,1s,2s,3s as pools of identical items with count of N0/N1/N2/N3. Call RNG 3 times for 48-bit sequence and convert it to Base 4 number. For each digit of this number (D), calculate X = D+I, where I is the value of loop counter. Now, pool to get next board value from for each of 24 tiles would be determined using as (X mod P) where P is count of remaining pools. This way we get value for 24 board tiles. Value of 25th tile would be calculated based on previous 24 tiles and N0/N1/N2/N3.

So, the whole board can be generated in 4 16-bit RNG calls. But that's just a theory, of course.

Link to comment
Share on other sites

The Voltorb Flip game is actually seeded using the game's Mersenne Twister RNG. Kaphotics did some looking at it just last night actually, to see if it had any useful applications for RNGing.

(4:13:57 AM) Kaphotics: 624 -> 16 for just starting the game
(4:14:04 AM) Kaphotics: err, loading the table at goldenrod
(4:14:46 AM) Kaphotics: god what the fuck
(4:14:59 AM) Kaphotics: it chooses to advance a frame on certain tiles
(4:16:19 AM) Kaphotics: oh I see
(4:16:41 AM) Kaphotics: if you do a risky move (high chance of being a voltorb), it checks to see if it should warn you based on the risk
(4:18:46 AM) Kaphotics: 624 -> 16 (next 17) -> 31 (next 32) -> 47 (next 48) -> 95 (next 96)
(4:18:58 AM) Kaphotics: so essentially it's NOT constant but based on the MTRNG values it gets
(4:19:04 AM) Kaphotics: it probably trashes certain ones
(4:19:31 AM) Kaphotics: tl;dr -- not worth it

We have several other ways of confirming seed\second\delay in HGSS, though. Elm calls are the most commonly used -- each time you call Elm, he gives three responses decided by the upper 16-bits of the RNG, modulus 3.

Link to comment
Share on other sites

Yes, I am aware of Elm calls method, however I wondered if there are other good ones.

By the way, did Kaphotics say how does RNG determine the order and values of tiles in this minigame? If anything, we might get a 95% reliable calculator for always winning it :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...