øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=printpage;topic=2203.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexd06e.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2203.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexd06e.html.zxÆg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿȰ°,OKtext/htmlISO-8859-1gzip@øÕÿÿÿÿÿÿÿÿTue, 10 Mar 2020 03:38:05 GMT0ó°° ®0®P®€§²ð®Æg^Å Print Page - The Pseudorandom Array

Board of Slick

Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: chillyfeez on April 18, 2016, 05:51:14 PM

Title: The Pseudorandom Array
Post by: chillyfeez on April 18, 2016, 05:51:14 PM
I don't think I've ever seen it documented anywhere, but this is interesting and pretty useful for custom stuff.

At startup, the game copies 6/EE00 (in ROM w/o header, or 14/EE00 in LoROM) through 6/EEFF into 7E:1900-19FF in RAM.

These 100 bytes are the effective random number array that (I think) is used for all random number generations. There's a constantly rotating byte - 67A out of battle and 097 in battle - that gets loaded into X, then we load 1900,X into A to get our pseudorandom number.

Theoretically, the game could just load 14/EE00,X every time, but it takes one less byte each time to use the array in RAM. Still, seems like an odd way to occupy those hundred bytes of RAM...
Title: Re: The Pseudorandom Array
Post by: Imzogelmo on April 20, 2016, 11:44:01 AM
That is odd. It's been a long time, but I once looked at either FF5 or FF4 to compare the pseudorandom array to FF6, and the numbers were identical. I can't remember which game it was that was identical, but I thought that was kinda telling.