Jump to content

Modding:Fish ponds

From Stardew Valley Wiki
Revision as of 00:13, 16 November 2024 by imported>Pathoschild (remove outdated 'raw data' section)

← Index

This page explains how the game stores and parses Fish Pond data. This is an advanced guide for mod developers.

Format

The fish pond data in Data/FishPondData consists of a list of elements with these fields.

field purpose
Id The unique string ID for this entry.
RequiredTags The context tags for fish which should use this entry. A tag can be prefixed with ! to require that the fish not have that tag.

For example, ["fish_ocean", "fish_crab_pot", "!fish_carnivorous"] will match ocean fish that can be caught in crab pots and aren't carnivorous.

The first matching entry based on the Precedence field is used. If no other entries match, Data/FishPondData has a default entry with the required tags category_fish as a catch-all for any fish without their own entry.

ProducedItems The items that can be produced by the selected fish.

When a fish pond is ready to produce output (based on a hardcoded (15 + 8 * population of pond)% chance), it checks each entry in the list and takes the first one that matches. If no entry matches, no output is produced.

This consists of a list of models with these fields:

field purpose
ItemId The item query or item ID to produce, or the exact string (O)812 (roe) to produce roe for the current fish.
RequiredPopulation (Optional) The minimum number of fish in the pond required to produce this item. Default 0.
Chance (Optional) The probability that this item will be produced, as a value between 0 (never) and 1 (always). This is applied after the base chance of producing any item above. Default 1.
MinQuantity (Optional) The minimum stack size for the produced item. Default 1.
MaxQuantity (Optional) The maximum stack size for the produced item. Default 1.
PopulationGates The rules which decide when the fish pond population can grow (up to a hardcoded limit of 10 fish), and the quests that must be completed to do so. If omitted, the population can grow to 10 fish with no quests.

This consists of a number → item IDs lookup, where:

  • The key is the population number at which this gate applies.
  • The value is a list of possible quest items that may be requested by the fish at random to complete the gate. Each item is represented by 1–3 space-delimited values: the item ID, minimum quantity, and maximum quantity. If both min and max quantity are specified, a random number in that range is used. If only the min quantity is specified, that exact number is used. If neither are specified, the fish will request one.

For example, consider this population gate:

"6": [ "422 2 3", "60 2", "749 2 3", "116" ]

This means that before the population grows to 6, the fish will randomly ask for one of these:

Precedence (Optional) The order in which this entry should be checked, where 0 is the default value used by most entries. Entries with the same precedence are checked in the order listed. Default 0.
SpawnTime (Optional) The number of days needed to raise the population by one if there's enough room in the fish pond.

If omitted, the game chooses a value based on the base fish price: 1 day (0–30g), 2 days (31–80g), 3 days (81–120g), 4 days (121–250g), or 5 days (250g+).