Modding:Location data

From Stardew Valley Wiki
Revision as of 00:41, 21 November 2023 by Pathoschild (talk | contribs) (add terminology, copyedit)
Jump to navigation Jump to search

Modding:Index

This page explains how to create and edit in-game locations.

Terminology

A few terms may be used interchangeably or have different meanings depending on the context. In the context of Stardew Valley:

  • A location is part of the game code and save data. It manages the in-game area and everything inside it (including non-map entities like players). The location is read/written to the save file, and is only loaded when loading the save file.
  • A map is an asset which describes the tile layout, tilesheets, and map/tile properties for the in-game area. The map is reloaded each time you load a save, and each time a mod changes the map.
  • A world map is the image shown for a world region in the in-game menu.

In other words, a location (part of the game code) references the map (loaded from the Content folder):

┌─────────────────────────────────┐
│ Location                        │
│   - objects                     │
│   - furniture                   │
│   - crops                       │
│   - bushes and trees            │
│   - NPCs and players            │
│   - etc                         │
│                                 │
│   ┌─────────────────────────┐   │
│   │ Map asset               │   │
│   │   - tile layout         │   │
│   │   - map/tile properties │   │
│   │   - tilesheets          │   │
│   └─────────────────────────┘   │
└─────────────────────────────────┘

Data format

Data/Locations controls many things about locations.

Here is an example location:

"Beach": "372 .9 718 .1 719 .3 723 .3/372 .9 394 .5 718 .1 719 .3 723 .3/372 .9 718 .1 719 .3 723 .3/372 .4 392 .8 718 .05 719 .2 723 .2/129 -1 131 -1 147 -1 148 -1 152 -1 708 -1 267 -1/128 -1 130 -1 146 -1 149 -1 150 -1 152 -1 155 -1 708 -1 701 -1 267 -1/129 -1 131 -1 148 -1 150 -1 152 -1 154 -1 155 -1 705 -1 701 -1/708 -1 130 -1 131 -1 146 -1 147 -1 150 -1 151 -1 152 -1 154 -1 705 -1/384 .08 589 .09 102 .15 390 .25 330 1",

Breaking it down:

Index Entry Explanation
0 "372 .9 718 .1 719 .3 723 .3" Spring forage. Item ID chance. No particular order required.
1 "372 .9 394 .5 718 .1 719 .3 723 .3" Summer forage. As above.
2 "372 .9 718 .1 719 .3 723 .3" Fall forage. As above.
3 "372 .4 392 .8 718 .05 719 .2 723 .2" Winter forage. As above.
4 "129 -1 131 -1 147 -1 148 -1 152 -1 708 -1 267 -1" Fish data for spring. Fish is ID zoneNumber ID zoneNumber. Some locations have multiple fishing locations. To seperate fish, the zoneNumber is used. It starts at -1, and some locations have 0, or even 1, to indicate the zone. For more information, see Modding:Fish_data
5 "128 -1 130 -1 146 -1 149 -1 150 -1 152 -1 155 -1 708 -1 701 -1 267 -1" Fish data for summer
6 "129 -1 131 -1 148 -1 150 -1 152 -1 154 -1 155 -1 705 -1 701 -1" Fish data for autumn
7 "708 -1 130 -1 131 -1 146 -1 147 -1 150 -1 151 -1 152 -1 154 -1 705 -1" Fish data for winter
8 "384 .08 589 .09 102 .15 390 .25 330 1" Artifact data. (Article data TBA): Artifacts should be added in increasing likelihood, and in format: ID chance ID chance, with chance being addressed in 0 to 1.

Note that not all fields are required: If you have no fish, you can just put -1 for the relevant fields, and if you have no forage, you can just put -1 for the relevant fields.

Examples are:

  "Farm": "-1/-1/-1/-1/-1/-1/-1/-1/382 .05 770 .1 390 .25 330 1",

This has no forage or fishing data (handled programmatically) so it's just -1.

In order to have artifacts work, custom locations need to add their data to this file, which can be done with mods such as Content Patcher.

Location names

In-game locations like the farm or beach are represented by the GameLocation class (or a subclass), and are identified by a unique name.

Here are some of the vanilla locations:

Name Class Description
Farm StardewValley.Farm The outdoor area of the Pelican Town farm.
FarmHouse StardewValley.Locations.FarmHouse The interior of the farm house.
FarmCave StardewValley.Locations.FarmCave The bats/mushroom cave on the farm.
Town StardewValley.Locations.Town The outdoor area of Pelican Town.
JoshHouse StardewValley.GameLocation Alex/George/Evelyn's house. (Josh was the old name for the Alex character.)
HaleyHouse StardewValley.GameLocation Haley/Emily's house.
SamHouse StardewValley.GameLocation Sam/Jodi/Kent/Vincent's house.
Blacksmith StardewValley.GameLocation Clint's blacksmith shop.
ManorHouse StardewValley.Locations.ManorHouse Mayor Lewis' house.
SeedShop StardewValley.Locations.SeedShop Pierre's general store (also Caroline/Abigail's house and church)
Saloon StardewValley.GameLocation The Stardrop Saloon (and Gus' house)
Trailer StardewValley.GameLocation Pam/Penny's trailer.
Hospital StardewValley.GameLocation Harvey's clinic.
HarveyRoom StardewValley.GameLocation Harvey's room upstairs from the clinic.
Beach StardewValley.Locations.Beach The beach south of Pelican Town.
ElliottHouse StardewValley.GameLocation Elliott's cabin on the beach.
Mountain StardewValley.Locations.Mountain The outdoor mountain area where the Carpenter, Linus' tent, and Adventurer's Guild are.
ScienceHouse StardewValley.GameLocation The Carpenter's Shop.
SebastianRoom StardewValley.GameLocation Sebastian's room in the basement of the carpenter house.
Tent StardewValley.GameLocation Linus' tent.
Forest StardewValley.Locations.Forest Cindersap forest south of the farm.
WizardHouse StardewValley.Locations.WizardHouse The wizard/Rasmodius's tower
AnimalShop StardewValley.GameLocation Marnie's Ranch
LeahHouse StardewValley.GameLocation Leah's Cottage.
BusStop StardewValley.Locations.BusStop The bus stop area between the farm and Pelican Town.
Mine StardewValley.Locations.Mine The first room of the mines, where the dwarf's shop is.
Sewer StardewValley.Locations.Sewer The sewers where Krobus' shop is.
BugLand StardewValley.Locations.BugLand The mutant bug lair in the sewers.
Desert StardewValley.Locations.Desert Calico Desert where Sandy's Oasis shop and the skull cavern are.
Club StardewValley.Locations.Club Mr. Qi's casino in Sandy's Oasis shop.
SandyHouse StardewValley.GameLocation The Oasis, Sandy's shop in Calico Desert.
ArchaeologyHouse StardewValley.Locations.LibraryMuseum The Museum in Pelican Town, south of the Blacksmith.
WizardHouseBasement StardewValley.GameLocation The basement of the Wizard's Tower
AdventureGuild StardewValley.Locations.AdventureGuild The Adventurer's Guild, home of Marlon and Gil.
Woods StardewValley.Locations.Woods The secret woods in Cindersap forest blocked by a large log.
Railroad StardewValley.Locations.Railroad The railroad north of the mountains, where the spa is located.
WitchSwamp StardewValley.GameLocation The swamp area where the Witch's Hut is.
WitchHut StardewValley.GameLocation The interior of the Witch's Hut.
WitchWarpCave StardewValley.GameLocation The cave accessible at the top right of the railroad, which warps to the Witch's swamp.
Summit StardewValley.Locations.Summit The summit north of the railroad.
FishShop StardewValley.Locations.FishShop Willy's shop.
BathHouse_Entry StardewValley.GameLocation The entrance room in the spa, leading to the men's and women's locker rooms.
BathHouse_MensLocker StardewValley.GameLocation The men's locker room in the spa.
BathHouse_WomensLocker StardewValley.GameLocation The women's locker room in the spa.
BathHouse_Pool StardewValley.Locations.BathHousePool The bathhouse pool in the spa.
CommunityCenter StardewValley.Locations.CommunityCenter The inside of the Community Center.
JojaMart StardewValley.Locations.JojaMart The inside of Pelican Town's JojaMart.
Greenhouse StardewValley.GameLocation The Greenhouse on the player's farm.
SkullCave StardewValley.GameLocation The entrance of the Skull Cavern in Calico desert.
Backwoods StardewValley.GameLocation The backwoods area north of the farm/west of the bus stop, leading to the bus tunnel or to the mountains.
Tunnel StardewValley.GameLocation The dark bus tunnel to the west of the bus stop.
Trailer_Big StardewValley.GameLocation The inside of Pam/Penny's house after the Community Upgrade.
Cellar StardewValley.Locations.Cellar
Cellar2 StardewValley.Locations.Cellar
Cellar3 StardewValley.Locations.Cellar
Cellar4 StardewValley.Locations.Cellar
BeachNightMarket StardewValley.Locations.BeachNightMarket The beach south of Pelican Town during the Night Market.
MermaidHouse StardewValley.Locations.MermaidHouse The interior of the mermaid boat at the Night Market.
Submarine StardewValley.Locations.Submarine The interior of the fishing submarine during the Night Market.
AbandonedJojaMart StardewValley.Locations.AbandonedJojaMart The small interior of the abandoned JojaMart where the Missing Bundle is.
MovieTheater StardewValley.Locations.MovieTheater The interior of the Movie Theater that replaces JojaMart.
Sunroom StardewValley.GameLocation Caroline's sunroom inside Pierre's General Store.
BoatTunnel StardewValley.Locations.BoatTunnel Where Willy's Boat is, in back of the fish shop.
IslandSouth StardewValley.Locations.IslandSouth Ginger Island, the docks where the player first lands and where the beach resort is.
IslandSouthEast StardewValley.Locations.IslandSouthEast Ginger Island, where the mermaid and pirate cove are.
IslandSouthEastCave StardewValley.Locations.IslandSouthEastCave The pirate cove.
IslandEast StardewValley.Locations.IslandEast Ginger Island jungle, where Leo's hut is.
IslandWest StardewValley.Locations.IslandWest Ginger Island, Island West, where the farm and Birdie's Shack are.
IslandNorth StardewValley.Locations.IslandNorth Ginger Island, Island North, where the volcano and Professor Snail's tent are.
IslandHut StardewValley.Locations.IslandHut The interior of Leo's hut on Ginger Island.
IslandWestCave1 StardewValley.Locations.IslandWestCave1 The Ginger Island cave where the colored crystals puzzle can be found.
IslandNorthCave1 StardewValley.Locations.IslandLocation The mushroom cave on Ginger Island where Professor Snail is initially blocked in by a boulder.
IslandFieldOffice StardewValley.Locations.IslandFieldOffice The interior of Professor Snail's Island Field Office tent.
IslandFarmHouse StardewValley.Locations.IslandFarmHouse The interior of the farm house on Ginger Island.
CaptainRoom StardewValley.Locations.IslandLocation The interior of the shipwreck on Ginger Island West.
IslandShrine StardewValley.Locations.IslandShrine The area East of the jungle on Ginger Island.
IslandFarmCave StardewValley.Locations.IslandFarmCave The interior of Gourmand Frog's cave on Ginger Island.
Caldera StardewValley.Locations.Caldera The volcano caldera on Ginger Island at the end of the volcano dungeon.
LeoTreeHouse StardewValley.GameLocation Leo's tree house home.
QiNutRoom StardewValley.Locations.IslandLocation Mr. Qi's Walnut Room