Character Architecture
BaseCharacter Class
All characters extendBaseCharacter, which extends Bopper:
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 OTHERFloat
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 atassets/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 theanimations 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
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:Camera Focus
The camera focuses on the character’scameraFocusPoint:
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:Bopper class handles automatic idle animation:
- If
danceLeftanddanceRightexist, alternates between them - Otherwise plays
idleanimation - Controlled by
danceEvery(beats between bops)
Combo Animations
Characters can have special animations for combos:Sing Time
Controls how long characters hold sing animations:singTimeSteps to prevent rapid flickering back to idle between notes.
Character Scripts
Characters can be scripted for custom behavior:- Override animation behavior
- Add custom events
- Implement special mechanics
- Modify character properties dynamically
Loading Characters
Characters are loaded viaCharacterDataParser:
- Loads JSON data from
assets/data/characters/[id].json - Validates render type and version
- Creates appropriate character class instance
- Loads sprite assets and animations
- Applies offsets and properties
Example: Creating a Custom Character
assets/images/characters/custom.png and custom.xml.