NPC Helper 2/Docs

Create an NPC

Sprites and portraits

Image sizes and frame layout for NPC sprite sheets and portraits, extra poses for marriage, and variants by location and season.

An NPC has two images: a sprite sheet (the walking character) and a portrait sheet (the face shown during dialogue). Both are PNG files in the NPC's folder, chosen by file name. Nothing about them is set in TOML.

text
NPCs/Rei/
├── sprites/
│   ├── Default.png
│   ├── Hospital.png
│   ├── summer.png
│   └── Hospital_Summer.png
└── portraits/
    ├── Default.png
    ├── Marriage.png
    └── Hospital.png

Step 1: Make the sprite sheet#

sprites/Default.png is the main sprite sheet.

  • The sheet is 64 pixels wide: 4 columns of frames, each 16 wide and 32 tall.
  • Each row is one direction, in this order: down, right, up, left.
  • The columns of a row are the walking frames for that direction.
  • Frames are numbered from the top left, left to right, so frame 0 is the first cell of row 1, frame 4 is the first cell of row 2, and so on (frame = row × 4 + column, counting from 0).

A sheet 128 pixels tall holds the four walking rows and is enough for an NPC who cannot marry.

Extra poses for a marriageable NPC#

A marriageable NPC needs more frames, so the sheet is taller (320 pixels tall holds ten rows).

Pose Frame Where it is
Spouse kiss 28 First cell of row 8 (x 0, y 224)
Wedding: facing the guests 36 Row 10, first cell (x 0, y 288)
Wedding: turning to the farmer 37 Row 10, second cell (x 16, y 288)
Wedding: the kiss 38 Row 10, third cell (x 32, y 288)

Draw the wedding outfit in frames 36, 37, and 38. The ceremony shows the spouse in these frames of the normal sprite sheet. They are not in a separate wedding image.

If a frame is empty, or the sheet ends before it, the NPC becomes invisible during that pose. NPC Helper 2 checks these frames for every marriageable NPC, in Default.png and in every variant. It warns and names the empty or missing frame. Placeholder sheets created by the command-line tool are 320 pixels tall so they include the wedding frames.

Step 2: Make the portrait sheet#

portraits/Default.png is the main portrait sheet.

  • The sheet is 128 pixels wide: 2 columns of faces, each 64 by 64.
  • Add rows below for more expressions. The first face is neutral. The order of faces matches the portrait tokens used in dialogue ($h happy, $s sad, and so on); see Dialogue.

Higher-resolution portraits#

To draw portraits larger than the game's 64 by 64, set PortraitScale = 2 in the pack's mod.toml (Pack structure). Each face is then 128 by 128 and the sheet is 256 pixels wide. NPC Helper 2 scales every selected portrait down to the game's size. The setting applies to every file in portraits/, including Marriage.png and all variants.

The wedding portrait#

An optional portraits/Marriage.png is shown while the NPC says the wedding vows. Without it, the normal portrait is used. It is never shown anywhere else. See Marriage.

Step 3: Add variants (optional)#

A variant is an image shown only in a particular place or season. Any file other than Default.png is a variant named after the file (and for portraits, Marriage.png is not a variant).

File Used when
Hospital.png The NPC is in the Hospital location.
summer.png It is summer.
Hospital_Summer.png The NPC is in the Hospital during summer.

Rules:

  • The location name must be the game's exact location name. Seasons are spring, summer, fall, and winter.
  • Avoid dots in variant names.
  • Sprites and portraits use the same naming, and are chosen independently.

Which image is used#

For the NPC's current location and the current season, the first file that exists wins:

  1. <Location>_<Season>.png
  2. <Location>.png
  3. <Season>.png
  4. Default.png

If a variant does not exist, the next one is tried. The image changes only when the chosen file changes.

Remember that a variant used for a marriageable NPC needs the extra pose frames too.

Step 4: Check your images#

  • Save as PNG. Use transparency for the area around the character.
  • Check the sizes: sprite sheets 64 wide with frames 16 by 32, portraits 128 wide with faces 64 by 64 (or double with PortraitScale = 2).
  • Start the game and check the log. A message like No sprite image found means sprites/Default.png is missing.
  • Walk the NPC in each direction and talk to them in each expression.

Translating#

Images are not translated. Only text and data are. See Localization.