AgentSkillsCN

Animation System

在创建或编辑动画(.air文件)、定义精灵序列、设置碰撞盒(命中框与伤害框)、管理精灵组/图像,或了解SFF精灵格式时使用此技能。涵盖.air文件语法、Clsn框、动画时序、循环播放,以及精灵的组织与管理。

SKILL.md
--- frontmatter
description: Use this skill when creating or editing animations (.air files), defining sprite sequences, setting up collision boxes (hitboxes and hurtboxes), managing sprite groups/images, or understanding the SFF sprite format. Covers .air file syntax, Clsn boxes, animation timing, looping, and sprite organization.

Animation System

Overview

The animation system in IKEMEN Go / MUGEN connects sprites to gameplay through .air (Animation) files. Each animation is an "Action" consisting of frames that display sprites with timing, position offsets, and collision boxes.

.air File Format

Action Header

ini
[Begin Action 0]    ; Action number (matches anim= in Statedef or ChangeAnim)

Frame Format

Each line after the header defines one frame:

code
Group, Image, OffsetX, OffsetY, DisplayTime[, Flip][, Color]
  • Group: Sprite group number in .sff (e.g., 0 for idle sprites)
  • Image: Sprite image index within group (e.g., 0, 1, 2...)
  • OffsetX: Horizontal offset from character axis (positive = forward)
  • OffsetY: Vertical offset from character axis (negative = up from ground)
  • DisplayTime: Ticks to display this frame
    • Positive: display for N ticks
    • -1: Hold indefinitely (last frame of non-looping animation)
    • 0: Display for 0 ticks (skip frame, used for collision-only frames)
  • Flip: Optional. H = horizontal flip, V = vertical flip, VH = both
  • Color: Optional. Blend mode: A = add, A1 = add1, S = subtract, AS???D??? = custom alpha

Special Directives

Loopstart: Marks where looping animations restart from

ini
[Begin Action 0]  ; Idle - loops forever
0,0, 0,0, 7
0,1, 0,0, 7
Loopstart          ; Loop restarts from next frame
0,2, 0,0, 7
0,3, 0,0, 7
0,4, 0,0, 7

Interpolation (IKEMEN Go only):

ini
[Begin Action 100]
Interpolate Offset  ; Smooth position transitions between frames
Interpolate Angle   ; Smooth angle transitions
Interpolate Scale   ; Smooth scale transitions
Interpolate Blend   ; Smooth blend transitions
100,0, 0,0, 5
100,1, 10,0, 5     ; Position smoothly interpolates from (0,0) to (10,0)

Collision Boxes (Clsn)

Collision boxes define where a character can be hit and where attacks connect.

Clsn Types

  • Clsn1: Attack box (hitbox) -- where your attack hits
  • Clsn2: Vulnerable box (hurtbox) -- where you can be hit

Clsn Syntax

ini
; Per-frame collision boxes
Clsn1: 1                    ; 1 attack box for next frame only
Clsn1[0] = x1, y1, x2, y2  ; Left, Top, Right, Bottom

Clsn2: 2                    ; 2 hurt boxes for next frame only
Clsn2[0] = -15, -90, 15, 0  ; Body hurtbox
Clsn2[1] = -10, -100, 10, -90 ; Head hurtbox

Clsn Defaults (apply to all subsequent frames until overridden)

ini
Clsn2Default: 2             ; Default hurtboxes for ALL frames in this action
Clsn2[0] = -15, -80, 15, 0
Clsn2[1] = -10, -95, 10, -80

Coordinate System for Boxes

  • Origin (0,0) = character's axis point (feet center)
  • X: negative = behind character, positive = in front
  • Y: negative = above ground, positive = below ground (rarely used)
  • Box: x1,y1 = top-left corner, x2,y2 = bottom-right corner
  • Example: -15, -90, 15, 0 = box from 15 pixels behind to 15 front, ground to 90 up

Standard Sprite Groups

GroupPurposeExample Images
0Idle/Stand0,0 through 0,5 (6 frames)
5Turn around5,0 through 5,2
6Crouch transition6,0 through 6,2
10Standing hit10,0 through 10,3
11Crouch start11,0 through 11,2
20Walk20,0 through 20,7 (8 frames)
40Jump startup40,0 through 40,2
41-44Jump riseVarious angles
45-49Jump fallVarious angles
50Landing50,0 through 50,1
100Run forward100,0 through 100,5
105Hop back105,0 through 105,3
110Taunt110,0 through 110,9
120Guard stand120,0 through 120,1
130Guard crouch130,0 through 130,1
140Guard hit140,0 through 140,1
150Guard crouch hit150,0 through 150,1
200Light punch200,0 through 200,5
210Medium punch210,0 through 210,5
220Heavy punch220,0 through 220,7
230Light kick230,0 through 230,5
240Medium kick240,0 through 240,5
250Heavy kick250,0 through 250,7
400Crouch light punch400,0 through 400,4
410Crouch medium punch410,0 through 410,5
420Crouch heavy punch420,0 through 420,6
430Crouch light kick430,0 through 430,4
440Crouch medium kick440,0 through 440,5
450Crouch heavy kick450,0 through 450,7
600Jump light punch600,0 through 600,3
610Jump medium punch610,0 through 610,4
620Jump heavy punch620,0 through 620,5
630Jump light kick630,0 through 630,3
640Jump medium kick640,0 through 640,4
650Jump heavy kick650,0 through 650,5
700Throw attempt700,0 through 700,3
710Throw hold710,0 through 710,4
800Get hit light800,0 through 800,2
810Get hit medium810,0 through 810,3
820Get hit hard820,0 through 820,4
830Crouch hit830,0 through 830,2
840Air hit840,0 through 840,4
850Fall850,0 through 850,3
860Lie down860,0 through 860,1
870Get up870,0 through 870,5
900KO fall900,0 through 900,5
1000+Special move 1Custom
1100+Special move 2Custom
3000+Super move 1Custom
5000Hit spark5000,0 through 5000,4
5010Guard spark5010,0 through 5010,3
9000Portrait (select screen)9000,0
9001Portrait (versus screen)9001,0

Animation Timing Guide

For a 60fps engine:

  • 1 tick = 1/60th of a second (approx 16.67ms)
  • 7 ticks (approx 0.117s) = common idle frame time
  • 3 ticks = startup frame (fast attack)
  • 4-5 ticks = active frame
  • 6-8 ticks = recovery frame

Frame Data Convention

  • Startup: Frames before the hitbox appears
  • Active: Frames where the hitbox exists (Clsn1 present)
  • Recovery: Frames after hitbox disappears until control returns
  • Example: Light punch = 3 startup + 3 active + 6 recovery = 12 frames total

Tips

  1. Always set Clsn2Default for hurtboxes that stay consistent
  2. Only add Clsn1 (hitbox) on active attack frames
  3. Use Loopstart for idle, walk, and run animations
  4. Use -1 display time for the last frame of attack animations (held until state changes)
  5. Keep sprite offsets at 0,0 unless the character needs to shift position during animation
  6. Match animation action numbers to statedef numbers (Action 200 = State 200) for clarity
  7. IKEMEN Go interpolation directives can smooth movement without extra sprites
  8. Test collision boxes in debug mode (Ctrl+C in IKEMEN Go) to visualize them in-game