Talk:Ice Pip

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

Discussion copied from the old wiki

Source: https://stardewcommunitywiki.com/Talk:Ice_Pip

Fishing Level

The fishing level requirement currently posted on the page comes from the Ice Pip entry in Fish.xnb. But Fish.xnb is completely ignored when deciding whether or not an Ice Pip is caught -- similar to all Legendary fish. There's custom code in MineShaft::getFish that decides whether or not an Ice Pip appears. Higher fishing level increases the chances of catching an Ice Pip, but there's no hard cutoff value. The same holds true for the other level-specific Mine fish, namely Stonefish and Lava Eel.Nebulous Maestress (talk) 19:37, 13 September 2020 (UTC)

So there's code in Fish.xnb that gives a hard Fishing-skill level for the mine fish, but that code is overridden/ignored where the fish type of a catch is decided? Makes for confusing code reading at first, yes? And I'd call that a latent bug. What calls MineShaft:getFish? Change that, and all of a sudden you could introduce the hard Fishing-level skills where they didn't exist before, all without touching the actual functions that are supposed to make the decision. When I was an engineer this was one of the most-hated types of bugs, and I've seen whole teams sweat for days to locate them and have parties once they did. I suspect that CA would appreciate knowing about this. Butterbur (talk) 05:20, 14 September 2020 (UTC)
My reading concurs. Location::getFish is reimplemented in MineShaft, and has hardcoded checks for the level specific fish. For 20 and 60, if the level specific fish check fails, the base implementation on getFish is called, for 100 a random piece of trash is returned. BlaDe (talk) 07:35, 14 September 2020 (UTC)
Thanks for double checking, BlaDe. The fallback to base getFish at levels 20/60 is what allows Ghostfish to also be caught; at 100, no falllback means no Ghostfish.
Butterbur, yes, it definitely makes interpreting code/game data tricky. But I’m not inclined to classify it as a bug, especially not as far as gameplay — it doesn’t have any negative/unexpected impact while playing the game. (Modders might have reason to care more, but if so details probably belong in modding namespace.)
Fundamentally, it comes down to object-oriented programming (OOP) in all its powerful but maddening glory. The code always calls location->getFish, but OOP means any location can opt to have a customized function, such as MineShaft::getFish, that makes its own fish-spawning decisions based on any criteria it wants. Fish.xnb and Locations.xnb only control spawning if the decision falls back to the generic GameLocation::getFish function.
The telltale hint here is that based on generic spawning, none of these fish should ever be possible (see, e.g. Locations.xnb as posted to Talk:Fish; only Ghostfish is listed for the Mines). As soon as a non-generic mechanism kicks in, we shouldn’t assume the generic parameters apply. The other “impossible” fish per generic spawning are the legendary fish and submarine-specific fish; those fish already had correct info on the wiki.Nebulous Maestress (talk) 19:52, 14 September 2020 (UTC)
Thanks, NM. Didn't realize this was a function override in a subclass. I don't have the code to look at myself: not that I couldn't, I just don't want to. So given that, I certainly agree, it's not a bug, and not especially tricky in OOP. I guess these days, I just expect the worst when it comes to fish. ;) Butterbur (talk) 03:17, 15 September 2020 (UTC)

--margotbean (talk) 14:04, 12 October 2021 (UTC)