Fishing Data and Chances

If you are stuck in the Dunan Unification Wars; or wish for more details on the gameplay systems, this is the place.
Post Reply
Julian
Posts: 73
Joined: Wed Jan 29, 2014 9:17 pm

Fishing Data and Chances

Post by Julian »

Hi all,

I was spending some time looking at the fishing code, and I reversed how the game checks what fish you catch.

Fish Data Table:
Name - RNG - MaxFrame (Seconds Available In - calc by me, not in game table)
Boot - 1 - 3600 (5 to 60 seconds)
Squid - 4 - 2700 (5 to 45 seconds)
Stonefish - 3 - 1800 (5 to 30 seconds)
Blowfish - 3 - 1200 (5 to 20 seconds)
Whitefish - 5 - 1800 (5 to 30 seconds)
Shellfish - 5 - 2400 (5 to 40 seconds)
Shrimp - 4 - 3000 (5 to 50 seconds)
Salmon - 3 - 3600 (5 to 60 seconds)

While your line is out, the game keeps track of a frame counter. If the frame counter is > 300 (5 seconds) it does the RNG check. Once the frame counter reaches 36,000 (10 minutes) it resets back to 0.

Each frame, after 300, the game does an RNG roll for a number between 0 and 10,000.

It then loops through the table:
If the frame counter is < fish max frame, it checks if the RNG result hit the fish's RNG value range. (Boot would be a value of 0, Squid a value of 1 2 3 or 4, Stonefish a value of 5 6 or 7, etc.)

The Shellfish check does not happen until you've caught 1 Whitefish.
The Shrimp check does not happen until you've caught 2 Shellfish.
The Salmon check does not happen until you've caught 2 Shrimp.

So basically, each frame you have a 28/10,000 or a .28% chance that the RNG will hit one of your values. (Or less if you haven't unlocked the bottom 3.) However, each fish has a maximum frame it can appear in. So if you've passed that frame, that fish is no longer catchable. I added a "seconds available in" to the above table.

You basically have a full minute for RNG to hook you something. Once the game reaches frame 3600 Riou starts playing the sleeping animation. (If you wait 10 hours for the frame counter to reset back to 0, you get another minute to catch something! Animation doesn't change from zzz until you hook something. If you don't catch anything and wait another 10 minutes, he blinks his eyes before falling asleep again, since the animation is supposed to start with his eyes opened.)

Note: It's possible I misinterpreted something, but these findings align pretty well with my experience fishing. Also, this is all from the PSP version of the game. No idea if any changes were made to the core mechanics from the original, but they did screw up some of the text display code here, so it wouldn't surprise me...

Enjoy the pointless data! (lol)
Last edited by Julian on Sat Jan 28, 2023 10:53 am, edited 1 time in total.
User avatar
Raww Le Klueze
Global Admin
Posts: 1915
Joined: Sat Jun 26, 2004 1:38 am

Re: Fishing Data and Chances

Post by Raww Le Klueze »

Interesting. I recall it being said you needed to catch one of everything else before salmon would appear which would be technically correct then, ignoring the non-cooking fish, but can't remember anything being said about the others.
Doctorum Non Urina Singulus.
Julian
Posts: 73
Joined: Wed Jan 29, 2014 9:17 pm

Re: Fishing Data and Chances

Post by Julian »

More useless information:

The game loads Riou's Strength, Tech, Speed, and Luck. As far as I can tell, speed and luck are never used.

Skill is used when initializing fish stats. It seems to impact the fish bar size.
Image
Left is 0 (15) skill, right is 255 (270) skill. (min skill is 15 at 0 in memory) -- same fish on both sides.

Strength is used in two functions. Seems to do with how fast you reel in, and I'm not sure about the other one. These calcs get weird and hard to follow lol.

Some formulas:

Fish table:
Fish - base weight - variability - price - unk1 - unk2 - unk3 - unk4 - unk5 - unk6 - unk7 - unk8
Salmon - 150 - 100 - 4500 - 320 - 50 - 7500 - 2500 - 1250 - 50 - 40 - 20
Whitefish - 30 - 10 - 200 - 120 - 60 - 6000 - 3800 - 1700 - 30 - 35 - 10
Squid - 40 - 20 - 50 - 100 - 60 - 6000 - 3000 - 1600 - 30 - 30 - 10
Stonefish - 70 - 40 - 300 - 220 - 70 - 7200 - 2800 - 1400 - 35 - 30 - 20
Shellfish - 60 - 40 - 600 - 180 - 40 - 6000 - 2800 - 1500 - 35 - 30 - 20
Blowfish - 80 - 50 - 900 - 250 - 50 - 6800 - 3500 - 1500 - 30 - 30 - 10
Boot - 20 - 10 - 10 - 200 - 80 - 5000 - 7000 - 1700 - 30 - 20 - 20
Shrimp - 40 - 20 - 1200 - 300 - 40 - 7000 - 2000 - 1300 - 45 - 30 - 20

Fish weight caps at 200. Each incremental of 1 is an incremental of 0.05 kg. So 200 = 10kg.

Weight formula does 4 RNG calls: rng_result[0..3] = rand(variability/4) - (variability/8)
final weight = base weight + rng_result0 + rng_result1 + rng_result2 + rng_result3

Essentially, what you get is a range from [base-var/2,base+var/2]. So Salmon would go from 100 to 200, etc. However, because of integer division, you might lose some values on both sides.

Salmon, for example: rand(variability/4) = rand(25), or, [0..24]. (variability/8) is 12.5 but becomes 12. So the range becomes [-12,12]. Meaning the actual range should be 102 to 198. (I think... if I did this right?)

Price is a little more straightforward.

Final price = Price + Price*((final weight - base weight)/10)

So each +/-1 of weight over/under base weight adds/subtracts 10% of the base price.

Sorry I suck at converting assembly/disassembled code into easy to read formulas. I also need to stop looking at fishing already. >_<
You do not have the required permissions to view the files attached to this post.
User avatar
Raww Le Klueze
Global Admin
Posts: 1915
Joined: Sat Jun 26, 2004 1:38 am

Re: Fishing Data and Chances

Post by Raww Le Klueze »

Well that certainly explains why it felt like fishing got easier the further along in the game you were, it actually was.
Doctorum Non Urina Singulus.
Post Reply