Skip to main content
The character system manages all playable and non-playable characters, their animations, and their behavior during gameplay.

Character Architecture

BaseCharacter Class

All characters extend BaseCharacter, which extends Bopper:
Key Properties:
String
Unique identifier for the character (e.g., “bf”, “dad”, “gf”)
String
Display name of the character (e.g., “Boyfriend”, “Daddy Dearest”)
CharacterType
Type of character: BF (player), DAD (opponent), GF (girlfriend), or OTHER
Float
Tracks how long the character has been playing the current sing animation (in seconds)

Character Types

Characters are categorized by their role:

Character Rendering Types

FNF supports multiple rendering methods:

SparrowCharacter

Uses Sparrow sprite sheets (Adobe Animate/XML format):

AnimateAtlasCharacter

Uses Adobe Animate atlas format:

PackerCharacter

Uses Packer sprite sheets (legacy format):

Multi-Sprite Characters

  • MultiSparrowCharacter: Multiple Sparrow sheets
  • MultiAnimateAtlasCharacter: Multiple Animate atlases

Character Data Format

Character data is stored in JSON files at assets/data/characters/[id].json:

Character Data Fields

String
required
Character data format version (currently “1.0.1”)
String
required
Display name for the character
String
required
Rendering type: "sparrow", "animateatlas", "packer", "multisparrow", or "multianimateatlas"
String
required
Path to character assets (relative to assets/images/)
Float
default:"1.0"
Base scale multiplier for the character sprite
Array<Float>
default:"[0, 0]"
Global position offsets as [x, y]
Array<Float>
default:"[0, 0]"
Camera focus point offsets as [x, y]
Bool
default:"false"
Whether to flip the character sprite horizontally
Bool
default:"false"
Whether this is a pixel-art character (disables anti-aliasing)
Int
default:"1"
How many beats between idle dance animations
Float
default:"8.0"
How long (in steps) to hold sing animations
String
Name of the animation to play when character is created

Animation Data

Each animation in the animations array:
String
required
Internal animation name (e.g., “idle”, “singLEFT”, “singDOWN”)
String
required
Animation prefix in the sprite sheet XML
Array<Float>
default:"[0, 0]"
Position offsets specific to this animation [x, y]
Bool
default:"false"
Whether the animation should loop
Int
default:"24"
Frames per second for the animation
Bool
default:"false"
Flip this animation horizontally
Bool
default:"false"
Flip this animation vertically
Array<Int>
Specific frame indices to use (if not using all frames)

Required Animations

Characters should define these core animations:

Idle Animations

Or alternating left/right:

Sing Animations

Required for playable characters:

Miss Animations (Optional)

For when the player misses notes:

Character Position System

Position Properties

Characters use a feet-based origin system:
Character origin is at the feet:

Camera Focus

The camera focuses on the character’s cameraFocusPoint:
This point is automatically updated when the character moves, but not when animation offsets change. This ensures smooth camera motion.

Health Icons

Characters have associated health icons:
String
required
ID of the icon asset (looks for assets/images/icons/[id].png)
Float
default:"1.0"
Scale multiplier for the icon
Bool
default:"true"
Whether to use anti-aliasing on the icon

Death Animations

Player characters can define death animation settings:
Array<Float>
default:"[0, 0]"
Camera offset during game over screen [x, y]
Float
default:"1.0"
Camera zoom level during game over
Float
default:"0.0"
Delay before transitioning to game over state (in seconds)

Character Bopping

Characters automatically “bop” to the music:
The Bopper class handles automatic idle animation:
  • If danceLeft and danceRight exist, alternates between them
  • Otherwise plays idle animation
  • Controlled by danceEvery (beats between bops)

Combo Animations

Characters can have special animations for combos:
When player hits these combo milestones, special animations can play.

Sing Time

Controls how long characters hold sing animations:
Sing animations hold for singTimeSteps to prevent rapid flickering back to idle between notes.

Character Scripts

Characters can be scripted for custom behavior:
Scripts can:
  • Override animation behavior
  • Add custom events
  • Implement special mechanics
  • Modify character properties dynamically

Loading Characters

Characters are loaded via CharacterDataParser:
The system:
  1. Loads JSON data from assets/data/characters/[id].json
  2. Validates render type and version
  3. Creates appropriate character class instance
  4. Loads sprite assets and animations
  5. Applies offsets and properties

Example: Creating a Custom Character

Place sprite sheet at assets/images/characters/custom.png and custom.xml.