estirose: A man stands in front of an ocean. (Vintage Hajime - KR Blade)
estirose ([personal profile] estirose) wrote2025-01-16 12:15 pm

Wherein I talk about modding Stardew Valley at length

I've tried to make this a high-level overview and I think everything should be explained, but some unexplained technical stuff may have escaped confinement!

I wanted to talk a bit about writing mods, because a lot of people just freeze up at the idea of having to program a mod and think I am awesome to do so. Can they be hard work? Absolutely! Do you need to know computer programming to do so? Not always.

I write Stardew Valley mods under the name Ravenhyde (long story short, when I signed up for Nexusmods, that's the name I chose so that's what I mod under). I base my own mods entirely off of other mods called framework mods. Framework mods basically give modders an easier or more useful way to communicate with the game to tell it what to do - often without having to know an actual programming language.

I started modding for a very simple reason: the whole Community Center questline annoyed - and continues to annoy - me, especially with the version 1.5 update, but many of the available mods (even the ones that made you pay a big premium for the items) made the game seem too easy. So I learned how to write my own.

If you don't play Stardew Valley, one of the things that gets introduced early on is the Community Center questline. (Up until version 1.5 it was the end of what little plot Stardew Valley has; now it gates later, more endgame content.) To complete the Community Center you need to do the whole spectrum of things - grow crops and trees, raise and care for animals, go fishing, mine. It could safely be ignored if you just didn't care about such things, but it still hung around annoyingly and now it is required if you want to get to Ginger Island. You are not required to, of course, but still it's there.

There are three ways to deal with this part of the game:
a) Do all the growing, ranching, fishing, and mining the quest requires.
b) Do the parts of the above you like and check the Traveling Cart twice a week in hopes that something you don't want to get yourself is available and affordable. (This works especially well for people who don't like fishing and aren't using the remixed bundles.)
c) Sign up for a Joja membership (which basically cements the beginning of game status quo) and pay money instead to get your greenhouse/bridge repair/panning/minecarts.

(I have done the Joja route, I felt dirty/guilty the whole time because the NPCs kept telling my farmer what an awesome person she was while she was essentially supporting the equivalent of Walmart over the local mom n' pop.)

My collection of mods (now at 5, 2 of which are in progress/testing) all fit my general desire to make the game a little bit easier without removing the challenge. For each one, I've had to learn more about the game's internals, how the data is structured and can be manipulated.

Mod 1: Hat Mouse Extra for Stardew Valley 1.5
I wanted a version of the Traveling Cart that focused exclusively on Community Center items and was available every day, patched into an existing shop (in my case, the Hat Mouse). The items were relatively expensive but chances were that anything you needed would eventually come up for sale. Later on I learned a little bit of how to use Content Patcher to change a canon piece of mail.

What I learned from writing this one: How to create a manifest.json file (the file that every mod uses to introduce itself to SMAPI, the software that allows Stardew Valley to be modded). How to find item IDs (the mostly numerical values the game uses internally to distinguish items from each other). How to format my request in a way that Shop Tile Framework understood. How to read the mail data and how to use Content Patcher to change it.

Mod 2: Raven's Tiny Shop Additions for Stardew Valley 1.6
With the changes to 1.6 (including Shop Tile Framework being depreciated), I had to change things out a little and learn to use Content Patcher. I used the opportunity to change and broaden my original mod in ways that still fit in with the general reason I created that mod in the first place. So Marnie now sells animal products, but at an inflated price and one random item a day; same with Pierre for plants and Willie for fish. Clint now sells a random gem or mineral - useful for both the Community Center and the museum completion. While nobody sells artisan goods, Robin can sell you a machine to help you make them, and while nobody sells monster loot Marlon at the Adventurer's guild has a chance to sell you a more powerful weapon to help you do the slaying. (The only shops not touched were the Traveling Cart and Hat Mouse.)

What I learned from writing this one: Content Patcher required me to actually learn how the shop data is structured in the game. (As the name implies, it helps you patch content, but you have to learn the internals to know what to patch.) I also learned how to specify various kinds of randomization (you can ask it to choose a random item from a category or from a specific list, for example - Clint, Pierre, and Willie all sell from categories related to their regular trade, while I had to restrict Marnie's list so she didn't accidentally sell items that were post-Perfection or from Ginger Island, and likewise Robin had to be set up so she only sold machines and sprinklers). I also had to learn how the data for in-game objects (specifically machines) was set up set up because several machines did not have a buy/sell price - while getting a free Worm Bin from Robin's was very amusing it wasn't what I had in mind!

Mod 3: Raven's Slightly Easier Combat for Stardew Valley 1.6
Having gotten my feet wet with patching shops, I wanted to see if I could make the monsters just a little less powerful. Not one-hit kills, but maybe letting my farmer live to hit one more time in a crisis by reducing their health and damage by 10%.

What I learned from writing this one: How to interpret monster data. Also, that for some files (mail, monsters, dialogue, etc) there's a file for each language Stardew Valley supports. So if someone is playing in German, the game will call the German-specific files instead of the default English file. If I wanted to change the data for the monsters for all languages I'd have to tell the game to patch multiple files.

I have this mod on my "to update" list to make it more compact in some ways (I learned later I could just reference the health and damage data directly instead of copy-pasting the entire data file, which will shrink the size by quite a bit) and to add the monster data for the rest of the languages before I release it anywhere other than my own github.

Mod 4: Raven's Truffle Crab Spot for 1.6
While poking around in the Content Patcher documentation as well as the game data files, I realized that maybe I wanted to try patching some image data. Specifically, I wanted to change the sprite for a monster called a Truffle Crab. This is a relatively rare but harmless monster - it's as powerful as the early-level mine monsters - but it also gave me a jumpscare the first time I ran across it. So I took its entire spritesheet (an image file organized in such a way that the game knows how to interpret it) and gave it a small discoloration to distinguish it from the similar game object.

What I learned from writing this one: This is still in testing because of the rarity of this monster, but I learned how to use the program Krita to alter the pixel art and how to load a graphics file using Content Patcher.

Mod 5: Raven's Mystery Box Exchanger for 1.6
So this came about because I love the idea of mystery boxes (and prize tickets), but not always the fact that I have to go through the effort of hauling myself to Clint's and paying a fee for what's often an item I don't need. And while there are at least two mods that allow you to use the geode crusher to crush mystery boxes, artifact troves, and golden coconuts, I still find the contents kind of not useful most of the time. So I figured I'd build a new machine that took the mystery box item and spat out something from a different list that I liked better. Thus the mystery box exchanger was born. It takes what I considered the most useful items in the mystery box list and combined it with the community center bundle list (because why not). So now I have a machine that can be built from the beginning of the game but has a fairly steep requirement to build (a prize ticket and several mystery boxes), but is very useful.

What I learned from writing this one: This is still in testing (small tweaks to the spritesheet, some data still needs to be added), but the basics work. I kind of knew the format for crafting recipes since I'd done some unofficial fixes on other mods, but this was the first time writing one for my own item. I was also familiar with the format for BigCraftables (where data for machines and some decorations is stored) from a prior mod so I knew the basics of that, but I'd only modded existing data before, not added in an entirely new item. The actual machines data was new to me, so I did a lot of reading the existing data, the Stardew Valley Wiki - an invaluable resource for modders as well as players - and looking at other peoples' machine mods. (Trivia: I basically took the data entry for the Recycling Machine as a base as it came closest to what I wanted to achieve, although none of its data remains!) I also created my first spritesheet and my first more-or-less original pixel art (I grabbed an in-game image, pasted it into a new file, and heavily modified it in Krita). Also, I learned how to put all of this together.

My roadmap for at least the first half of 2025:
1. Finish adding data and tweaking my spritesheet for my latest mod.
2. Finish testing that mod and the truffle crab mod.
3. Rewrite the monster data mod so that all languages are included and I'm not copy/pasting all the game data.
4. Update some of the repositories (I've made a small change to some shop stuff; there's the whole change to the monster mod) and add new ones (truffle crab and mystery box exchange).
5. Upload all the mods to ModDrop, and possibly create a bundle. (I'm choosing ModDrop over NexusMods as I would like people to be able to download my mods without logging in; also it's slower and so they'll get more attention.)

ETA: Well, apparently my brain has gone sideways and I will be producing a 6th mod! I will either be creating yet another machine or modifying the crystalarium to grow ore. (It may be easier to do that; I'll have to look at the internals.)