Jump to content

Modding:Farmer sprite: Difference between revisions

From Stardew Valley Wiki
imported>Violetlizabet
Adding in details on walking and running
imported>Violetlizabet
No edit summary
Line 51: Line 51:
As mentioned above, the pants, head/torso/boots, and arms all appear to line up. As all of the following information was tested specifically for pants, the illustrations will cover pants, but it most likely also covers head/torso/boots and arms.
As mentioned above, the pants, head/torso/boots, and arms all appear to line up. As all of the following information was tested specifically for pants, the illustrations will cover pants, but it most likely also covers head/torso/boots and arms.


==Notation==
The notation used here is R1F1 = Row 1 Frame 1
, and so on. In the code (which is located in FarmerSprite.cs), frame numbers are 0-indexed and go in order. The code notation is provided after the Row-Frame notation, with duration of each frame (in milliseconds) specified by the number after the @ symbol. For example, 1@60 is the Row 1, Frame 2 frame for duration 60.  
The notation used here is R1F1 = Row 1 Frame 1
, and so on. In the code (which is located in FarmerSprite.cs), frame numbers are 0-indexed and go in order. The code notation is provided after the Row-Frame notation, with duration of each frame (in milliseconds) specified by the number after the @ symbol. For example, 1@60 is the Row 1, Frame 2 frame for duration 60.  


Line 103: Line 104:


Horse riding up: R19F6
Horse riding up: R19F6
[[File:Horse riding sprites.png|50px]]


===Sitting===
===Sitting===
Line 110: Line 113:


Sitting up: R19F6
Sitting up: R19F6
[[File:Sitting sprites.png|50px]]


==Farmer Basic Tool and Weapon Use==
==Farmer Basic Tool and Weapon Use==
Line 115: Line 120:
===Heavy Tools===
===Heavy Tools===
Axe/pickaxe/hoe/club special down: R12F1, R12F2, R12F3, R12F4, R12F5, cycles once
Axe/pickaxe/hoe/club special down: R12F1, R12F2, R12F3, R12F4, R12F5, cycles once
Upgraded hoe held down: R13F4


Axe/pickaxe/hoe/club special left and right: R9F1, R9F2, R9F3, R9F4, R9F5, cycles once
Axe/pickaxe/hoe/club special left and right: R9F1, R9F2, R9F3, R9F4, R9F5, cycles once
Upgraded hoe held left and right: R13F2


Axe/pickaxe/hoe/club special up: R7F1, R7F2, R7F3, R11F4, R11F3, cycles once
Axe/pickaxe/hoe/club special up: R7F1, R7F2, R7F3, R11F4, R11F3, cycles once
[[File:Tool sprites.png|50px]]


===Scythe/Melee Weapons===
===Scythe/Melee Weapons===
Line 126: Line 137:


Scythe/melee up: R7F1, R7F2, R7F3, R7F4, R7F5, R7F6, cycles once
Scythe/melee up: R7F1, R7F2, R7F3, R7F4, R7F5, R7F6, cycles once
[[File:Melee sprites.png|50px]]


===Watering Can===
===Watering Can===
Line 133: Line 146:


Watering up: R11F3, R11F4, R8F5, cycles once
Watering up: R11F3, R11F4, R8F5, cycles once
[[File:Watering sprites.png|50px]]


===Sword Block===
===Sword Block===
Line 140: Line 155:


Sword sp. up: R7F5, held
Sword sp. up: R7F5, held
[[File:Sword block sprites.png|50px]]


===Slingshot===
===Slingshot===
Line 149: Line 166:


Slingshot up: R8F3
Slingshot up: R8F3
[[File:Slingshot sprites.png|50px]]


==Fishing==
==Fishing==
Line 160: Line 179:


Casting up: R15F5, held, then R7F3, R11F4, R11F3, repeat last two
Casting up: R15F5, held, then R7F3, R11F4, R11F3, repeat last two
[[File:Casting sprites.png|50px]]


===Fishing===
===Fishing===
Line 169: Line 190:


Fishing up: R8F3, held
Fishing up: R8F3, held
[[File:Fishing sprites.png|50px]]


===Reeling===
===Reeling===
Line 178: Line 201:


Reeling up: R7F1, held
Reeling up: R7F1, held
[[File:Reeling sprites.png|50px]]


===Fish Caught===
===Fish Caught===
Line 185: Line 210:
Fish caught left and right: R13F1, then farmer switches to down R10F4, R15F1
Fish caught left and right: R13F1, then farmer switches to down R10F4, R15F1
Fish caught up: R13F5, then farmer switches to down, R10F4, R15F1
Fish caught up: R13F5, then farmer switches to down, R10F4, R15F1
[[File:Caught fish sprites.png|50px]]


==Farmer Other Tool Use==
==Farmer Other Tool Use==
Line 192: Line 219:


Panning down: R21F4, R21F5, R21F4, R21F6, repeat 3x, R21F4, R21F5, R21F4
Panning down: R21F4, R21F5, R21F4, R21F6, repeat 3x, R21F4, R21F5, R21F4
[[File:Panning sprites.png|50px]]


===Milking===
===Milking===
Line 199: Line 228:


Milking up: R11F3, R11F4, repeats twice total
Milking up: R11F3, R11F4, repeats twice total
[[File:Milking sprites.png|50px]]


===Shearing===
===Shearing===
Line 206: Line 237:


Shearing up: R14F5, R14F6, repeats twice total
Shearing up: R14F5, R14F6, repeats twice total
[[File:Shearing sprites.png|50px]]


==Farmer Miscellaneous Movement==
==Farmer Miscellaneous Movement==
Line 214: Line 247:
Passing out: R3F5, R1F1, R3F5, R1F5, R1F6
Passing out: R3F5, R1F1, R3F5, R1F5, R1F6


===Barfing===
[[File:Passing out sprites.png|50px]]
This occurs after eating something poisonous.


Barfing: R18F3, R18F4, repeat several times
===Nausea===
This occurs after eating something poisonous, as well as in a couple cutscenes. It always occurs facing down.
 
Nausea: R18F3, R18F4, repeat several times
 
[[File:Nausea sprites.png|50px]]


===Kissing===
===Kissing===
Line 223: Line 260:


Kissing: R17F6
Kissing: R17F6
[[File:Kissing sprites.png|50px]]


===Flower Dance===
===Flower Dance===
Line 230: Line 269:


Flower dance up: R3F1, R3F2, R3F1, R3F3, repeat at various speeds
Flower dance up: R3F1, R3F2, R3F1, R3F3, repeat at various speeds
[[File:Flower dance sprites.png|50px]]
===Bathing Suit===
Each pants .png has its own bathing suit so that the bathing suit color reflects the pants color.
Bathing suit walking down: R19F1, R19F2, R19F1, R19F3
Bathing suit walking left/right: R20F1, R20F2, R20F1, R20F3
Bathing suit walking up: R21F1, R21F2, R21F1, R21F3
[[File:Bathing suit sprites.png|50px]]


==Farmer in Cutscenes==
==Farmer in Cutscenes==
Line 245: Line 297:


Laughing (used in various cutscenes): 102, 103
Laughing (used in various cutscenes): 102, 103
Turning green and looking sick: (used in Penny’s cooking, Wizard potion): 104, 105


Opening a jar (used in Haley jar event): 111, 112
Opening a jar (used in Haley jar event): 111, 112


==Bathing Suit==
[[File:Event sprites.png|50px]]
Each pants .png has its own bathing suit so that the bathing suit color reflects the pants color.
 
Bathing suit walking down: R19F1, R19F2, R19F3
 
Bathing suit walking left/right: R20F1, R20F2, R20F3
 
Bathing suit walking up: R21F1, R21F2, R21F3


==Unknown Frames==
==Unknown Frames==


There are 7 frames I was not able to identify, shown below including the head/torso/boots and arms, along with the frame index. The last two may be used in the strength test game at the Fall Fair.
There are 5 frames I was not able to identify, shown below including the head/torso/boots and arms, along with the frame index.  


[[File:Unknown_Sprites.png|600px]]
[[File:Unknown_Sprites.png|400px]]


[[Category:Modding]]
[[Category:Modding]]


[[ru:Модификации:Спрайт фермера]]
[[ru:Модификации:Спрайт фермера]]

Revision as of 23:27, 21 June 2022

← Modding:Index

Associated files location

All the sprites for the farmer are stored in "Content/Characters/Farmer". The main sprite for the male farmer is "farmer_base.xnb" and for the female farmer is "farmer_girl_base.xnb".

Layers

The farmer sprite is drawn in several layers. On the bottom layer is the head, torso, and boots. The clothing, accessories, hair, and others are all drawn in multiple layers on top in this order:

  1. Head/Torso/Boots - Bottom layer
  2. Pants
  3. Shirt
  4. Accessories (e.g., glasses, makeup, earrings, facial hair)
  5. Hair
  6. Hat
  7. Arms - Top layer

The placement of layers stored in other files (such as the height of a shirt on the body) is dependent upon the animation, and cannot be modified by editing png files other than by shifting the accessory within its frame.

Farmer (girl) base

The farmer base sprite is divided into three sections. The Head/Torso/Boots layer are in the six columns on the far left. The pants are in the six columns on the far right. And the arms make up the central 12 columns. Each sprite is 16 pixels wide by 32 pixels tall.

The sorting of the sprites seems to be fairly logical with the six pants on the top row lining up with the six torsos on the top row, and similarly all the way down.

With the default shirts and pants, it is unnecessary to have a full torso drawn since the shirts cover most of it up. The pants cover up all of where the legs would go on the torso layer too. However, with mods that add more clothing options for shirts and pants, it can be necessary to have more torso drawn and legs added to the base farmer layer.

Color palette

When editing the farmer base, it is important to use the appropriate color palettes. The game identifies skin, eyes, boots, pants, arms, and shirt sleeves in the farmer base using the color. The game recolors these depending upon the options chosen during character creation and the color of the boots being worn.

Shirt size difference

Although the torso can be up to 16 pixels wide, shirts (which are stored in a separate file) are only 8x8 and unable to fully-cover a torso wider than that. The Hats, Accessories, and Pants all give full 16-pixel wide columns for covering the head and legs, though.

Hats and Hairstyles

The farmer's hairstyle will sometimes change when a hat is equipped.source

  • Hairstyle 3 will change to hairstyle 11
  • Hairstyles 22 and 26 will change to hairstyle 7.
  • Hairstyles 18, 19, 21, and 31 will change to hairstyle 23
  • Hairstyles 0, 2, 4, 7(?), 8, 10, 12, 13, 14, 15, and 16 will change to hairstyle 30.
  • Hairstyles 1, 5, 6, 9, 11, 17, 20, 23, 24, 25, 27, 28, 29, and 30 will not change.

Note: It seems strange that hairstyle 7 would change to 30, so it may actually stay the same.

Sprite Index Breakdown

As mentioned above, the pants, head/torso/boots, and arms all appear to line up. As all of the following information was tested specifically for pants, the illustrations will cover pants, but it most likely also covers head/torso/boots and arms.

Notation

The notation used here is R1F1 = Row 1 Frame 1
, and so on. In the code (which is located in FarmerSprite.cs), frame numbers are 0-indexed and go in order. The code notation is provided after the Row-Frame notation, with duration of each frame (in milliseconds) specified by the number after the @ symbol. For example, 1@60 is the Row 1, Frame 2 frame for duration 60.

In these notes, down refers to the farmer facing downwards (towards the screen), while up refers to the farmer facing upwards (away from the screen). Left and right are from the perspective of the player (screen left/screen right). As the left and right animations are universally mirror images of each other, they are always combined. The player facing to the right is the unflipped sprite, while facing left is flipped.

For the accompanying images, as they are quite large, they are displayed at small size, but if you click through you can see them larger. The male farmer side is greyed out, as this analysis was conducted with the female farmer base, but it should be exactly analogous. There is an extra small sprite at the bottom for the pants item inventory sprite.

Farmer Movement

Walking

Walking, down: R1F1, R1F2, R1F1, R1F3, repeat (frame indexes 0@200, 1@200, 0@200, 2@200, repeat)

Walking, left and right: R2F1, R2F2, R2F1, R2F3, repeat (frame indexes 6@200, 7@200, 6@200, 8@200, repeat)

Walking, up: R3F1, R3F2, R3F1, R3F3, repeat (frame indexes 12@200, 13@200, 12@200, 14@200, repeat)

Running

Running, down: R1F1, R1F2, R4F1, R1F2, R1F1, R1F3, R4F2, R1F3, repeat (frame indexes 0@90, 1@60, 18@120, 1@60, 0@90, 2@60, 19@120, 2@60, repeat)

Running, left and right: R2F1, R4F4, R3F6, R2F1, R4F3, R2F6, repeat (frame indexes 6@90, 21@140, 17@100, 6@90, 20@140, 11@100, repeat)

Running, up: R3F1, R3F2, R4F5, R3F2, R3F1, R3F3, R4F6, R3F3, repeat (frame indexes 12@90, 13@60, 22@120, 13@60, 12@90, 14@60, 23@120, 14@60, repeat)

Harvesting

Harvesting down: R10F1, R10F2, R10F3, R10F4

Harvesting left and right: R10F5, R10F6, R11F1, R11F2

Harvesting up: R11F3, R11F4, R11F5, R11F6

Eating and Drinking

Eating and drinking always take place with the farmer facing the screen (down).

Eating: R15F1, R15F2, R15F3, R15F4, R15F5, R15F4, R15F5, R15F4

Drinking: R16F1, R16F2, R16F3, R16F4, R16F3, R16F4, R16F3, R16F4, R16F2, R16F1

Horse Riding

Horse riding down: R18F6

Horse riding left/right: R18F5

Horse riding up: R19F6

Sitting

Sitting down: R18F6

Sitting left and right: R20F4

Sitting up: R19F6

Farmer Basic Tool and Weapon Use

Heavy Tools

Axe/pickaxe/hoe/club special down: R12F1, R12F2, R12F3, R12F4, R12F5, cycles once

Upgraded hoe held down: R13F4

Axe/pickaxe/hoe/club special left and right: R9F1, R9F2, R9F3, R9F4, R9F5, cycles once

Upgraded hoe held left and right: R13F2

Axe/pickaxe/hoe/club special up: R7F1, R7F2, R7F3, R11F4, R11F3, cycles once

Scythe/Melee Weapons

Scythe/melee down: R5F1, R5F2, R5F3, R5F4, R5F5, R5F6, cycles once

Scythe/melee left and right: R6F1, R6F2, R6F3, R6F4, R6F5, R6F6, cycles once

Scythe/melee up: R7F1, R7F2, R7F3, R7F4, R7F5, R7F6, cycles once

Watering Can

Watering down: R10F1, R10F2, R5F2, cycles once

Watering left and right: R10F5, R10F6, R8F4, cycles once

Watering up: R11F3, R11F4, R8F5, cycles once

Sword Block

Sword sp. down: R5F5, held

Sword sp. left and right: R6F5, held

Sword sp. up: R7F5, held

Slingshot

Note: I think the slingshot arms are weird. They certainly look weird, and I think they break the normal grid pattern.

Slingshot down: R8F1

Slingshot left and right: R8F2

Slingshot up: R8F3

Fishing

Casting

This is when the farmer is throwing out a line (holding down the mouse while the bar over the farmer's head fills/shrinks), plus the animation right after the mouse is un-pressed.

Casting down: R12F1, held, then rest of heavy tool animation

Casting left and right: R9F1, held, then R9F2, R9F3, R9F4, R9F5

Casting up: R15F5, held, then R7F3, R11F4, R11F3, repeat last two

Fishing

This is when the farmer has a line out, and is waiting for a bite.

Fishing down: R12F5, held

Fishing left and right: R15F6, held

Fishing up: R8F3, held

Reeling

This is when the farmer is playing the minigame.

Reeling down: R12F1, held

Reeling left and right: R9F1, held

Reeling up: R7F1, held

Fish Caught

This is after the player has caught a fish, going from the reeling position to holding up a fish for display.

Fish caught down: R13F3, R10F4, R15F1 Fish caught left and right: R13F1, then farmer switches to down R10F4, R15F1 Fish caught up: R13F5, then farmer switches to down, R10F4, R15F1

Farmer Other Tool Use

Panning

Panning only ever occurs with the farmer facing down (towards the screen).

Panning down: R21F4, R21F5, R21F4, R21F6, repeat 3x, R21F4, R21F5, R21F4

Milking

Milking down: R10F1, R10F2, repeats twice total

Milking left/right: R10F5, R10F6, repeats twice total

Milking up: R11F3, R11F4, repeats twice total

Shearing

Shearing down: R14F1, R14F2, repeats twice total

Shearing left/right: R14F3, R14F4, repeats twice total

Shearing up: R14F5, R14F6, repeats twice total

Farmer Miscellaneous Movement

Passing Out

This seems to be the same animation both for passing out due to low energy, passing out due to 2:00 AM, and passing out due to low health, but I have not confirmed the last one.

Passing out: R3F5, R1F1, R3F5, R1F5, R1F6

Nausea

This occurs after eating something poisonous, as well as in a couple cutscenes. It always occurs facing down.

Nausea: R18F3, R18F4, repeat several times

Kissing

This is used in the wedding, for kissing your spouse, and in a couple cutscenes.

Kissing: R17F6

Flower Dance

You can either be facing down or up, depending on which NPCs you ask to dance.

Flower dance down: R1F1, R1F5, repeat, R1F1, R1F4, repeat

Flower dance up: R3F1, R3F2, R3F1, R3F3, repeat at various speeds

Bathing Suit

Each pants .png has its own bathing suit so that the bathing suit color reflects the pants color.

Bathing suit walking down: R19F1, R19F2, R19F1, R19F3

Bathing suit walking left/right: R20F1, R20F2, R20F1, R20F3

Bathing suit walking up: R21F1, R21F2, R21F1, R21F3

Farmer in Cutscenes

There are a variety of farmer frames and animations that are used in different cutscenes. Many of them are used in more than one cutscene, but a few are specific. Here, absolute frame numbers are used instead of the row/frame notation.

Reaching (used in Haley darkroom, George remote events): 15

Sitting down, sad (used in Alex sad mother event): 95

Looking sad/pensive (used in Abigail video game failure): 96

Head scratching/looking sheepish (used in Abigail video game event, several others): 97

Playing the harp (used in Abigail flute scene): 98, 99, 100

Laughing (used in various cutscenes): 102, 103

Opening a jar (used in Haley jar event): 111, 112

Unknown Frames

There are 5 frames I was not able to identify, shown below including the head/torso/boots and arms, along with the frame index.