Page 1 of 2

Fish Size and RNG

Posted: Mon Jun 16, 2014 12:57 am
by meth962
Couple people contacted me to look for the fish sizes and I've found some good leads but not 100% done yet. I've found some theoretical maximums but haven't found the game's RNG max yet. It all stems on an RNG number that I've observed but not followed. In order to find it in assembly would take a lot more work since it's jumps to a very distant section of code.

Anyway this is what I got so far.

Fish size is given a hidden number value from 150 to ??

XSmall: 0-200 (game forces minimum 150 though)
Small: 201-600
Medium: 601-800
Large: 801-1200
XLarge: 1201-??

Fishing Points are rewarded based off this size and rounded. The highest hacked value is 10,485 points per fish before the game bugs out. Some fish sizes need to be in the millions to get that high but the Spirit only needs to be 28,182 in size. I'm thinking the actual max size is 1500 but I have yet to confirm that.

Here are the values of the fish at min and max size of 1500:

Spikefish: 129-195
Lippian: 180-273
Charger: 64-97
Jack: 25-39
Fly Pie: 15-23
High Charger: 38-58
Octoban: 103-156
Devourer: 297-448
Barbara: 452-683
Spirit: 904-1366

If anyone gets higher than these then I guess size can be > 1500 :) That's all for now!

Re: Fish Size and RNG

Posted: Mon Jun 16, 2014 1:29 am
by Nightshade
Looking at your results and comparing them to our Fishing Page (which is a list, in some sense, of confirmed fishing results), your guess of max size at 1500 seems pretty reasonable, though extremely rare (we have confirmed Fly Pies at 23, Jacks at 37, High Chargers at 56, and Chargers at 95).

The one noteworthy thing is that we have a confirmed Spikefish at 127, which is lower than the minimum value you list. Any chance you would be willing to look into how that could occur, or at least double-check that number?

Re: Fish Size and RNG

Posted: Mon Jun 16, 2014 12:31 pm
by meth962
Hrm, if anything I was sure the lower number was right...but maybe I fat fingered 150 when I was editing the memory. Mistakes are very commonplace since I did it at 1 AM and have like 10 windows open for debugging this stuff XD

From what I followed in the assembly it was like this...

1. RNG two byte number for base size, I've seen as low as 0x01FA to as high as 0x7500 something. This usually works out to a number < 900 through bit shifting.

2. Another RNG number 0-4 for an extra +0, +100, +200, +300 or +400 in size
This RNG acts similarly to the RNG for which tier of fish you catch, so maybe the "Good!" status helps here as well (unconfirmed)

3. Game adds a hardcoded amount of +150 <- this is where I was sure you could not get lower than a 150. So either I didn't see the value is loaded from memory (and therefore affected maybe by location or lure) but I was pretty sure it was hardcoded.

I think I'll be home thursday this week to try it again. I forgot the fishing page! From the max's you give, it could be even 1400. The pattern seems to point to that from the size indications I've found. They go like this....+200,+400,+200,+400,+??? -> which would make me think ??? is +200 which would make 1400 the max : / hrm, I'll have to run through some more.

It doesn't help my emulator no longer allows me to breakpoint on code lines anymore, only memory read/write. Which is why I didn't find where the RNG is coming from but I know it must have a range because the max value for a two byte number was bugging out when catching a Spirit. Unless of course that's a live bug :)

Re: Fish Size and RNG

Posted: Mon Jun 16, 2014 3:32 pm
by Nightshade
Could you see what a range of, say, 120 - 1400 would look like in terms of the theoretical fish sizes?

That is, what point ranges for each fish we would expect to see?

Re: Fish Size and RNG

Posted: Mon Jun 16, 2014 4:33 pm
by meth962
120-1400 would be the fish sizes. Or do you mean are there different fish sizes? In that case no, the size is always calculated the same but each fish is worth different points based on the size.

Re: Fish Size and RNG

Posted: Mon Jun 16, 2014 4:38 pm
by Nightshade
Er, what I meant to say is can you convert a fish size range of 120 - 1400 in terms of what each fish's point value would be?

Re: Fish Size and RNG

Posted: Tue Jun 17, 2014 5:47 pm
by meth962
Mystery solved! I had an hour quick before going to a movie so I was able to figure this out. That +150 min size is only from legendary rod. Funny enough, old rod is 50 minimum, and deluxe rod is 100 minimum. So the rod you use does determine at least your lowest value. So seeing as the lowest size is 50, I've adjusted the values below to be min to max fishing points based on size 50 to size 1500.

Points:
Spikefish: 124-195
Lippian: 174-273
Charger: 62-97
Jack: 24-39
Fly Pie: 14-23
High Charger: 37-58
Octoban: 99-156
Devourer: 285-448
Barbara: 435-683
Spirit: 870-1366

Now that's IF you can catch all these with an old rod. Otherwise here are the min values for each rod:

Old Rod, Deluxe, Legendary
Spikefish: 124,126,129
Lippian: 174,177,180
Charger: 62,63,64
Jack: 24,25,25
Fly Pie: 14,15,15
High Charger: 37,38,38
Octoban: 99,101,103
Devourer: 285,291,297
Barbara: 435,443,452
Spirit: 870,887,904

Re: Fish Size and RNG

Posted: Tue Jun 17, 2014 6:25 pm
by Nightshade
So, is it correct to say that the conversion of fish size (from the internal RNG) into point values is an affine transformation?

That is, would it follow that a fish's point value is calculated according to the equation: points = a +b*size, where a and b are some parameters for each fish?

Re: Fish Size and RNG

Posted: Tue Jun 17, 2014 11:44 pm
by meth962
I come bearing gifts! Got home from the movie and finally finished translating the assembly code. It's no wonder the equation wasn't a simple b*size+a...they're bit shifting. Here is the formula...

Points = (Size+0x9c0)*worth*0x51eb851f >> 30

turning hex into decimal would look like...

Points = (Size+2496)*worth*1374389535 >> 30

So the ">> 30" part means to right shift your bits. On windows calculator it's the "Rsh" button.

Here is the table of "worth" in the game code...
Spirit: 0x11170 (70000)
Barbara: 0x88b8 (35000)
Devourer: 0x59d8 (23000)
Octoban: 0x1f40 (8000)
H Charger: 0xbb8 (3000)
Flypie: 0x4b0 (1200)
Jack: 0x7d0 (2000)
Charger: 0x1388 (5000)
Lippian: 0x36b0 (14000)
Spikefish: 0x2710 (10000)

Maybe someone who's good at math can get around the bit shifting thing but I'm too tired to think right now. Although I will leave you with one last gift tonight! Stumbled upon this layout when looking at the fish worth....seems to be other stats like life, recovery time, etc.

Spikefish
Worth: 2710 (10000)
???: fa (250)
???: 3c (60)
???: 04 (4)
???: 400 (1024)
???: c8 (200)
???: 200 (512)
???: 5a (90)
???: 190 (400)
0x1ceb60

Lippian
Worth: 36b0 (14000)
???: 10e (270)
???: 55 (85)
???: 07 (7)
???: 400 (1024)
???: c8 (200)
???: 800 (2048)
???: c8 (200)
???: 1f4 (500)
x1ceb58

Charger:
Worth: 1388 (5000)
???: dc (220)
???: 50 (80)
???: 02 (2)
???: 200 (512)
???: 200 (512)
???: 200 (512)
???: 0a (10)
???: c8 (200)
x1ceb50

Jack:
Worth: 7d0 (2000)
???: 96 (150)
???: 32 (50)
???: 04 (4)
???: 1000 (4096)
???: c8 (200)
???: 800 (2048)
???: 1e (30)
???: 190 (400)
x1ceb48

Flypie:
Worth: 4b0 (1200)
???: 78 (120)
???: 46 (70)
???: 03 (3)
???: 400 (1024)
???: 200 (512)
???: 200 (512)
???: 1e (30)
???: c8 (200)
x1ceb38

High Charger:
Worth: bb8 (3000)
???: 64 (100)
???: 32 (50)
???: 04 (4)
???: 800 (2048)
???: 3e8 (1000)
???: 200 (512)
???: 14 (20)
???: c8 (200)
x1ceb30

Octoban:
Worth: 1f40 (8000)
???: cd (205)
???: 32 (50)
???: 07 (7)
???: 800 (2048)
???: 3e8 (1000)
???: 300 (768)
???: 32 (50)
???: 1f4 (500)
x1ceb24

Devourer:
Worth: 59d8 (23000)
???: 140 (320)
???: 3c (60)
???: 0a (10)
???: 3fc (1020)
???: 3e8 (1000)
???: 400 (1024)
???: 10e (270)
???: 320 (800)
x1ceb1c

Barbara:
Worth: 88b8 (35000)
???: 172 (370)
???: 6e (110)
???: 0a (10)
???: 3fc (1020)
???: 3e8 (1000)
???: 400 (1024)
???: 140 (320)
???: 384 (900)
???: 801ceb14

Spirit
Worth: 11170 (70000)
???: 1a4 (420)
???: 64 (100)
??? 10 (16)
???: 3fc (1020)
???: 3e8 (1000)
???: 400 (1024)
???: 15e (350)
???: 3e8 (1000)

Re: Fish Size and RNG

Posted: Wed Jun 18, 2014 9:39 am
by meth962
And more gifts! Geeze, I'm spoiling you people perhaps :) Can't help it, I love you guys haha

So I put together the point ranges based on my recent findings and compared them to what is on the fishing page. It looks really solid as there were no lower numbers than the minimums and no higher number than the maximums. One thing to note is that due to their weird calculations, some fish (especially smaller ones) can get the same point value but have different size classes. For instance a Small Spikefish could be worth 151 points, and so can a Medium Spikefish. You can already see that on the numbers that K73SK has on the site, but I found more of them. Really good job on what's out there as some of them are spot on.

Also, because of max number that K73SK found for the charger, I know that you can get a fish of size > 1400, maybe proving my 1500 guess is accurate. Don't know if it can go higher than this yet but it's a start!

Spikefish
XSmall: 124-131
Small: 131-151
Medium: 151-160
Large: 160-180
XLarge: 180-195

Lippian
XSmall: 174-184
Small: 184-211
Medium: 211-225
Large: 225-252
XLarge: 252-273

Charger
XSmall: 62-65
Small: 65-75
Medium: 75-80
Large: 80-90
XLarge: 90-97

Jack
XSmall: 24-26
Small: 26-30
Medium: 30-32
Large: 32-36
XLarge: 36-39

Flypie
XSmall: 14-15
Small: 15-18
Medium: 18-19
Large: 19-21
XLarge: 21-23

High Charger
XSmall: 37-39
Small: 39-45
Medium: 45-48
Large: 48-54
XLarge: 54-58

Octoban
XSmall: 99-105
Small: 105-120
Medium: 120-128
Large: 128-144
XLarge: 144-156

Devourer
XSmall: 285-302
Small: 302-347
Medium: 347-370
Large: 370-415
XLarge: 415-448

Barbara
XSmall: 435-460
Small: 460-529
Medium: 529-563
Large: 563-631
XLarge: 631-682

Spirit
XSmall: 870-921
Small: 921-1058
Medium: 1058-1126
Large: 1126-1263
XLarge: 1263-1365

Again, do note that the minimum size for XSmall is based off having the Old Rod equipped.

Also, I read this...
Got a picture to prove that the points can be lower/higher? For example, if a fish says "70-72" and you catch one with "73", take a complete screen shot, present it to the forums, and we'll adjust the numbers as met. Did you find a fish with a different lure? For example, you caught an octoban on a light lure? Screenshot that too and present it! You'll get a reward (forum dollars) for these findings!
;) nudge nudge - I almost have enough forum bucks for a raseru :D