Miscellaneous Forums > Scripting and Reverse Engineering

[FF7] Chocobo Encounters Chance

(1/2) > >>

Raziel80:
How does Chocobo Lure rating affect the chance of chocobo battles on the world map? Need a calculation formula.
What are the chances of chocobo battles on the world map with a Chocobo Lure rating of 12, 20, 28?

Probability for Chocobo battles on the world map:
Chocobo Ranch: 4 battles with probability 24 each: 24*4=96 total
Junon: 4 battles with probability 16 each: 16*4=64 total
Everywhere else: total probability = 32

--- Code: ---Chocobo Encounter Chart:

.-------------.-------.---------------.---------------.-----------------------.
|Chocobo Lure |Rating:|Chance Chocobo |Chance Chocobo |Chance Chocobo         |
|Materia Lvl: |       |battle Ranch:  |battle Junon:  |battle everywhere else:|
|-------------|-------|---------------|---------------|-----------------------|
|Level 1&2    |   8   |     75%       |      50%      |         25%           |
|Level 3&4    |  16   |    100%       |     100%      |         50%           |
|2x Lvl 3 or 4|  32   |    100%       |     100%      |        100%           |
'-------------'-------'---------------'---------------'-----------------------'
--- End code ---

Chocobo Lure Materia
Lvl
1:  + 8 Chocobo Lure Rating
2:  +12 Chocobo Lure Rating
3:  +16 Chocobo Lure Rating

nfitc1:
Each polygon of the WM has a flag that labels it as having chocobo tracks. If you are on one of those polygons and your chocobo rating is > 0 (max of 32) then it will check for a chocobo formation.

A "random" encounter byte will be chosen from the encounter PRNGLUT and be multiplied by 4096 then be divided by the chocobo encounter rate. If the chocobo formation encounter chance is greater than this rate, then a chocobo battle will be selected. There are 28 chocobo formations

--- Code: ---Area formation chance
1,0,0 38 24,576 - Farm
1,0,1 39 49,152
1,0,2 3C 73,728
1,0,3 3D 98,304

2,0,0 4E 16,384 - near Junon
2,0,1 4F 32,768
2,0,2 50 49,152
2,0,3 51 65,536

4,0,0 62 5,120 - outside Gold Saucer desert
4,0,1 63 10,240
4,0,2 68 21,504
4,0,3 69 32,768

8,0,0 98 5,120 - North of Rocket Town
8,0,1 99 10,240
8,0,2 9C 21,504
8,0,3 9D 32,768

9,1,0 0A2 8,192 - Wutai island
9,1,1 0A3 16,384
9,1,2 0A6 24,576
9,1,3 0A7 32,768

B,1,0 0CA 3,072 - Snow fields
B,1,1 0CB 6,144
B,1,2 0CE 19,456
B,1,3 0CF 32,768

C,0,0 0D6 7,168 - Outside Mideel
C,0,1 0D7 14,336
C,0,2 0DA 23,552
C,0,3 0DB 32,768
--- End code ---

I can't guarantee those locations are accurate and don't worry about what the area column means; They're not the point. What IS the point is that the value in the encounter rate has to be LESS than any of these numbers in order to encounter a chocobo in the designated area. If none of these formations are selected then a random battle in the region will be selected. There's some other check I don't recognize that doesn't influence the calculations at all.

For example, I'm in the area around Junon with two max level chocobo lures. The chocobo rating is capped at 32.
A battle check occurs and the PRNGLUT gives me a 36.
36 << 12 = 147,456
147,456 / 32 = 4,608
Chocobo Formation 4E is encountered

If the PRNGLUT gives me 160, then I get
100 << 12 = 655,360
655,360 / 32 = 20,480
Chocobo Formation 4F is encountered

Raziel80:

--- Quote from: NFITC1 on 2021-06-28 19:35:05 ---For example, I'm in the area around Junon with two max level chocobo lures. The chocobo rating is capped at 32.
A battle check occurs and the PRNGLUT gives me a 36.
36 << 12 = 147,456
147,456 / 32 = 4,608
Chocobo Formation 4E is encountered

If the PRNGLUT gives me 160, then I get
160 << 12 = 655,360
655,360 / 32 = 20,480
Chocobo Formation 4F is encountered

--- End quote ---

Thanks. I'm also interested in the probability of all 4 chocobo battles on different areas of the world map.
So, according to this table:

--- Code: ---.-------------.-------.---------------.---------------.-----------------------.
|Chocobo Lure |Rating:|Chance Chocobo |Chance Chocobo |Chance Chocobo         |
|Materia Lvl: |       |battle Ranch:  |battle Junon:  |battle everywhere else:|
|-------------|-------|---------------|---------------|-----------------------|
|Level 1      |   8   |     75%       |      50%      |         25%           |
|Level 3&4    |  16   |    100%       |     100%      |         50%           |
|2x Lvl 3 or 4|  32   |    100%       |     100%      |        100%           |
'-------------'-------'---------------'---------------'-----------------------'
--- End code ---
The sum of the probabilities of 4 chocobo battles:
Chocobo Farm: 96
Junon: 64
Everywhere else: 32
I think that, max total probability of chocobo battles = 128. (Usually max total probability for other battles (encounters) = 64, as we can see in the Makou Reactor)
Which means that near the chocobo farm probability is 96 (or 75%) ( if the Chocobo Lure Rating = 8 ): 96 / 128 = 75%
Junon: 64 / 128 = 50%
everywhere else: 32 / 128 = 25%
So, if the Chocobo Lure Rating = 12, then: ( 96 * 12 / 8 ) / 128 = 144 / 128 = 112,5% (max 100%), where 96 - Overall probability of 4 chocobo battles at chocobo farm; 12 - Chocobo Lure Rating;
Junon: ( 64 * 12 / 8 ) / 128 = 96 / 128 = 75%
Everywhere else: ( 32 * 12 / 8 ) / 128 = 48 / 128 = 37,5%
But, this is just my theory based on the table above. Can you confirm my theory?

nfitc1:
You can probably work that out based on the information I posted above. With a maxed out lure rating of 32 you're guaranteed a chocobo encounter each time. They're not quite selected the same way a random battle is. If your lure value is high enough you will get a chocobo battle, else it will be a regular battle. Are you talking about encounter rates? Those are a little different and don't work the same way on the WM than they do on the fields.

Based on your table, a level 1 lure will give each battle encounter a 25% chance of being a chocobo battle "everywhere else" which isn't true because North of Rocket Town and Costa del Sol regions have higher chances of an encounter (about 58%). The Farm and Junon are correct, though. That "everywhere else" only applies to Wutai's, Mideel's, and Snow Field's tracks.

If you need a more detailed explanation and an actual table I might be able to provide one tomorrow.

Raziel80:

--- Quote from: NFITC1 on 2021-06-30 00:09:00 ---Are you talking about encounter rates? Those are a little different and don't work the same way on the WM than they do on the fields.
--- End quote ---
Yes. I want to know the chance of chocobo battles that are based on encounter rating.

Example for Special Formation battles (Back Attack 1, Back Attack 2, Side Attack, Ambush):
Junon Area - Grass                             Encounter Value:  32
Normal Battle #1:  16/64 Chance       Back Attack #1:     4/64 Chance
Row 1: 2x Nerosuferoth                Row 2: 2x Nerosuferoth
Normal Battle #2:  16/64 Chance       Back Attack #2:     4/64 Chance
Row 1: 2x Nerosuferoth                Row 1: 1x Nerosuferoth
Row 2: 1x Formula                        Row 2: 2x Nerosuferoth
Normal Battle #3:  16/64 Chance
Row 1: 1x Zemzelett
Normal Battle #4:  16/64 Chance
Row 1: 1x Zemzelett,
2x Nerosuferoth

We have 2 special formation battles with 4/64 Chance: 4 + 4 = 8/64 Chance for special formation battles, and 64 - 8 = 56 / 64 = Chance for Normal Battles.

According to the Enemy Mechanics FAQ by TFergusson:
Spoiler: showEach unique area can support up to: 6 Normal battles and 4 Special Formation battles.
In addition, World Map areas can support a further 4 Chocobo battles.
As soon as the chance succeeds and a random battle is going to occur, the following things are considered in order:
Unique/Chocobo Battles
Pre-emptive Chance
Special Formations
Normal Battles

If the area has any Special Formation battles, you have a chance of getting them first.
All Special Formation Battles have a chance out of 64 of occurring.
The chance of not getting a Special Formation battle is equal to 64/64 minus the sum of the probabilities of all available Special Formation battles.

Example for Chocobo Battles 1, 2, 3, 4:
Junon Area - Chocobo tracks (if Chocobo lure rating > 0)
Chocobo Battle 1 = 16/128 Chance (I think it is 16/128, and not 16/64)
Chocobo Battle 2 = 16/128 Chance
Chocobo Battle 3 = 16/128 Chance
Chocobo Battle 4 = 16/128 Chance
16*4 = 64/128 Chance for Chocobo battles (50% as we can see in the table above)

Chocobo Farm Area - Chocobo tracks
Chocobo Battle 1 = 24/128 Chance (I think it is 24/128, and not 24/64)
Chocobo Battle 2 = 24/128 Chance
Chocobo Battle 3 = 24/128 Chance
Chocobo Battle 4 = 24/128 Chance
24*4 = 96/128 Chance (75% as we can see in the table above)

Gold Saucer Area - Chocobo tracks (near Gold Saucer Desert)
Chocobo Battle 1 = 5/128 Chance
Chocobo Battle 2 = 5/128 Chance
Chocobo Battle 3 = 11/128 Chance
Chocobo Battle 4 = 11/128 Chance
5+5+11+11 = 32/128 Chance (25%)
Spoiler: show
Rocket Town Area - Chocobo tracks
Chocobo Battle 1 = 5/128 Chance
Chocobo Battle 2 = 5/128 Chance
Chocobo Battle 3 = 11/128 Chance
Chocobo Battle 4 = 11/128 Chance
5+5+11+11 = 32/128 Chance (25%)

Wutai Area - Chocobo tracks
Chocobo Battle 1 = 8/128 Chance
Chocobo Battle 2 = 8/128 Chance
Chocobo Battle 3 = 8/128 Chance
Chocobo Battle 4 = 8/128 Chance
8*4 = 32/128 Chance (25%)

Icicle Area (Snow Field) - Chocobo tracks
Chocobo Battle 1 = 3/128 Chance
Chocobo Battle 2 = 3/128 Chance
Chocobo Battle 3 = 13/128 Chance
Chocobo Battle 4 = 13/128 Chance
3+3+13+13 = 32/128 Chance (25%)

Mideel Area - Chocobo tracks
Chocobo Battle 1 = 7/128 Chance
Chocobo Battle 2 = 7/128 Chance
Chocobo Battle 3 = 9/128 Chance
Chocobo Battle 4 = 9/128 Chance
7+7+9+9 = 32/128 Chance (25%)

But 32/128 Chance (25%) if the Chocobo lure rating = 8.
And 32/128 Chance (25%) possibly multiplied by Chocobo lure rating and divided by 8: (32 * 8/8) / 128 = 32/128 (25%).
So,  for Chocobo lure rating 16:  (32 * 16/8) / 128 = 64/128 Chance (50%);
for Chocobo lure rating 32: (32 * 32/8) / 128 = 128/128 Chance (100%), which is the same as the table above. I don't know who created this table, but it seems to be true. Because with Chocobo lure rating we can increase chance for Chocobo battles. And of course, this is just a theory based on the table.

--- Quote from: NFITC1 on 2021-06-30 00:09:00 ---If you need a more detailed explanation and an actual table I might be able to provide one tomorrow.
--- End quote ---
Yes, it would be nice. Because I do not know, how Chocobo lure rating increases chance for Chocobo battles. My only guess is that the Chocobo lure rating increases the Chocobo encounter rating while calculating the instructions, and this increases the chance of chocobo battles.