Repository navigation
The Master JSON
This page explains every field that spr-pack.json can contain, aka, every property your pack and animations can have. If you've never made a pack before, read Getting Started first so the terms we're probably gonna use here make sense.
A spr-pack.json has this general shape:
{
"setName": "My Sprite Pack Name",
"author": "Pack Author",
"description": "Description of your pack, can be as long as you want",
"credits": ["List of people", "That made the assets", "In your pack"],
"globalAttributes": {},
"events": [
{
"Cube": {
"<event id>": { "bunch of stuff here" }
},
"Ship": {
"<event id>": { "bunch of stuff here" }
}
}
]
}Things to keep in mind:
- We're working with JSON: double quotes, no trailing commas, no comments allowed, watch your [ and { usage (u never know).
- Key names are case sensitive (
frameTime, notframetime). - If something is wrong (a required key is missing, a value has the wrong type), the ENTIRE pack will fail to load, and the error tells you which event and key is the problem. This will make it easier for you to spot any critical errors, though!
- Keys the mod doesn't know about are ignored, so a typo in an optional field won't give you an error, it'll just do nothing. If an option isn't doing anything, make sure it's properly spelled.
These go at the very top level of the file. They're what shows up in the menu.
| Field | Type | Required | Description |
|---|---|---|---|
setName |
string | Yes | The pack's display name. Also shown as the title of the pack's settings popup. |
author |
string | Yes | Who made the pack. Shown under the name in the menu. |
description |
string | No | Shown when the user presses the pack's info button, supports Markdown. If you leave it out, the popup says "No Description Provided". |
credits |
array of strings | No | People to credit for assets in your pack (sprites, sounds, etc). When it's filled in, the menu shows "By author - Assets by credits". |
"setName": "Sonic Pack",
"author": "Asterveila",
"description": "Gotta go fast!\n\nSprites ripped from Sonic Mania.",
"credits": ["SEGA"]Defined as globalAttributes in your json, these are settings that affect the entire pack, and are entirely optional. These go at the root of the file, not inside events (putting it inside events is gonna give u an error).
| Field | Type | Default | Description |
|---|---|---|---|
scale |
number | 1.0 |
Scale multiplier for all of the pack's sprites. Must be greater than 0. |
pixelMode |
boolean | false |
Switches the scaling to Nearest Neighbor, meant for pixel art sprites to not get blurry when scaled up. (same as the editor's pixel art objects). |
keepRobotFire |
boolean | false |
Keeps the Robot's jump fire visible. By default it's hidden while your sprite is showing. |
keepRobotParticles |
boolean | false |
Keeps the Robot's burst particles visible. Incompatible with Trail Pro Max. |
keepSwingFires |
boolean | false |
Keeps the Swing's fire effects visible. |
keepDashFire |
boolean | false |
Keeps the dash fire effect visible when dashing. |
noDeathEffects |
boolean | false |
Disables GD's death effects (the explosion and particles) so only your own death animation plays. |
"globalAttributes": {
"scale": 2.0,
"pixelMode": true,
"keepDashFire": true,
"noDeathEffects": true
}About scale: The mod already takes care of the game's Texture Quality setting, so your sprites should be the same size no matter what quality the player uses. Aka, you don't need to worry about having -uhd or -hd variants of your sprites, the mod takes care of this.
Since scale applies to the whole pack, it's perfect for pixel art. Instead of upscaling every frame by hand, keep them at 1x, set pixelMode to true, and set scale to whatever value you think is best (remember to click "Reload" in the mod's popup to playtest!).
All animations live in events. It's an array of objects, where each object is keyed by gamemode name, and each gamemode contains its events, keyed by an event name:
"events": [
{
"Cube": {
"running-anim": { ... },
"NormalJump": { ... },
"idle-anim": { ... }
},
"Ship": {
"Mod:Update": { ... }
}
}
]-
Gamemode names:
Cube,Ship,Ball,UFO,Wave,Robot,Spider,Swing,Jetpack. Case sensitive. -
Event ID: the key you give each animation. It does two things:
- It's the name shown in the user's menu for that animation (so use something clear).
- If you don't set
triggerOn, the ID must be an event name, since it'll also used as the thing that triggers the animation. That's why"NormalJump": {...}would work with notriggerOn: the ID is a real game event. If you want a custom name that's not a real event (like"Spin Attack"), you must settriggerOn.
Everything below goes inside an event, like "NormalJump": { ...here... }.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
subfolder |
string | Yes | Folder inside your pack where this animation's images are, relative to the pack's root. Needed on every animation, single frame ones too. | |
spriteBaseName |
string | Yes, unless singleFrame
|
Prefix of the frame file names. Frames are read as <subfolder>/<spriteBaseName><number>.png. Include any separator yourself: "run_" will look for run_01.png, but "run" looks for run01.png. |
|
frameCount |
integer | Yes, unless singleFrame
|
How many frames the animation has. Must be greater than 0. Numbers go from 1 to frameCount, padded to at least 2 digits (or more if frameCount needs it). A missing frame file is skipped with a warning in geode's log instead of failing the full pack. If none of the frames load, the animation is ignored and you'll most likely see it as a "?" on the preview list on the mod's popups. |
|
singleFrame |
boolean | No | false |
Defines if the animation is just one static image. Use spriteName instead of spriteBaseName/frameCount, and you don't need frameTime. With no holdFor, it counts as finished immediately, so PLEASE set one (-1 keeps it active until something interrupts it). |
spriteName |
string | Yes, if singleFrame
|
File name of the image without .png, used exactly as written (no numbering or padding). |
"subfolder": "cube",
"spriteBaseName": "run_",
"frameCount": 4Looks for cube/run_01.png through to cube/run_04.png.
"subfolder": "cube",
"singleFrame": true,
"spriteName": "hurt",
"holdFor": 0.5Shows cube/hurt.png for half a second.
Non single-frame animations need either frameTime or the minFrameTime/maxFrameTime pair. Not both, and not neither.
minFrameTime & maxFrameTime define a range of time the mod will randomly pick a number from every time the event containing these is triggered. Both must be set together if using these at all.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
frameTime |
number | See above | How long each frame lasts, in seconds. | |
minFrameTime |
number | With maxFrameTime
|
Minimum number to pick from. | |
maxFrameTime |
number | With minFrameTime
|
Maximum number to pick from. |
"frameTime": 0.08"minFrameTime": 0.06,
"maxFrameTime": 0.12| Field | Type | Required | Default | Description |
|---|---|---|---|---|
triggerOn |
array of strings | No | [<event ID>] |
Events that start this animation. Can be any game event, any Mod: event or a shortcut like Mod:AnyLanding (see Mod Shortcuts & Special Events). Must be an array, even for one event. ( ["NormalJump"], not "NormalJump"). If it's missing, the event ID is the trigger. Being explicit is still a good idea, since the menu shows it to the user as "Triggered by: ...". Don't give two animations in the same gamemode the same trigger, since which one wins isn't guaranteed. The exception is a specific event vs. a shortcut: HardLanding always beats Mod:AnyLanding. |
cancelOn |
array of strings | No | none | Events that stop this animation while it's playing. Takes game events and shortcuts, and must be an array too. It works even if canBeInterrupted is false. If the cancelling event also triggers another animation, that one starts right away, otherwise the sprite goes back to the base animation. |
"Landing": {
"triggerOn": ["Mod:AnyLanding"],
"subfolder": "cube",
"spriteBaseName": "land_",
"frameCount": 3,
"frameTime": 0.06,
"loopAnim": false
}Landing is just a name here for easier readability, the animation plays on any kind of landing.
"Mod:Idle": {
"subfolder": "cube",
"spriteBaseName": "idle_",
"frameCount": 6,
"frameTime": 0.1,
"cancelOn": ["JumpPush", "LeftPush", "RightPush"]
}| Field | Type | Required | Default | Description |
|---|---|---|---|---|
loopAnim |
boolean | No | true |
true repeats the animation until holdFor runs out or something interrupts it. false plays it once. You'll typically use looping for running, flying and idling the most. |
holdFor |
number | No | none | How long the animation stays active, in seconds. - On a non-looping animation, the last frame is held for this long after it finishes. - On a looping one, it loops for this long before ending and letting other animations play (Useful if you want a looping animation to only loop a certain amount of times) Any negative number (use -1) holds forever, until something interrupts it. If not set, a non-looping animation is done when its last frame ends, and a looping one runs until interrupted. While active, the base animation doesn't take over and the vanilla icon stays hidden (unless keepPlayer). |
canBeInterrupted |
boolean | No | true |
true: any newly triggered animation replaces this one instantly. false: it plays all the way through, and the most recent animation triggered in the meantime is queued and plays right after. cancelOn events and death animations still cut through. Make sure an uninterruptible animation can end (don't loop it, or give it a holdFor or cancelOn), or it just remains active forever. |
interruptBySelf |
boolean | No | false |
What happens when this animation's own trigger fires again while it's playing. false keeps playing, true restarts from frame 1. Whether other animations can interrupt it is up to canBeInterrupted. |
skipForLoop |
array of integers | No | none | Frame numbers to skip after the first loop. The first pass plays every frame, then later loops skip these. Numbers match your file names, so they start at 1. Needs loopAnim: true (otherwise it does nothing and logs a warning). Every number must be between 1 and frameCount, and you can't skip every frame. |
lockRotation |
boolean | No | false |
Locks the player's rotation at 0 so the sprite always stays upright, instead of obeying vanilla rotation (Like Cube, Ball, Ship, etc). The sprite still flips vertically when gravity is upside down, and respects arrow trigger rotation. |
keepPlayer |
boolean | No | false |
Keeps the vanilla icon (and vehicle) visible alongside your sprite instead of hiding it. Useful if you're not trying to replace your icons completely, but rather add cosmetics like hats, bows, or anything else. |
"Mod:Update": {
"subfolder": "cube",
"spriteBaseName": "run_",
"frameCount": 8,
"frameTime": 0.07,
"loopAnim": true,
"skipForLoop": [1, 2]
}Plays frames 1 to 8 once, then loops frames 3 to 8.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
offsetX |
number | No | 0 |
Moves the sprite horizontally from the player's center. Positive is right. |
offsetY |
number | No | 0 |
Moves the sprite vertically from the player's center. Positive is up. Automatically flips when the player is upside down so the sprite stays in place. |
Both are in game units, not plist-style pixel offsets, so be careful of using big numbers. They're set per animation, so different animations can use different offsets if their frames have different margins.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
fadeOutTime |
number | No | none | How long the fade-out takes once the animation's last frame is reached (or right away for a single frame animation). Only valid on an animation triggered by Mod:StaticDeathDisappear, using it anywhere else gives an error. |
Dying has its own special events, explained in Mod Shortcuts & Special Events.
A small but complete pack with the main features, so you can see how they fit together:
{
"setName": "Example Pack",
"author": "Saritahhh",
"description": "An example pack for the wiki.",
"credits": ["Someone"],
"globalAttributes": {
"scale": 2.0,
"pixelMode": true,
"noDeathEffects": true
},
"events": [
{
"Cube": {
"Mod:Update": {
"subfolder": "cube",
"spriteBaseName": "run_",
"frameCount": 8,
"frameTime": 0.07,
"skipForLoop": [1, 2],
"lockRotation": true
},
"Jump": {
"triggerOn": ["NormalJump"],
"subfolder": "cube",
"spriteBaseName": "jump_",
"frameCount": 4,
"frameTime": 0.06,
"loopAnim": false,
"holdFor": 0.2,
"lockRotation": true,
"interruptBySelf": true
},
"Landing": {
"triggerOn": ["Mod:AnyLanding"],
"subfolder": "cube",
"spriteBaseName": "land_",
"frameCount": 3,
"frameTime": 0.05,
"loopAnim": false,
"lockRotation": true
},
"Death": {
"triggerOn": ["Mod:StaticDeathDisappear"],
"subfolder": "cube",
"singleFrame": true,
"spriteName": "hurt",
"holdFor": 0.5,
"fadeOutTime": 0.3
}
}
},
{
"Ship": {
"Mod:Update": {
"subfolder": "ship",
"spriteBaseName": "fly_",
"frameCount": 2,
"minFrameTime": 0.08,
"maxFrameTime": 0.15,
"offsetY": -2
}
}
}
]
}When a pack is invalid, importing it fails and shows you the reason. If an already-installed pack fails to load on Reload or when the game starts, the reason is written to your Geode log, and it'll show up as an error entry in the menu. Here's what the messages mean:
| Message (roughly) | What's wrong/Fix? |
|---|---|
missing pack.png / missing spr-pack.json
|
One of the two required files isn't at the root folder of the pack. |
spr-pack.json is not valid json |
A syntax error: a missing/extra comma, a missing quote, a comment, etc. |
missing required field 'setName' / 'author'
|
Self explanatory. Add the missing field. |
'events' must be an array |
events needs [ ... ], not { ... }. |
each entry in 'events' must be an object keyed by gamemode |
Every item inside the events array must be an object like { "Cube": {...} }. |
'globalAttributes' goes at the root of the file, not inside 'events' |
Move it out of events. |
'scale' must be greater than 0 |
Use a positive number. |
missing required field 'subfolder' |
Every event needs a subfolder. |
missing required field 'spriteBaseName' / 'frameCount'
|
Needed unless the event has singleFrame. |
missing required field 'spriteName' |
Needed when singleFrame is on. |
frameCount must be greater than 0 |
Self explanatory. |
specify either frameTime or minFrameTime/maxFrameTime, not both |
Pick one way of timing. |
minFrameTime and maxFrameTime must both be set together |
You need both for a range. |
must specify either frameTime or minFrameTime + maxFrameTime |
The animation has no timing at all. |
'triggerOn' must be an array of strings / 'cancelOn' must be an array of strings
|
Wrap it in [ ], even if it's only one value. |
'skipForLoop' entry N is out of range |
The number doesn't match any frame (valid: 1 to frameCount). |
'skipForLoop' skips every frame |
At least one frame has to remain for the loop. |
'fadeOutTime' is only valid on an event that triggers on Mod:StaticDeathDisappear |
Remove it, or change the trigger. |
field 'x' must be a number / a string / an integer
|
The value has the wrong type, like "frameTime": "0.1" with quotes. |
Missing image files and missing sound files don't cause a load error. They're skipped, and a warning is logged (on geode's log, not on the mod's menu). If something isn't showing up in-game, verify your json and check your logs if you can't seem to find the culprit.