Modding talk:Fish data

From Stardew Valley Wiki
Jump to: navigation, search
This talk page is for discussing Modding:Fish data.
  • Sign and date your posts by typing four tildes (~~~~).
  • Put new text below old text.
  • Be polite.
  • Assume good faith.
  • Don't delete discussions.

'Minimum depth' field incorrect

Based on the formula shown under the Spawn rate section, the data at index 9 isn't actually the minimum depth to find that fish. Rather it's the minimum depth at which that fish has the maximum chance for it to appear. So a fish with minimum depth of 4 can appear at a depth of 1, but it's less likely to happen. I'll try testing this with some short casts in areas with the affected fish. MissSlaughter (talk) 13:43, 25 October 2019 (UTC)

It does seem to be the case that the "minimum" isn't really the minimum, as I was able to catch a squid casting as close to the dock as possible. The cast showed around 2 bars, and the data file indicates the minimum for squid is 3. I'll update the description of that data field to include a more thorough description. MissSlaughter (talk) 15:33, 25 October 2019 (UTC)
You are correct. You may be interested in this:
https://docs.google.com/spreadsheets/d/1e8N36xqwfZLezSvaZeCEfzBiujE3kZEoPgK9c12CTw0/edit?usp=drivesdk
Also note that distanceFromLand is the distance of your previous cast. This value is stored on the rod but isn't updated until after a fish bites. BlaDe (talk) 19:53, 27 October 2019 (UTC)
The spreadsheets are very interesting, and "optimal" depth is a nice way to describe the "minimum depth" field. I'm trying to figure out a way to weigh the likelihood of each fish hitting/spawning in each location for the tables at Fishing Strategy#Time and Locations. Those are already arranged by season and time of day, so I was thinking about adding chance of getting a hit from the fish to the tables.
From what I understand, there's a for() loop which goes through a shuffled list of the fish, then a skill check for each fish in the array until you pass a skill check with a random element (or you fail the check for every fish and get trash instead). So it's more complicated than a weighted average of the chance of catching each available fish, though I'm not sure how to express those odds, or if it's even possible. Eg, there's a 1 in 5 chance that a certain fish will be the first to try to spawn, but if it's the 2nd to try to spawn, the odds of that certain fish spawning depends on the likelihood of the first fish failing to spawn. Thoughts? MissSlaughter (talk) 10:27, 28 October 2019 (UTC)
I'm also wondering how you calculated the U column in the spreadsheets ... did you use a formula, and if so, what was it? It'd make it a lot faster to figure out the chance of spawning a type of fish while taking into account the odds of interference from other fish spawning first. MissSlaughter (talk) 11:00, 29 October 2019 (UTC)
I think I independently came up with your same formula for the odds of each fish spawning, which is excellent because it means it's a lot more likely to be correct. Basically for each position in the spawning queue: calculated_spawn_rate * (all_fish_failure_rate - base_failure_rate) / ((number_of_fish - 1) * (fish_queue_position - 1)). Then just average the results for each possible queue position for that fish because it has equal odds of each position.
My results for Carp and Woodskip on a sunny day match your spread sheet (44.4% and 19.4% chance respectively). For a rainy day at skill level 3 and distance 5 (the current variables for the Secret Woods on your spreadsheet) I get Carp: 33.3%, Catfish: 29.5%, and Woodskip: 15.4%. MissSlaughter (talk) 12:59, 29 October 2019 (UTC)
Whoops, looks like I needed to raise the averaged failure rate to the power of the queue position, to properly reflect the accumulating odds of something having already been caught. The error didn't affect my Secret Woods calculations because there weren't enough fish in the spawning queue.
But I think it should be: calculated_spawn_rate * power( (all_fish_failure_rate - base_failure_rate)/(number_of_fish - 1), (fish_queue_position - 1)) for each position in the queue, then average the results due to the place of a fish in the spawning queue being truely random. MissSlaughter (talk) 16:55, 29 October 2019 (UTC)
I put some code into the sheet to calculate the overall odds. Change the time, weather, depth and fishing level to get each fish's base chance, then put any value in cell AA1 and column U will be recalculated.
The code goes through all permutations of the order of the fish, working out the odds of each position. These are then added, and divided by total permutations. Also if you haven't noticed, there are additional sheets for each season/location.BlaDe (talk) 05:58, 30 October 2019 (UTC)
I can't see a formula for any of the U columns or cell AA1, just the resulting numbers in the columns, though the other formulas show up (columns R, S, T).MissSlaughter (talk) 07:30, 30 October 2019 (UTC)
It's not a formula in a cell. It's in the code behind. I couldn't find a way to get it into the cell. To see it you need to be on a desktop version, then go Tools -> Script EditorBlaDe (talk) 19:12, 30 October 2019 (UTC)
Another thing to note about distanceFromLand, the water tiles beside land have a distance of 0. Then it goes 1,2,3,5. There is no 4. Also, bubbles add 1 to distance. Distance takes into account all directions, including diagonals. It literally draws a box around the tile the bobber lands on. I believe this is the tile the top left of the bobber is touching. BlaDe (talk) 19:58, 2 November 2019 (UTC)
That's useful info for people to have ... which file(s) is it in? Then we can add something to the modding page about it, and cite that for giving practical info about it on the fishing strategy page.MissSlaughter (talk) 09:42, 5 November 2019 (UTC)