Users browsing this thread: 1 Guest(s)
Sprite animation Patterns

#1
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
There's definitely patterns in sprite movements (tiles indexes used) but how does the game differentiate a 16 tiles sprite that has animation from another that has none? There's example of 2x2 (4 poses) sprites like the flame or static 4x4 sprites like the platform in magitek factory. Is there some data table with sprite patterns (tile swapping depending on pose)? Or does exception are made directly in the code depending of the sprite ID?

Edit: I guess I'm looking for some NPC OAM data for walking pattern or sprite arrangements.
  Find
Quote  

#2
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
I remember reading some stuff in Edrin's files regarding that but I never could make anything of it. If I had my disk with me I'd try to find it, but I can't offer any more than that right now. I know I've read it or something close though. Sorry I can't provide better than that.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#3
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
It's in the OAM data at least, not sure where it's handled in overworld or battle, but there's likely a similar setup somewhere else as well.

Essentially, the there are only a few sprite sizes: 2x3, 3x4, and i *think* 4x6 (magitek cranes might be the only one to utilize this size). The first byte in the OAM tells the loader which it is with $02 for 2-wide sprites, and $03 and 3-wide sprites. Once it knows the sprite size, everything else follows a pattern.

Here's an example from the OAM:

Code:
Terra
D8/EA5C - Standing
02 80 01 00 39 80 11 02 39
D8/EA65 - Fanfare
02 80 00 04 39 80 10 06 39

(standing still, facing left)
D8/EA5C: tiles wide (2 for normal sprites, 3 for large [odin, tritoch, etc...])
D8/EA5D: X position of head tile
D8/EA5E: Y position of head tile
D8/EA5F: head tile ID (start of 4-byte block)
D8/EA60: palette and other things; palette uses (0000 1110) bits
D8/EA61: X position of foot tile
D8/EA62: Y position of foot tile
D8/EA63: foot tile ID (start of 4-byte block)
D8/EA64: palette and other things; palette uses (0000 1110) bits

("fanfare" pose, both arms up, facing left)
D8/EA65: tiles wide (2 for normal sprites, 3 for large [odin, tritoch, etc...])
D8/EA66: X position of head tile
D8/EA67: Y position of head tile
D8/EA68: head tile ID (start of 4-byte block)
D8/EA69: palette and other things; palette uses (0000 1110) bits
D8/EA6A: X position of foot tile
D8/EA6B: Y position of foot tile
D8/EA6C: foot tile ID (start of 4-byte block)
D8/EA6D: palette and other things; palette uses (0000 1110) bits

Again, there's probably another place this is handled for the overworld and battle sprites, but this should hopefully help point you in the right direction.
  Find
Quote  

#4
Posts: 181
Threads: 3
Thanks Received: 26
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
I'm not sure about battle and menu, but if you're talking about sprites on maps, I think what you're looking for is in the NPC data at $C41D52 (9 bytes each). There are actually 3 different kinds of NPC's, depending on how the data is set up. There are different data formats for each type, and some of the bits do different things depending on what kind of NPC it is.

The first type is for typical NPC's that have a normal walking animation.
The second is for objects like flames and save points that have a special animation.
The third is for objects with special graphics like all the mechanical stuff in the magitek factory. These are the only ones that can be 32x32 pixels instead of 16x16.

Here's my notes on the data format for all three types. The first one is for typical NPC's and the other two show what bits are different for the other two types of NPC's. I adapted this from Yousei's FF3Info.txt doc.

Code:
NPC Data:
$0000                               Event address low byte
$0001                               Event address mid byte
$0002:0-1                           Event address high byte
     :2-4                           Object palette index
     :5                             Object scrolls with BG2 instead of BG1
     :6-7                           Low bits of event bit
$0003                               High bits of event bit
$0004:0-6                           Horizontal (X) position
     :7                             Show rider on vehicle
$0005:0-5                           Vertical (Y) position
     :6-7                           Object Speed
$0006                               Graphic set
$0007:0-3                           Movement type (0 = none, 1 = script-controlled, 2 = user-controlled, 3 = random, 4 = activated)
     :4-5                           Sprite priority (layering with respect to other sprites)
     :6-7                           Vehicle (0 = none, 1 = chocobo, 2 = magitek, 3 = raft)
$0008:0-1                           Direction facing (0: up, 1: right, 2: down, 3: left)
     :2                             Does not turn to face character when spoken to
     :3-4                           Layer priority (layering with respect to background)
     :5-7                           Must be 0

NPC Data (w/ special animation):
$0008:0-1                           Animation Type (0 = one frame, 1 = one frame, flips horizontally, 2 = two frames, 3 = four frames)
     :5-7                           Animation offset (see C0/58E4)

NPC Data (w/ special graphics):
$0000:0-6                           VRAM address of special sprite graphics
     :7                             Flip sprite horizontally
$0001:0-4                           Master NPC (this object follows the master NPC whenever it moves)
     :5-7                           Position offset
$0002:0                             Position offset direction (0 = right, 1 = down)
     :1                             Slave (enables master NPC)
     :7                             Must be 1
$0007:6-7                           Must be 0
$0008:2                             32x32 sprite graphics
  Find
Quote  
[-] The following 2 users say Thank You to Everything for this post:
  • madsiur (10-08-2015), Tenkarider (10-08-2015)

#5
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(10-08-2015, 12:52 AM)Everything Wrote: The second is for objects like flames and save points that have a special animation.
The third is for objects with special graphics like all the mechanical stuff in the magitek factory. These are the only ones that can be 32x32 pixels instead of 16x16.

That'S exactly what I was looking for. Now, a final question remains. How does the game differentiate all three type if they are all part of the NPC data?
  Find
Quote  

#6
Posts: 181
Threads: 3
Thanks Received: 26
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
(10-08-2015, 05:41 PM)Madsiur Wrote: How does the game differentiate all three type if they are all part of the NPC data?

Good question. There are a few places in the data format where it says "Must be 0" or "Must be 1". This is how the game decides what type of NPC it is.

If bits 5-7 of byte 8 are not all zero, the sprite will have a special animation.

If bit 7 of byte 2 is set and bits 6-7 of byte 7 are both zero, the sprite will have special graphics.
  Find
Quote  

#7
Posts: 48
Threads: 10
Thanks Received: 3
Thanks Given: 4
Joined: May 2015
Reputation: 2
Status
None
Quote:If bits 5-7 of byte 8 are not all zero, the sprite will have a special animation.

If bit 7 of byte 2 is set and bits 6-7 of byte 7 are both zero, the sprite will have special graphics.

Okay fess up, you're one of the original devs right? It's either that or you're a wizard.
  Find
Quote  

#8
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
That's what i thought as well, or perhaps he's omniscient... i mean, Everything as Nickname Laugh


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#9
Posts: 181
Threads: 3
Thanks Received: 26
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
(10-09-2015, 10:49 AM)sleepydude Wrote: Okay fess up, you're one of the original devs right?

Haha, I wish. I was only 8 years old when this game came out! No, I've just done a lot of asm hacking.
  Find
Quote  

#10
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
The other OAM data I was refering to.

Code:
D8/E917: Pointers to pointers! used to make calling simple since different characters have different length OAM data
45 E9 - Terra
57 E9 - Locke
69 E9 - Cyan
7B E9 - Shadow
8D E9 - Edgar
9F E9 - Sabin
B1 E9 - Celes
C3 E9 - Strago
D5 E9 - Relm
E7 E9 - Setzer
F9 E9 - Mog
0B EA - Gau
1D EA - Gogo
2F EA - Umaro
41 EA - Soldier
44 EA - Imp
47 EA - Leo
4A EA - Bannon
4D EA - Esper Terra
50 EA - Merchant
53 EA - Ghost
56 EA - Kefka
59 EA - Soldier 2

OAM pointers for various things:
(im guessing they are the various instances called, shop menues, save, etc...)
(byte 3?)
D8/E945 - Terra
5C EA 10 - Save Screen
5C EA 10 - Pary Select
5C EA FF - Unknown/Unused
5C EA 10 - Shop
65 EA 10 - Shop Fanfare
5C EA FF - Unknown/Unused

D8/E957 - Locke
Locke
6E EA 10 - Save Screen
6E EA 10 - Party Select
6E EA FF - Unknown/Unused
6E EA 10 - Shop
77 EA 10 - Shop Fanfare
6E EA FF - Unknown/Unused

D8/E969 - Cyan
80 EA 10 - Save Screen
80 EA 10 - Pary Select
80 EA FF - Unknown/Unused
80 EA 10 - Shop
89 EA 10 - Shop Fanfare
80 EA FF - Unknown/Unused

D8/E97B - Shadow
92 EA 10 - Save Screen
92 EA 10 - Pary Select
92 EA FF - Unknown/Unused
92 EA 10 - Shop
9B EA 10 - Shop Fanfare
92 EA FF - Unknown/Unused

D8/E98D - Edgar
A4 EA 10 - Save Screen
A4 EA 10 - Pary Select
A4 EA FF - Unknown/Unused
A4 EA 10 - Shop
AD EA 10 - Shop Fanfare
A4 EA FF - Unknown/Unused

D8/E99F - Sabin
B6 EA 10 - Save Screen
B6 EA 10 - Pary Select
B6 EA FF - Unknown/Unused
B6 EA 10 - Shop
BF EA 10 - Shop Fanfare
B6 EA FF - Unknown/Unused

D8/E9B1 - Celes
C8 EA 10 - Save Screen
C8 EA 10 - Pary Select
C8 EA FF - Unknown/Unused
C8 EA 10 - Shop
D1 EA 10 - Shop Fanfare
C8 EA FF - Unknown/Unused

D8/E9C3 - Strago
DA EA 10 - Save Screen
DA EA 10 - Pary Select
DA EA FF - Unknown/Unused
DA EA 10 - Shop
E3 EA 10 - Shop Fanfare
DA EA FF - Unknown/Unused

D8/E9D5 - Relm
EC EA 10 - Save Screen
EC EA 10 - Pary Select
EC EA FF - Unknown/Unused
EC EA 10 - Shop
F5 EA 10 - Shop Fanfare
EC EA FF - Unknown/Unused

D8/E9E7 - Setzer
FE EA 10 - Save Screen
FE EA 10 - Pary Select
FE EA FF - Unknown/Unused
FE EA 10 - Shop
07 EB 10 - Shop Fanfare
FE EA FF - Unknown/Unused

D8/E9F9 - Mog
10 EB 10 - Save Screen
10 EB 10 - Pary Select
10 EB FF - Unknown/Unused
10 EB 10 - Shop
19 EB 10 - Shop Fanfare
10 EB FF - Unknown/Unused

D8/EA0B - Gau
22 EB 10 - Save Screen
22 EB 10 - Pary Select
22 EB FF - Unknown/Unused
22 EB 10 - Shop
2B EB 10 - Shop Fanfare
22 EB FF - Unknown/Unused

D8/EA1D - Gogo
34 EB 10 - Save Screen
34 EB 10 - Pary Select
34 EB FF - Unknown/Unused
34 EB 10 - Shop
3D EB 10 - Shop Fanfare
34 EB FF - Unknown/Unused

D8/EA2F - Umaro
46 EB 10 - Save Screen
46 EB 10 - Pary Select
46 EB FF - Unknown/Unused
46 EB 10 - Shop
4F EB 10 - Shop Fanfare
46 EB FF - Unknown/Unused

D8/EA41 - Soldier
58 EB FE - Save Screen

D8/EA44 - Imp
61 EB FE - Save Screen

D8/EA47 - Leo
6A EB FE - Save Screen

D8/EA4A - Bannon
73 EB FE - Save Screen

D8/EA4D - Esper Terra
7C EB FE - Save Screen

D8/EA50 - Merchant
85 EB FE - Save Screen

D8/EA53 - Ghost
8E EB FE - Save Screen

D8/EA56 - Kefka
97 EB FE - Save Screen

D8/EA59 - Soldier 2
A0 EB FE - Save Screen


Terra
D8/EA5C - Standing
02 80 01 00 39 80 11 02 39
D8/EA65 - Fanfare
02 80 00 04 39 80 10 06 39
Locke
D8/EA6E - Standing
D8/EA77 - Fanfare
02 80 01 08 37 80 11 0A 37 02 80 00 0C 37 80 10 0E 37
Cyan
D8/EA80 - Standing
D8/EA99 - Fanfare
02 80 01 20 3D 80 11 22 3D 02 80 00 24 3D 80 10 26 3D
Shadow
D8/EA92 - Standing
D8/EA9B - Fanfare
02 80 01 28 3D 80 11 2A 3D 02 80 00 2C 3D 80 10 2E 3D
Edgar
D8/EAA4 - Standing
D8/EAAD - Fanfare
02 80 01 40 35 80 11 42 35 02 80 00 44 35 80 10 46 35
Sabin
D8/EAB6 - Standing
D8/EABF - Fanfare
02 80 01 48 35 80 11 4A 35 02 80 00 4C 35 80 10 4E 35
Celes
D8/EAC8 - Standing
D8/EAD1 - Fanfare
02 80 01 60 35 80 11 62 35 02 80 00 64 35 80 10 66 35
Strago
D8/EADA - Standing
D8/EAE3 - Fanfare
02 80 01 68 3B 80 11 6A 3B 02 80 00 6C 3B 80 10 6E 3B
Relm
D8/EAEC - Standing
D8/EAF5 - Fanfare
02 80 01 80 3B 80 11 82 3B 02 80 00 84 3B 80 10 86 3B
Setzer
D8/EAFE - Standing
D8/EB07 - Fanfare
02 80 01 88 3D 80 11 8A 3D 02 80 00 8C 3D 80 10 8E 3D
Mog
D8/EB10 - Standing
D8/EB19 - Fanfare
02 80 01 A0 3F 80 11 A2 3F 02 80 00 A4 3F 80 10 A6 3F
Gau
D8/EB22 - Standing
D8/EB2B - Fanfare
02 80 01 A8 3B 80 11 AA 3B 02 80 00 AC 3B 80 10 AE 3B
Gogo
D8/EB34 - Standing
D8/EB3D - Fanfare
02 80 01 C0 3B 80 11 C2 3B 02 80 00 C4 3B 80 10 C6 3B
Umaro
D8/EB46 - Standing
D8/EB4F - Fanfare
02 80 01 C8 3F 80 11 CA 3F 02 80 00 CC 3F 80 10 CE 3F
Soldier
D8/EB58 - Standing
02 80 01 E0 37 80 11 E2 37
Imp
D8/EB61 - Standing
02 80 01 E8 35 80 11 EA 35
Leo
D8/EB6A - Standing
02 80 01 04 35 80 11 06 35
Bannon
D8/EB73 - Standing
02 80 01 0C 3B 80 11 0E 3B
Esper Terra
D8/EB7C - Standing
02 80 01 24 39 80 11 26 39
Merchant
D8/EB85 - Standing
02 80 01 2C 37 80 11 2E 37
Ghost
D8/EB8E - Standing
02 80 01 44 35 80 11 46 35
Kefka
D8/EB97 - Standing
02 80 01 4C 39 80 11 4E 39
Soldier 2
D8/EBA0 - Standing
02 80 01 E0 35 80 11 E2 35


sprite arrangement, 9 bytes each, 2 sets for each character

(standing still, facing left)
D8/EA5C: tiles wide (2 for normal sprites, 3 for large [odin, tritoch, etc...])
D8/EA5D: X position of head tile
D8/EA5E: Y position of head tile
D8/EA5F: head tile ID (start of 4-byte block)
D8/EA60: palette and other things; palette uses (0000 1110) bits
D8/EA61: X position of foot tile
D8/EA62: Y position of foot tile
D8/EA63: foot tile ID (start of 4-byte block)
D8/EA64: palette and other things; palette uses (0000 1110) bits

("fanfare" pose, both arms up, facing left)
D8/EA65: tiles wide (2 for normal sprites, 3 for large [odin, tritoch, etc...])
D8/EA66: X position of head tile
D8/EA67: Y position of head tile
D8/EA68: head tile ID (start of 4-byte block)
D8/EA69: palette and other things; palette uses (0000 1110) bits
D8/EA6A: X position of foot tile
D8/EA6B: Y position of foot tile
D8/EA6C: foot tile ID (start of 4-byte block)
D8/EA6D: palette and other things; palette uses (0000 1110) bits

Palettes:
35 = 0
37 = 1
39 = 2
3B = 3
3D = 4
3F = 5

Terra
D8/EA5C - Standing
D8/EA65 - Fanfare
02 80 01 00 39 80 11 02 39 02 80 00 04 39 80 10 06 39
Locke
D8/EA6E - Standing
D8/EA77 - Fanfare
02 80 01 08 37 80 11 0A 37 02 80 00 0C 37 80 10 0E 37
Cyan
D8/EA80 - Standing
D8/EA99 - Fanfare
02 80 01 20 3D 80 11 22 3D 02 80 00 24 3D 80 10 26 3D
Shadow
D8/EA92 - Standing
D8/EA9B - Fanfare
02 80 01 28 3D 80 11 2A 3D 02 80 00 2C 3D 80 10 2E 3D
Edgar
D8/EAA4 - Standing
D8/EAAD - Fanfare
02 80 01 40 35 80 11 42 35 02 80 00 44 35 80 10 46 35
Sabin
D8/EAB6 - Standing
D8/EABF - Fanfare
02 80 01 48 35 80 11 4A 35 02 80 00 4C 35 80 10 4E 35
Celes
D8/EAC8 - Standing
D8/EAD1 - Fanfare
02 80 01 60 35 80 11 62 35 02 80 00 64 35 80 10 66 35
Strago
D8/EADA - Standing
D8/EAE3 - Fanfare
02 80 01 68 3B 80 11 6A 3B 02 80 00 6C 3B 80 10 6E 3B
Relm
D8/EAEC - Standing
D8/EAF5 - Fanfare
02 80 01 80 3B 80 11 82 3B 02 80 00 84 3B 80 10 86 3B
Setzer
D8/EAFE - Standing
D8/EB07 - Fanfare
02 80 01 88 3D 80 11 8A 3D 02 80 00 8C 3D 80 10 8E 3D
Mog
D8/EB10 - Standing
D8/EB19 - Fanfare
02 80 01 A0 3F 80 11 A2 3F 02 80 00 A4 3F 80 10 A6 3F
Gau
D8/EB22 - Standing
D8/EB2B - Fanfare
02 80 01 A8 3B 80 11 AA 3B 02 80 00 AC 3B 80 10 AE 3B
Gogo
D8/EB34 - Standing
D8/EB3D - Fanfare
02 80 01 C0 3B 80 11 C2 3B 02 80 00 C4 3B 80 10 C6 3B
Umaro
D8/EB46 - Standing
D8/EB4F - Fanfare
02 80 01 C8 3F 80 11 CA 3F 02 80 00 CC 3F 80 10 CE 3F
Soldier
D8/EB58 - Standing
02 80 01 E0 37 80 11 E2 37
Imp
D8/EB61 - Standing
02 80 01 E8 35 80 11 EA 35
Leo
D8/EB6A - Standing
02 80 01 04 35 80 11 06 35
Bannon
D8/EB73 - Standing
02 80 01 0C 3B 80 11 0E 3B
Esper Terra
D8/EB7C - Standing
02 80 01 24 39 80 11 26 39
Merchant
D8/EB85 - Standing
02 80 01 2C 37 80 11 2E 37
Ghost
D8/EB8E - Standing
02 80 01 44 35 80 11 46 35
Kefka
D8/EB97 - Standing
02 80 01 4C 39 80 11 4E 39
Soldier 2
D8/EBA0 - Standing
02 80 01 E0 35 80 11 E2 35


#$D8 loaded (possible bank pointers)
C3C26F
C3ED5D
C3C22F
C3B318
C37C0B
C3C0E2 - Shop menu Bank loaded
C3B213
C378BD
C376BC
C362C9
C33490
C3194c - Save menu


The only true wisdom is knowing you know nothing.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite