Skip to content

Bin file structure

Ihar Hubchyk edited this page May 7, 2020 · 27 revisions

This page contains incomplete information. Please inform us if you find something incorrect.

AGG file is an archive which contains multiple files. Bin files contain information related to displaying images (sprites) on screen.

Monster/creature animation bin file starts from short name of the creature ending by frm. For example, goblnfrm.bin. The file name length is 12 characters. The size of this file is always 821 bytes.

Creature animation frames are divided by sections. Each section could have up to 16 frames.

  • Byte 0 : always 0x01 (magic value) [uint8_t]
  • Bytes 1 - 4 : x and y position of creature's eyes [int16_t]
  • Bytes 5 - 116 : X-axis offset of frame for first 7 animation sections (16 values/bytes per section) [uint8_t]
  • Byte 117 : number of idle animations (used for verification) [uint8_t]
  • Bytes 118 - 137 : probabilities of choosing specific idle animation [float]
  • Bytes 138 - 157 : intended delay (?) for each idle animation [uint32_t]
  • Bytes 158 - 161 : delay between idle animations (?) [uint32_t]
  • Bytes 162 - 165 : walking animation speed to move 1 hex, in ms [uint32_t]
  • Bytes 166 - 169 : shooting animation speed, ms [uint32_t]
  • Bytes 170 - 173 : flying animation speed, pixels per sec (?) [uint32_t]
  • Bytes 174 - 185 : projectile start offset [x, y] for 3 directions [int16_t]
  • Byte 186 : number of projectile animation sprites [uint8_t]
  • Bytes 187 - 234 : 12 angles at which projectile sprite should be used [float]
  • Bytes 235 - 242 : x and y position of creature's count box [int32_t]
  • Bytes 243 - 276 : amount of frames per each animation frame section (34 values in total) [uint8_t]
  • Bytes 277 - 820 : sequence of frame IDs for each animation section (34 sections). Only values which not equal to 0xFF are used in animation [uint8_t]

Animation frame sections:

  1. start flying
  2. static/selection frame (?)
  3. continuous movement or fly when a creature moves for long distance (?)
  4. stop movement
  5. some movement ???
  6. one cell full movement
  7. NOT IN USE (always empty)
  8. always frame ID 1
  9. idle animation 1
  10. idle animation 2
  11. idle animation 3
  12. idle animation 4
  13. idle animation 5
  14. death animation
  15. wince (got hit) start
  16. wince (got hit) end
  17. single cell attack from bottom
  18. ending single cell attack from bottom
  19. double cell attack from bottom
  20. ending double cell attack from bottom
  21. single cell attack in front
  22. ending single cell attack in front
  23. double cell attack in front
  24. ending double cell attack in front
  25. single cell attack from top
  26. ending single cell attack from top
  27. double cell attack from top
  28. ending double cell attack from top
  29. shoot from bottom
  30. ending shoot from bottom
  31. shoot in front
  32. ending shoot in front
  33. shoot from top
  34. ending shoot from top

X-axis offset for animations (all zeros for flying monsters):

  1. start movement
  2. static/selection frame (?)
  3. continuous movement or fly when a creature moves for long distance (?)
  4. stop movement
  5. some movement ???
  6. one cell full movement

Special thanks to idshibanov for providing missing info regarding file structure.