Changes

Add new data field that was added in Stardew Valley 1.6
Line 4: Line 4:     
==Parsing fish spawn conditions==
 
==Parsing fish spawn conditions==
The game checks two places to determine which fish to spawn when the player is fishing. This only applies to normal fish; the chance of spawning a legendary fish is calculated separately by the location code, ''before'' following the rules below. <small>(Reverse engineered from <tt>BobberBar</tt> and <tt>GameLocation::getFish</tt>.)</small>
+
The game checks two places to determine which fish to spawn when the player is fishing. This only applies to normal fish; the chance of spawning a legendary fish is calculated separately by the location code, ''before'' following the rules below. <small>(Reverse engineered from <samp>BobberBar</samp> and <samp>GameLocation::getFish</samp>.)</small>
    
===Spawn locations===
 
===Spawn locations===
Line 11: Line 11:  
** [[Cindersap Forest#The Pond|pond]] (area #1 for tiles <code>(0, 0)</code> through <code>(52, 42)</code> inclusively);
 
** [[Cindersap Forest#The Pond|pond]] (area #1 for tiles <code>(0, 0)</code> through <code>(52, 42)</code> inclusively);
 
** [[Cindersap Forest#The River|river]] (area #0 matching any other part of the forest).
 
** [[Cindersap Forest#The River|river]] (area #0 matching any other part of the forest).
 +
* [[Ginger Island#Island West|Ginger Island West]]
 +
** Freshwater (area #2 for tiles <code>(36, 0)</code> through <code>(36, 80)</code> inclusively);
 +
** Ocean (area #1 matching any other location)
 
* All other locations only have area -1, so where you fish from has no impact.
 
* All other locations only have area -1, so where you fish from has no impact.
   −
The fish that can be spawned in a given location are defined in the slash-delimited data from <code>Data\Locations.xnb</code>, specifically field indexes 4 (spring), 5 (summer), 6 (fall), and 7 (winter). Each field contains any number of {{t|int fishID}} (matching <code>Data\Fish.xnb</code>) + {{t|int areaID}} (or -1 for any area) pairs. For example, [[Cindersap Forest]] has this fish data for summer: <code>153 -1 145 0 144 -1 138 0 132 0 706 0 704 0 702 0</code>. That can be parsed as:
+
The fish that can be spawned in a given location are defined in the slash-delimited data from <code>Data\Locations.xnb</code> (see also: [[Modding:Location data]]) specifically field indexes 4 (spring), 5 (summer), 6 (fall), and 7 (winter). Each field contains any number of {{t|int fishID}} (matching <code>Data\Fish.xnb</code>) + {{t|int areaID}} (or -1 for any area) pairs. For example, [[Cindersap Forest]] has this fish data for summer: <code>153 -1 145 0 144 -1 138 0 132 0 706 0 704 0 702 0</code>. That can be parsed as:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 54: Line 57:     
===Fish data and spawn criteria===
 
===Fish data and spawn criteria===
The fish data and spawn criteria is stored as thirteen slash-delimited fields in <code>Data\Fish.xnb</code>:
+
The fish data and spawn criteria is stored as fields in <code>Data\Fish.xnb</code>. This consists of two different formats.
 +
 
 +
If the second field is <code>trap</code>, the fish can only be caught using a [[Crab Pot|crab pot]] and it uses this format:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 63: Line 68:  
|-
 
|-
 
| 0
 
| 0
| <code>name</code>
+
| {{t|name}}
 +
| <code>Lobster</code>
 +
| The fish name.
 +
|-
 +
| 1
 +
| {{t|type}}
 +
| <code>trap</code>
 +
| Must be <code>trap</code> to indicate a crab pot catch.
 +
|-
 +
| 2
 +
| {{t|chance}}
 +
| <code>.05</code>
 +
| The percentage chance that this fish will be caught as a value between 0 and 1. Only applies if a fish listed earlier in the file isn't selected first.
 +
|-
 +
| 3
 +
|
 +
| <code>688 .45 689 .35 690 .35</code>
 +
| Unused.
 +
|-
 +
| 4
 +
| {{t|location}}
 +
| <code>ocean</code>
 +
| The type of water body where the fish can be caught; one of <code>freshwater</code> or <code>ocean</code>.
 +
|-
 +
| 5
 +
| {{t|min size}}
 +
| <code>2</code>
 +
|rowspan="2"| The minimum and maximum size of the caught fish in inches for fishing stats. In non-English languages, this is converted to centimetres by multiplying by 2.54.
 +
|-
 +
| 6
 +
| {{t|max size}}
 +
| <code>20</code>
 +
|}
 +
 
 +
Otherwise it's a fish that can be caught while fishing and uses this format:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! index
 +
! syntax
 +
! example
 +
! content
 +
|-
 +
| 0
 +
| {{t|name}}
 
| <code>Pufferfish</code>
 
| <code>Pufferfish</code>
 
| The fish name.
 
| The fish name.
 
|-
 
|-
 
| 1
 
| 1
| <code>number</code>
+
| {{t|chance to dart}}
 
| <code>80</code>
 
| <code>80</code>
 
| How often the fish darts in the fishing minigame; between 15 ([[carp]]) and 100 ([[glacierfish]]).
 
| How often the fish darts in the fishing minigame; between 15 ([[carp]]) and 100 ([[glacierfish]]).
 
|-
 
|-
 
| 2
 
| 2
| <code>"mixed&#124;dart&#124;smooth&#124;floater&#124;sinker"</code>
+
| {{t|darting randomness}}
 
| <code>floater</code>
 
| <code>floater</code>
| How the bobber behaves during the fishing minigame.
+
| How the bobber behaves during the fishing minigame; one of <code>mixed</code>, <code>smooth</code>, <code>floater</code>, <code>sinker</code>, or <code>dart</code>.
 
|-
 
|-
 
| 3
 
| 3
| <code>int</code>
+
| {{t|min size}}
 
| <code>1</code>
 
| <code>1</code>
| The minimum fish size (in inches).
+
|rowspan="2"| The minimum and maximum size of the caught fish in inches for fishing stats. In non-English languages, this is converted to centimetres by multiplying by 2.54.
 
|-
 
|-
 
| 4
 
| 4
| <code>int</code>
+
| {{t|max size}}
 
| <code>36</code>
 
| <code>36</code>
| The maximum fish size (in inches).
   
|-
 
|-
 
| 5
 
| 5
| [<code>min time</code> <code>max time</code>]+
+
| [{{t|min time}} {{t|max time}}]+
 
| <code>1200 1600</code>
 
| <code>1200 1600</code>
 
| The time of day when they spawn. The min time is inclusive, max time is exclusive. May specify multiple ranges.
 
| The time of day when they spawn. The min time is inclusive, max time is exclusive. May specify multiple ranges.
 
|-
 
|-
 
| 6
 
| 6
| [<code>"spring&#124;summer&#124;fall&#124;winter</code>"]+
+
| [{{t|season}}]+
| <code>season ID</code>
+
| <code>summer</code>
| The seasons when they spawn. May specify multiple. (This is ignored. Seasons are taken from Locations.xnb instead)
+
| Unused; seasons are taken from <samp>Data/Locations</samp> instead.
 
|-
 
|-
 
| 7
 
| 7
| <code>"sunny&#124;rainy&#124;both"</code>
+
| {{t|weather}}
 
| <code>sunny</code>
 
| <code>sunny</code>
| The weather when they spawn.
+
| The weather when they spawn; one of <code>sunny</code>, <code>rainy</code>, or  <code>both</code>.
 
|-
 
|-
 
| 8
 
| 8
|  
+
| {{t|locations}}
 
| <code>690 .4 685 .1</code>
 
| <code>690 .4 685 .1</code>
| Unused.
+
| Unused; locations are taken from <samp>Data/Locations</samp> instead.
 
|-
 
|-
 
| 9
 
| 9
| <code>number</code>
+
| {{t|max depth}}
 
| <code>4</code>
 
| <code>4</code>
| Minimum depth; used in spawn rate calculation (see below). The minimum water depth to cast to for maximizing the chance of catching a type of fish.
+
| The minimum water depth to cast to for maximizing the chance of catching a type of fish; used in the spawn rate calculation (see below).
 
|-
 
|-
 
| 10
 
| 10
| <code>number</code>
+
| {{t|spawn multiplier}}
 
| <code>.3</code>
 
| <code>.3</code>
| Spawn multiplier; used in spawn rate calculation (see below).
+
| The spawn multiplier used in the spawn rate calculation (see below).
 
|-
 
|-
 
| 11
 
| 11
| <code>number</code>
+
| {{t|depth multiplier}}
 
| <code>.5</code>
 
| <code>.5</code>
| Depth multiplier; used in spawn rate calculation (see below).
+
| The depth multiplier used in the spawn rate calculation (see below).
 
|-
 
|-
 
| 12
 
| 12
| <code>level</code>
+
| {{t|fishing level}}
 
| <code>0</code>
 
| <code>0</code>
| The minimum [[skills|fishing level]].
+
| The minimum [[skills|fishing level]] needed for this fish to appear.
 +
|-
 +
| 13
 +
| {{t|first-catch tutorial eligible}}
 +
| <code>true</code>
 +
| Indicates whether the fish can be selected for the first-catch tutorial.
 
|}
 
|}
Note that as of v1.2, the game multiplies fish size by 2.54 for all languages other than English (for conversion from inches to cm).  See <tt>FishingRod::draw</tt>.
      
===Spawn rate===
 
===Spawn rate===
 +
<!--:''See also: [https://docs.google.com/spreadsheets/d/1BIyFHbDKaFPkmPOP52B2pdx_Mdo7jKgUCECgkMyjRFk/edit#gid=1509077014 Fish Chances 1.4]''-->
 +
{{Stub|section=true|This information is based on version 1.3 of the game.  It has not been updated for any 1.4 or 1.5 changes}}
 
Every time the player casts with their fishing rod, a new spawning queue is created containing every available type of [[fish]] (including algae and seaweed) which meets the criteria based on location, season, time, and weather. The spawning queue is then shuffled so that the available types of fish are listed in a random order. A skill check with a random component is performed on each type of fish, in the order in which it is currently in the spawning queue. Success results in a bite ("''HIT!''") and failure results in the skill check being repeated with the next fish in the queue. If all fish in the queue fail the skill check, a random [[trash]] item is caught instead.
 
Every time the player casts with their fishing rod, a new spawning queue is created containing every available type of [[fish]] (including algae and seaweed) which meets the criteria based on location, season, time, and weather. The spawning queue is then shuffled so that the available types of fish are listed in a random order. A skill check with a random component is performed on each type of fish, in the order in which it is currently in the spawning queue. Success results in a bite ("''HIT!''") and failure results in the skill check being repeated with the next fish in the queue. If all fish in the queue fail the skill check, a random [[trash]] item is caught instead.
   Line 137: Line 191:     
The relative probability that a specific type of fish (including algae and seaweed) in a location will spawn during a specific time and weather is: ''{relative spawn probability} = {base spawn probability} * POWER( ({all fish failure rate} - {this fish failure rate}) / ({number of fish} - 1}), ({fish queue position} - 1))'', where ''all fish'' and ''number of fish'' are all other fish present at the same location during the same time and weather conditions. This calculation is repeated for each possible position in the spawning order (''fish queue position'') for a type of fish, and then averaged. The total added relative spawn probability for all fish at a location at a certain time and weather will always be under 100%, with any remaining difference under 100% being the relative probability of catching [[trash]]: ''{trash probability} = 100% - {total relative spawn probability}''.
 
The relative probability that a specific type of fish (including algae and seaweed) in a location will spawn during a specific time and weather is: ''{relative spawn probability} = {base spawn probability} * POWER( ({all fish failure rate} - {this fish failure rate}) / ({number of fish} - 1}), ({fish queue position} - 1))'', where ''all fish'' and ''number of fish'' are all other fish present at the same location during the same time and weather conditions. This calculation is repeated for each possible position in the spawning order (''fish queue position'') for a type of fish, and then averaged. The total added relative spawn probability for all fish at a location at a certain time and weather will always be under 100%, with any remaining difference under 100% being the relative probability of catching [[trash]]: ''{trash probability} = 100% - {total relative spawn probability}''.
 +
 +
==Aquarium fish==
 +
Fish in [[Fish Tank|fish tank]]s can be edited via the <samp>Data/AquariumFish</samp> asset:
 +
 +
{| class="wikitable"
 +
|-
 +
! index
 +
! field
 +
! purpose
 +
|-
 +
| 0
 +
| sprite index
 +
| The index of the sprite in the <samp>LooseSprites/AquariumFish</samp> spritesheet, starting at 0 for the top-left sprite.
 +
|-
 +
| 1
 +
| type
 +
| The fish type, which influences their behavior. Possible values:
 +
{| class="wikitable"
 +
|-
 +
! value
 +
! notes
 +
|-
 +
| <samp>eel</samp>
 +
|
 +
|-
 +
| <samp>cephalopod</samp></samp>
 +
|
 +
|-
 +
| <samp>crawl</samp>
 +
|
 +
|-
 +
| <samp>ground</samp>
 +
|
 +
|-
 +
| <samp>fish</samp>
 +
|
 +
|-
 +
| <samp>front_crawl</samp>
 +
| Used for crawling fish whose sprites extend past the floor. They are always closest to the glass and sort above other fish to avoid sorting issues.
 +
|}
 +
|-
 +
| 2<br />3&ndash;5
 +
| idle animation<br />dart animation
 +
| The animation used by the fish when it's idling (2) or darting (3&ndash;5). This is specified as a list of space-delimited frames, where each frame is the sprite index in the <samp>LooseSprites/AquariumFish</samp> spritesheet to display. Each frame is displayed for 125ms. For example, [[Stingray]]s have their idle animation set to <samp>70 70 70 71 71 72</samp>.
 +
 +
The dart animation is split into three fields: start (3), hold (4), and end (5).
 +
|}
 +
 
[[Category:Modding]]
 
[[Category:Modding]]
    
[[pt:Modificações:Dados de Peixes]]
 
[[pt:Modificações:Dados de Peixes]]
 +
[[ru:Модификации:Рыболовство]]