Final Fantasy I & II: Dawn of Souls:FF1 Animation Scripting

From Data Crystal
Revision as of 15:52, 18 June 2017 by Kea (talk | contribs) (Created page with "{{subpage|game=Final Fantasy I & II: Dawn of Souls:Notes}} Spell and attack animations in Final Fantasy I use a shared scripting language to define how animations play out. He...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Spell and attack animations in Final Fantasy I use a shared scripting language to define how animations play out. Here follows a list of known script commands; there are many more yet to be discovered and understood.


0x00: End animation
 0x4 bytes long
0x01: Execute previous commands
 0x8 Bytes long
 And do some bookkeeping too?
 Repeat until all previous commands are finished?
 Don't load subsequent commands until that time either
0x02:
Something to do with sound..?
 $00: Which $1F130 test to run
 $04: Value to check test against
0x05:
 -Used to handle spells like Blind that play an effect on individual targets before proceeding with 'main' effect
 -Loops for all 9 monsters or all 4 PCs, depending on who the target is
 -For each target, 
 $04: Mode byte; indexes to a routine jump table
  $1F130
  Run for each target to determine if that target will have the effect played	
  0x00: Return 0x1
  0x01: Return 0x1 for all living targets
  0x02: If caster is a monster, return 0x0; if a PC, return 0x1
  0x03: If target(s) is/are monster(s), return 0x0; if targets are PC, return 0x1
  0x04: Return 0x1 only on targets who are effected by the spell? (for Kill, etc?)
  0x05: (same as 0x01)
  0x06: Depending on Encounter ID, returns a variable:
 $08: Some number that becomes the Param1 of a 0x7 Chunk - delay between each iteration
 $0C: Number of subsequent chunks to load
(these next chunks are applied to every valid target)
After loading those chunks, a 0x7 Chunk is created, and the delay set to $08's value
0x06, Jump to different script offsets based on conditional
 0x18 bytes
 -If the conditional returns 0x1, choose Branch A; if 0x0, choose Branch B
 $04: Delay
 $08: Conditional ID:
   $00: Return 0x1
   $01: Return 0x1 if unit of parameter's ID may be targeted; else return 0x0
   $02: If caster is a PC, return 0x1; if a monster, return 0x0
   $03: If target(s) is/are PCs, return 0x1; if monster(s), return 0x0
   $04: If target (or any among targets) received a status effect from this attack return 0x1; else 0x0
   $05: Same as $01
   $06: Checks encounter ID for special type; if equal to Parameter return 0x1; else 0x0
 $0C: Conditional Parameter
 $10: Branch A offset
 $14: Branch B offset
0x07, Delay?
 0x8 bytes
 $04: Delay in frames
0x08, Play Sound:
 0xC Bytes
 $04: Sound delay, in frames(?), from when this command is first read
 $08: Sound Effect ID


0x0A, Animate standing tile
 0x1C Bytes
 $04: Spawn Delay
 $08: TSA/animation pointer? Affects how the tile GFX are loaded and animated
 $0C: More TSA/animation stuff?
 $10: Origin point of GFX:
   0x00: Top-left corner of screen
   0x01: Center of screen
   0x02: Mid-left of screen
   0x03: Just above caster?
   0x04: Caster
   0x05: First enemy/target?
   0x06: Target?
   0x07: Caster?
   0x08: Top-left corner of screen?
 $14: Y-displacement (positive is down), hw
 $16: X-displacement (positive is right), hw
 $18: Same deal as $14 in Chunk 0x17...a zoom factor??
0x0B (used for Kill animation)
0x0D, Animate tile from target?
 0x20 bytes
 $04: Spawn delay
 $08: TSA/animation pointer
 $0C: Origin point type
 $10: Y-displacement
 $12: X-displacement
 $14: ??
 $18: ??
 $1C: ?? (zero?)
0x10, Animate tile moving tile (straight line)
 0x24 bytes
 $04: Delay
 $08: Tile data pointer?
 $0C: Some stuff to do with the origin...
 $10: Y origin
 $12: X origin
 $14: Y displacement (total)
 $16: X displacement (total)
 $18: Some sort of layering/zoom param?
  If 0x10000000, flip horizontally?
 $1C: Some sort of index to sprites within a spritesheet
 $20: Time; number of frames movement will take; lower values = faster, shorter
0x13, Animate tile 
 0x28 bytes
 $04: Delay (frames)
 $08: TSA/animation pointer
 $0C: Origin
 $10: Y-offset (hw)
 $12: X-offset
 $14: Some zoom factor? Same as $14 in Chunk 0x17
 $18: ??
 $1C: ??
 $20: ??
 $24: If non-0x1, tile stops animating...
 $26: If 0x1, tile is drawn beneath PC sprites
0x17, Animate moving tile:
 $04: Spawn delay, in frames, from the start of the animation
 $08: Some ROM pointer that affects how the GFX tiles are loaded
 $0C: Origin point of moving tile, to be modified by coordinates
 $10: Displacement from the origin for the GFX tile to emerge from
  $10-11: Y-coord
  $12-13: X-coord (both are signed)
 $14: Something...displacement after spawning?
 $18:
 $19-1A:
 $1B: Layer to draw on? (in front of/behind sprites)
 $1C: Path? Only values below 0x1F are accepted; indexes to a jump table of routines
   0x00: Move in a circle?
   0x02: Spiral outwards?
   0x05: Wobble downwards (fast)
   0x06: Wobble down-right (slow)
   0x12: Sway up+down then change
   0x16: Move to left edge of screen...or mid-left at least?
   0x18: Move to right edge of screen
 $20: Parameter relating to the $1C param
0x1C, Load fixed tile?
 0x10  bytes long
 $04: Anim/Tile data pointer
 $08: Palette pointer
 $0C: ?
0x1E, Something for the end of anims
 0x08 bytes long
 $04: Delay
0x1F, set anim data for fixed tile?
 0x0C bytes long
 $04: Delay
 $08: Layering?
  0x1 Draw translucently over sprites
  0x2 Draw under sprites
  0x3 Draw, and remove PC sprites!
0x21: Something to do with palettes...loads palette for cycling, sets the params
 0x18 bytes long
 $04: Delay
 $08: Palette pointer
 $0C: Number of frames to play before looping
 $10: Palette cycling speed
 $14: Total time to pause before moving on
0x23: Something about activating an animation...
 0x10 bytes long
 $04: Delay
 $08: Tile data pointer..?
0x24: Restore normal brightness
 0x0C bytes long
 $04: Delay
 $08: Light speed
0x26: Tint spell GFX
 0x18 bytes long
 $04: Delay
 $08: ?
 $0C: ?           0xC and 0xC makes a faded tint...
0x27: Darken screen
 0x18 bytes long
 $04: Delay (before beginning)
 $08: Colour (only red?)
 $0C: Intensity
 $10: Flags:
   0x00: Fade BG
   0x01: Fade PCs
   0x02: Fade Monsters
   0x04: Fade spell animation
   0x05: Fade everything?
 $14: Fade speed (frames) - don't move to next command until finished darkening