Author Topic: The RNG Method [FFXII]  (Read 40837 times)

Chaos

  • Global Moderator
  • Order of Ambrosia
  • *****

  • Offline Offline
    • View Profile
The RNG Method [FFXII]
« on: August 02, 2010, 02:16:17 PM »
This topic will explain everything that is currently known about the RNG: the basics and how it works on treasure contents, steals and some other things.

Basics

Final Fantasy XII uses a random number generator (RNG) known as the Mersenne Twister. It generates random numbers from a huge interval of [0, 2^32-1] and almost every random action that occurs in the game is connected to these random numbers. The following are spreadsheets of the first 20000 / 60000 random numbers the PS2 uses:

bmxer31's spreadsheet: http://www.2shared.com/document/S8rXWkZR/RNG_Extended_List.html
nathany33's spreadsheet: http://www.2shared.com/file/Tq5pARB2/ff12_good_RNG_chart.html

A Google Spreadsheet for the TZA version of the game: https://docs.google.com/spreadsheets/d/1-QyphfndDVeXwFOD3sDUPKdGYPtjMrBb3298Jd7lnss/edit?usp=sharing

Here's a link to an interactive webpage that can help you with RNG manipulation:

egli's webpage: http://markegli.com/ff12/

The first spreadsheet has two columns. 20000 random numbers in the first column and the corresponding Cure values in the second one. The formula for Cure is:

=INT((20+(MOD($A750;20*12,5))/100)*((LV+MAG)*MAG/256+2)*1,5)

You should change the formula to match your character's level and Magick Power. When changing formulae, position yourself in the first row (B1), change it and then double-click on the lower right corner of the B1 cell to apply the change to the whole column (demonstration).

Note: The *1,5 at the end of the formula are for the Serenity license. Make sure you're at full health when casting Cure. If you do not have the Serenity license you must delete the *1,5 at the end.

The second spreadsheet might be easier to use as it already comes with explanations and how-to's. It also has the advantage of having more random numbers (60000).

The RNG works so that it takes one random number for every random action that happens in the game (excluding drops; they use some other way of randomness for some reason). The spell Cure uses only a single random number, that's why it is a great way to determine your position in the RNG. If you're using the first spreadsheet go Edit > Find, click on Options and search by columns (you must be in the B column), look for values and tick that "Match entire cell content" box. Enter your first Cure value and remember the following one. Keep pressing "next" until you find your position. The second spreadsheet has a more user-friendly way of finding things. If you need to move quickly through the RNG, keep punching yourself. A self-hit without a weapon equipped will always use 10 random numbers. Don't forget to unequip your shield or you may block sometimes (alternatively you can use a Shield and equip the Cameo Belt, use this method if you have the Brawler license). Also be careful not to miss your destination by combo-ing.


Treasure Chests

Let's take a look at how random numbers affect the treasure contents. I'll use the Brave Suit chest as an example. It has a 25% spawn rate. It has an 80% chance to contain Gil and 20% chance to contain an item. There are two sets of items, one in case you don't have the Diamond Armlet equipped and one in case you do. If the former is the case, you have a 50% chance to obtain Item 1 (Knot of Rust) and a 50% to obtain Item 2 (Scathe Mote). If you do have the Diamond Armlet equipped, it's 90% for Item 1 (Knot of Rust) and 10% chance for Item 2 (Brave Suit). You can find detailed information about treasure contents on ff12maps.com.

Your chances to obtain a Brave Suit don't look so good. 0.25*0.2*0.1=0.005. That means you have a mere 0.5% of getting it. Exploiting the RNG will change this. Treasure spawns are determined when entering the zones. A set amount of random numbers is used when changing zones. This is the order of their functions:

1. Weather Changes
2. Random mob spawns
3. Treasure Chests
4. Traps
5. Rest

The Phase 2 Dig in Henne Mines doesn't have weather changes nor random monsters. The first number that's used when zoning into the area is for Brave Suit. Zodiac Spear is the 4th number. This means if you want to spawn the Brave Suit chest, the next random number MOD 100 (divide it 100 and look at the remainder) must be less than 25, or 00-24. Determine your position in the RNG and keep casting Cure until you're in front of a number than ends in <25 (MOD 100 will always represent the last two digits of a number). When done, enter the area. The chest will have spawned, make your way towards it, eliminating all enemies because their actions also consume random numbers.

By opening chests you use two random numbers. The first one is used for a Gil check. In the case of the Brave Suit chest, you'll get Gil if the next number ends in less than 80 and you'll get an item if it's 80-99. In case you get Gil, the second number is used to determine the amount. If you got an item, it will be Item 1 for a random number that ends in 00-49 and Item 2 for a random number that ends in 50-99 if you don't wear the Diamond Armlet. If you wear the Diamond Armlet, it's 00-89 for Item 1 and 90-99 for Item 2. To get the Brave Suit the next number must be 80-99 and the one after that 90-99.


Zodiac Spear

Similar as the above. When entering the zone, make sure the fourth number is less than 10. Enter the zone, kill all enemies you encounter (or use the Immoblize glitch) and reach the chest. Reach a position in the RNG, so that the next two random numbers are both 90 or higher (because it's 10% for item and 10% for that item to be Zodiac Spear).


Stealing / Poaching

This is similar to manipulating treasure contents. The steal mechanics work like this:

No Thief's Cuffs:
   - A random number is used for rare steal. If it ends in 00-02 you get the rare item, and the process ends here. If not, it continues...
   - A random number is used for uncommon steal. If it ends in 00-09 you get the uncommon item and the process ends. Otherwise, it continues...
   - A random number is used for common steal. If it ends in 00-54 you get the common item and process ends, otherwise the steal misses.

Thief's Cuffs:
   - A random number is used for rare steal. If it ends in 00-05 you get the item.
   - A random number is used for uncommon steal. If it ends in 00-29 you get the item.
   - A random number is used for common steal. If it ends in 00-79 you get the item.
This means that each steal attempt with the Thief's Cuffs will consume three random numbers because you may steal multiple items.


Poaching uses 1 or 2 numbers depending on whether or not the poach succeeds. The first number determines the success rate. If it fails, the process ends. If it succeeds, a second number is used to give you an item. 00-94 for common poach and 95-99 for rare poach.

For easy stealing, charge your steal before you engage your target. Nothing must move the RNG until you steal from the target. As for poaching, it will only work if you can Immobilze / Sleep / Disable / Stop your target.


Spawning Lv.99 Red Chocobo

The Chocobo spawns only in Haulo Green in Ozmone Plains. You must kill all 6 chocobos in that area, zone through 2 other areas and come back. There's a 1 out of 256 chance that a Lv99 Red Chocobo will replace any of the chocobos you've killed. Each time a normal Chocobo spawns two random numbers will be used, one for the spawn itself and one for its status (it may spawn asleep). If the Lv99 Red Chocobo spawns, only one random number is used. It will spawn if the next random number is less than 2^24. 2^24 = 16777216. In case you wonder why this happens, 2^24 out of 2^32 equals 1 out of 256. Here's a video of this method: http://www.youtube.com/watch?v=w2fyEQzTEn4


Credits

A big thanks to whoever started this whole discovery.
mkotha - for finding out that the Mersenne Twister is used as the random number generator and for figuring out its seed
bmxer31 - for translating mkotha's work into English and making the first spreadsheet
nathany33 - for information about the Lv99 Red Chocobo and making another great spreadsheet
FF12GrandMaster's - for being the first to develop a method for rare items in treasure chests
billygoten, pprincess, Gramps, flak76e and everyone else who has helped out
egli - for making an interactive webpage for RNG manipulation

« Last Edit: August 02, 2017, 11:38:36 AM by Da_Cloud »
"Most people think time is like a river that flows swift and sure in one direction, but I have seen the face of time, and I can tell you - they are wrong." ~ Prince of Persia

Frozen Josh

  • Moppet
  • *

  • Offline Offline
    • View Profile
Re: The RNG Method
« Reply #1 on: August 03, 2010, 05:10:48 AM »
When you input your LVL and MAG stats into the equation and apply it to all the RNG values, you will get your 'cure list', which will be the amount that cure will heal at that position in the RNG. Make sure you're already at full health with Serenity license if using the formula above.

Cast cure a couple times, getting for example 2346, 2387, 2310, and then use Ctrl+F to find whereabouts in the cure list the amounts you got for those cures are. So for our example, those three values of 2346, 2387 and then 2310 might fall consecutively at spots 586-587-588. That would mean you are now at position 588 in the RNG and the next random action will use the number at spot 589.

btw for most PS2 models, starting from a cold start the RNG will be at around the 500-600 mark. The exact range (of 11) of starting points depends on your PS2 model.

"Nothing is foolproof to a sufficiently talented fool..."

pprincess

  • Knight of the Round
  • *******
  • Mood: Smart Smart

    Offline Offline
    • View Profile
Re: The RNG Method
« Reply #2 on: August 03, 2010, 08:52:07 AM »
wowwww, great job on a brief write up that doesn't eschew the math behind the RNG. This is the best explanation I've seen on how the game and the PS 2 work to generate all the things we see in the game. I'm really proud that such a great group of people worked on this and cracked the whole thing a piece at a time.


flak76e

  • Rear Guard
  • ***

  • Offline Offline
    • View Profile
Re: The RNG Method
« Reply #3 on: August 03, 2010, 04:04:45 PM »
wowwww, great job on a brief write up that doesn't eschew the math behind the RNG. This is the best explanation I've seen on how the game and the PS 2 work to generate all the things we see in the game. I'm really proud that such a great group of people worked on this and cracked the whole thing a piece at a time.

Yes the Japanese players. We just translate it to english ^^


Frozen Josh

  • Moppet
  • *

  • Offline Offline
    • View Profile
Re: The RNG Method
« Reply #4 on: August 04, 2010, 07:50:31 AM »
=INT((20+(MOD($A750;20*12,5))/100)*((LV+MAG)*MAG/256+2)*1,5)

what does INT mean?
=INT(x) is a function in excel which rounds down the number x (in this case the entire formula) to the nearest integer (e.g. 5.8 -> 5 etc)

Quote
what does MOD mean?
MOD is a function for the remainder after having divided by another number (e.g. 28 MOD 5 = 3, or for Excel =MOD(28,5) -> 3)

Quote
$A750 what does this mean?
$A750 means cell A750, the $ sign before the A means it stays as that column when you drag the function to other cells, rather than changing the input cell.

Quote
MAG/256+2 (shall i first add 2 to 256 and then MAG/258 or (MAG/256) +2 ?
Its (MAG/256) + 2, though because of order of operations brackets aren't necessary.

Quote
on which page in piggybacks book is this formula?
If you're looking for formulas and game mechanics, rather than using piggyback check here:
http://www.gamefaqs.com/ps2/459841-final-fantasy-xii/faqs/45900

Quote
do i have to enter my base-mag value or the mag value with equipment?
Enter MAG value with equipment, thats what gets used in calculations (equips would be pretty pointless if it wasnt...)

Quote
i trief a lot but i dont know how tu use it with openoffice always when i insert the formula, it just fills one box with ##NAME?#
If you're getting #NAME etc, either your formula is incorrect, or you're referencing a cell with invalid data. Make sure the "A750" bit is referencing the cell with the RNG value you're using.

Quote
when should i start the cure list method?(licenses, which items equipped or which my i not equip?
It really doesn't matter when you use RNG manipulation. Though early on in the game there simply isn't really anything it would be worth your time for.
If you don't have the Serenity license, get rid of the *1.5
If you have the brawler license, equip a shield (no weap) and Cameo Belt to be able to hit yourself without damaging yourself. Other stuff really doesn't matter.

Quote
arent there other healvlues with lower/higher level differences
Not quite sure what you mean. Amount you heal from Cure depends on your MAG and LVL stats, and has a random factor of RND(1~1.125). We're not really interested in the actual number, just whereabouts in that 1-1.125 we landed so we know what RNG value we're up to. Increasing the MAG and LVL stats will increase the range that the 1-1.125 covers, and remove potential overlaps, though it shouldn't matter really when you do 2-3 cures and have a rough idea where you should be.


If you're not really familiar with the game mechanics or the excel/maths involved, I wouldn't spend too much effort trying to use all of this. Its certainly interesting for perfectionist files, and for those who've already spent hundreds of hours on the game and enjoy exploring all the technical details involved in it, but for casual gamers it really is far from necessary. If you just want a couple Zodiac Spears or something, don't get too obsessed with this.

"Nothing is foolproof to a sufficiently talented fool..."

wee187

  • Global Moderator
  • Knight of the Round
  • *****
  • Simply myself, no more and no less.
  • Mood: Relieved Relieved

    Offline Offline
    • View Profile
Re: The RNG Method
« Reply #5 on: August 09, 2010, 08:10:16 AM »
Holy Chocobo, I can't believe I didn't notice this topic till now. Wow, this is amazing, thank you all you RNG'ers who do this amazing work! :o


SwordStealer is my twin from across the country! ;D


JohnRayJr

  • Moppet
  • *

  • Offline Offline
    • View Profile
Re: The RNG Method
« Reply #6 on: August 12, 2010, 12:47:27 AM »
Can we collect everything that is known about chest-numbering for manipulating the spawn-checks when you zone in?

I know the Brave Suit is #1 and the ZS is #4 in the Hennes Mines. I know the Zodiac Escutcheon is #3 in Barheim Passage. It would be nice to know the number for the Dragon Mail chest so those could be doubled up.

I've seen numbering for one zone in Cerobi, but not the zone with the Fomalhaut/Ribbon/Venetian shield. Or, for that matter, the Magepower Shishak / Golden Skullcap. Although I think that information has been posted somewhere, I just don't recall where. Anyone have these details?


Infinity

  • Guest
Re: The RNG Method
« Reply #7 on: August 21, 2010, 08:46:28 AM »
Hey Everyone,

I have a cure spreadsheet I've been working on. It has some cool features that will make getting rare items easier. http://www.megaupload.com/?d=LN872RO6

* I've made conditional-formatting formulas
* added some columns to help set up chests
* the ability to count-down to your targeted cure value (where you want to enter a room or open a chest)
* and a neat tool that can move you to your position in the cure list, top of the spreadsheet or even your targeted cure location.

It was originally based upon bmxer31's spreadsheet. I also added some extra tabs to the workbook that came from nathany33's spreadsheet. Hopefully it can be a one-stop spreadsheet.   ;D


zero369

  • Moppet
  • *

  • Offline Offline
    • View Profile
Re: The RNG Method
« Reply #8 on: August 23, 2010, 04:13:20 AM »
nice macros Infinity

is it possiple to put that macros into a hyperlink cell?

i will post my links here also

excel 2003 and Openoffice
http://www.mediafire.com/?ngrm3zzb8x03gl3

excel 2007
http://www.mediafire.com/?idivgo766no3xz0


Infinity

  • Guest
Re: The RNG Method
« Reply #9 on: August 23, 2010, 10:50:22 PM »
zero369,
Hey that is a pretty cool version you made too. I think that putting the Jump-tool functionality into a single cell would be difficult. The Jump-tool is actually a VBA User Form. There are ways of adding Menu items, but that can get more complicated for the user to enable. I find the User-Form method is pretty handy because it is enabled to run in parallel w/ the rest of the spreadsheet. That way, you can use it no matter where your cursor is in the worksheet.  :)


yoshi1017

  • Guest
Re: The RNG Method
« Reply #10 on: November 02, 2010, 08:15:31 PM »
Sorry guys but I can't understand this at all, any chance I can get some help? I'm playing IZJS english patch.

For example, let's say I'm trying to get a Brave Suit in Cerobi Steppe/Fredrik River and using Infinity's spreadsheet. I'm using a level 44 Ashe, att power 12 and magic power 48. Casting 3 cures I get 426, 406, and 395. According to the spreadsheet that puts me at A754. What exactly am I supposed to do after that?

I did watch this video : http://www.youtube.com/watch?v=oe9BR14rWro
and checked out the spreadsheets in the link, but they don't look anything like they do in the video. I'm a little lost.

edit: forgot to say that she does NOT have serenity license.


Chaos

  • Global Moderator
  • Order of Ambrosia
  • *****

  • Offline Offline
    • View Profile
Re: The RNG Method
« Reply #11 on: November 02, 2010, 08:57:18 PM »
First you need to spawn that chest. Get near it, make sure everything around you is dead. Look at the first column of the spreadsheet. Then note the last two digits of the numbers. You need the next number's last two digits to be higher than 80, and the number that comes after that need to end in 95 or higher. Just keep casting Cure until you're in such a position. Then equip the Diamond Armlet and open the chest.

"Most people think time is like a river that flows swift and sure in one direction, but I have seen the face of time, and I can tell you - they are wrong." ~ Prince of Persia

Sirkrozz

  • Guest
Re: The RNG Method
« Reply #12 on: November 17, 2010, 04:49:23 PM »
Hello everyone; i registered just now in order to tell my experience with both my PS2 79001 and the RNG Method.
I just didn't want to end up following numbers in order to make good stuff appear; started with FF12GM's RNG method and accuratedly was able to spawn 3 Ribbons and several other stuff at Cerobi, which seem reasonably enough and potentially effective 90% of the time.

But then, when tried to follow up the same on Henne for the ZS Chest, i've rolled on the dices for several days with no results.
I started this game in 2006 and left it on Feb-07 due to personal issues, to start it again recently (same 3-year-and-a-bunch file).
 This is my first round and i want this file to be as complete as possible since i'll start my 2nd round on IZJS.

At first, i downloaded all the .xls in order to get to know the moves on this subject (though it's not hard to follow up, at first it's quite a mess).

Both the 2 listed here and the one made by Zero take a huge time on Excel to refresh, and it always ends up hangin my PC (and when the cells are disabled as the author prompted to, when modified again always delivers a "N/A" cell, when i entered correctly all the numbers).

I tried Split's, which besides user-friendly is pretty easy to follow up and in my opinion (being both a RPG veteran and a math numbskull) it should be used as reference for all average FFXII gamers.

On the matter he has listed, though, he shows where his PS2 starts from a cold boot.
In EVERY case i started followin' it, it seems SPCH-79001 starts always BELOW (and WAY below) the chart he indicates to position at in order to get the ZS Chest to spawn.
I have no problems on finding my place at the RNG chart; however, when i position on a MOD < 10 spot, where the chest ought to be spawning, it just simply does not. Moving from separation ore to the Phase 2 Dig makes my RNG to advance by about 15 spaces, and that's the riddle i cannot figure out yet (always checking last 2 digits end on a MOD<10).

I'd really appreciate any help here, since no matter how much i'd be reading the explanations over in time, all the time, i cannot neither to make my PS2 start near the spot Split shows nor landing on a correct spot, since i yet need to know exactly how to trigger this.

Sorry if my English isn't accurate enough.
Thanks to everyone here that have put another reason to keep playing this game, "fantastick" back now and then.

Greetings from Argentina!


Chaos

  • Global Moderator
  • Order of Ambrosia
  • *****

  • Offline Offline
    • View Profile
Re: The RNG Method
« Reply #13 on: November 17, 2010, 06:17:25 PM »
Personally, I use bmxer's spreadsheet. It's got everything I need and I have no loading problems with it.

Zodiac Spear is the fourth chest in the area, so you must focus on the fourth number. Here's how the chests get spawned:

Quote
The Phase 2 Dig in Henne Mines doesn't have weather changes nor random monsters. The first number that's used when zoning into the area is for Brave Suit. Zodiac Spear is the 4th number. This means if you want to spawn the Brave Suit chest, the next random number MOD 100 (divide it 100 and look at the remainder) must be less than 25, or 00-24. Determine your position in the RNG and keep casting Cure until you're in front of a number than ends in <25 (MOD 100 will always represent the last two digits of a number). When done, enter the area. The chest will have spawned, make your way towards it, eliminating all enemies because their actions also consume random numbers.

I'll give you an example. Hope it helps.

246982999   1658
418357212   1630
2016582332   1534
1655654879   1569
2531967718   1635
4273278111   1556
3833366304   1514
3336621627   1568
473846896   1582
2822736102   1549
2868527579   1532

You are aiming for the number in bold (ends in less than 10). Since the ZS chest is the 4th chest, the number must be four "places" away. That's why you position yourself at the 1534 Cure value and then enter the area. The chest will have spawned.

"Most people think time is like a river that flows swift and sure in one direction, but I have seen the face of time, and I can tell you - they are wrong." ~ Prince of Persia

Sirkrozz

  • Guest
Re: The RNG Method
« Reply #14 on: November 17, 2010, 11:06:00 PM »
Alright, i get it now (i didn't understand exactly about Chest numbers on the prior topics (just by pure luck, so to speak, i managed to get 2 ZSs to be spawned and then managed the contents).

Thanks a lot man; this for sure clarifies the whole subject for me!
Greetings! n_n