FF6 Hacking
Spell Graphics Document - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html)
+--- Thread: Spell Graphics Document (/thread-925.html)

Pages: 1 2


Spell Graphics Document - Zeemis - 03-02-2011

I'm still studying this, but a friend translated a conversation between me and SHALL. This is the key to actually importing spell graphics.
Japanese Log
Japanese Log Translated
Japanese
Code:
1 モンスター行動を2バイト命令に変更:”例;F0 EE EE EF→F0 FF EE 00 EE 00 EF 00”
2 魔法名を拡張           :”ファイアなどの名前”
3 魔法データを拡張         :”威力や命中率のデータ”
4 魔法メッセージを拡張       :”レベルが5の倍数にデスなどのメッセージ”
5 エフェクトデータの拡張      :”エフェクトパターンやパレットなどの設定”
6 エフェクト構成データ       :”エフェクトパターンの情報”
7 エフェクトのコマ設定拡張     :”エフェクトの種類とコマ数を設定”
8 エフェクトタイル構成拡張     :”コマで使用するタイルの作成”
9 エフェクトグラフィック読み込み拡張:”エフェクトのグラフィックを読み込むポインタ”
10 アニメーションオフセット拡張   :”エフェクトの動き”

English
Code:
1.  Convert monster actions to 2-byte instructions: “e.g. F0 EE EE EF→F0 FF EE 00 EE 00 EF 00”
2.  Extend magic names:                             “Fire, etc.”
3.  Extend magic data:                              “damage/hit value data”
4.  Extend magic messages:                          “Messages for Death, etc. where level is a multiple of 5”
5.  Extend effect data:                             “Settings for effect patterns, palettes, etc.”
6.  Effect composition data:                        “Effect pattern information”
7.  Extend effect frame settings:                   “Set kinds of effects and number of frames”
8.  Extend effect tile composition:                 “Make tiles used in frames”
9.  Extend effect graphic read-in:                  “The pointers it reads for effect graphics”
10. Extend animation offsets:                       “Effect movements”

0x107F8F: Magic graphic data
14 bytes per spell

Byte
00 01 Effect 1 number (from 000 to 2FF; no effect with FFFF)
02 03 Effect 2 number (same as above)
04 05 Effect 3 number (same as above)
06 Effect 1 palette
07 Effect 2 palette
08 Effect 3 palette
09 Effect sound
10 Unknown (for summon magic, selects summoned esper graphic)
11 12 Unknown
13 Wait

Among these, effect numbers select both effect properties and effect control
codes.
Code:
Example: Fire (107F8F-107F9C)
C1 00 FF FF FF FF 38 00 00 16 25 FF FF 10
C1 00      Effect 1 = 0C1
FF FF      No effect 2
FF FF      No effect 3
38         Effect 1 palette = 38
00         Effect 2 palette = 00 (none)
00         Effect 3 palette = 00 (none)
16         Effect sound 16
25         ??
FF FF      ??
10         Wait 10


0x14D000: Effect property
6 bytes per effect
(multiply effect number by 6 and add 14D000)

Byte
00 Animation frame number (selected from range 00-3F)
01 Number of image chipset to use
02 03 Animation pattern (set how to arrange image chip)
04 Effect width (00-10; 10 fills the screen)
05 Effect height (00-10; 10 fills the screen)

Code:
Example: Effect 0C1 (14D486-14D48B)
05 1C 4A 03 02 03
05          Frame #5
1C          Chipset number 1C
4A 03       Animation pattern 34A
02          W: 02
03          H: 03

0x120000: Image chip pointer
(Effect 3 only: 0x12C000-)

Multiply the image chipset number by 64 (40h) and add 120000 (or, for effect 3
only, 12C000). The length of the pointer data is 160 bytes for effects 1 and 2,
and 128 bytes for effect 3. The pointers are two-byte units.

Code:
Example: Chipset number 1C
1C * 40 + 120000 = 120700
That's the pointer.

* For effects 1 and 2
0x130000: Effect 1 and 2 image data
Multiply pointer value by 24 (18h) and add 130000 to get the image data offset.

Code:
Example: 50 02 (value 120700 from the previous example)
The pointer value is 250, so 250 * 18 = 3780
3780 + 130000 = 133780
The image data starts there.

The length of image data is 24 bytes; it is expanded from memory address
7FE400. From the header, 16 bytes are copied as-is, and the remaining 8 bytes
are alternated with zeroes.


Code:
Example: 6D FF F9 EF FD 6F ED FF EE F9 2F 7D FF ED FB ED
         EE AB EF FF FA BF FF FF
in which case, the data expanded in memory becomes:
         6D FF F9 EF FD 6F ED FF EE F9 2F 7D FF ED FB ED
         EE 00 AB 00 EF 00 FF 00 FA 00 BF 00 FF 00 FF 00

* For effect 3
0x187000: Effect 3 image data
Multiply pointer value by 16 (10h) and add 187000 to get image data offset.

Code:
Example: 46 04
The pointer value is 446, so 446 * 10 = 4460
4460 + 187000 = 18B460
That's where the image data starts.

The expanded memory address starts at 7FE400 just like effects 1 and 2, but effect 3's have 16-byte data, so they're copied as-is.

0x14DF36: Animation pattern offset
Multiply effect property's animation pattern value by 2 and add 14DF36 to get the entry point for the animation pattern.

The length read in is the effect property's animation frame number times 2.
(This is because there is one pointer per frame)

Code:
Example: 4A 03 (from effect 0C1, Fire's flames)
The value is 34A, so the offset is 34A * 2 + 14DF36 = 14E5CA
Effect 0C1's animation frame number is 5, so the data length is 10 bytes (5x2).
10 bytes starting from 14E5CA
E9 26 EB 26 F7 26 03 27 09 27

0x110000: Animation pattern
Add the value recorded in the animation pattern offset (14E5CA in the above
example) to 110000 to get the starting point.

In two byte values, the chip coordinates and chip number are described in that order. The rules are as below:
First, based on the effect property's width and height values, make a grid.

Example: For effect C1, width and height are 02 by 03, so the coordinates are basically:

00 10
01 11
02 12

Based on this, we describe the chip's arrangement.
Basically, we describe the chip in the order 00→10→01→11→02→12.

For example, for the arrangement is basically
00 09 10 0A 01 0B 11 0C 02 0D 12 0E

09 0A
0B 0C
0D 0E

This composes one frame.
If we reach where the coordinates end, or specify previous coordinates like 10→00, it ends.

Code:
Example: Effect 0C1
From the previous example, with pointers
E9 26 EB 26 F7 26 03 27 09 27
each respective frame's data offsets are
1126E9 (12 08)
1126EB (00 09 10 0A 01 0B 11 0C 02 0D 12 0E)
1126F7 (00 10 10 11 01 12 11 13 02 14 12 15)
112703 (10 17 11 0F 02 08)
112709 (11 16 02 16)

Arranging things according to the above example's coordinates, we get

null null
null null
null 08

[Image: ?plugin=ref&serial=71]


09 0A
0B 0C
0D 0E

[Image: ?plugin=ref&serial=72]


10 11
12 13
14 15

[Image: ?plugin=ref&serial=73]


null 17
null 0F
08 null

[Image: ?plugin=ref&serial=74]


null null
null 16
16 null


[Image: ?plugin=ref&serial=75]

And when we animate them, we get:
[Image: ?plugin=ref&serial=76]


0x11EAD8: Effect control code pointer
0x100000-0x1097FF Effect control codes
Multiply magic graphic data effect number by 2 and add 100000 to get the
control code offset.

Code:
Example: Effect 0C1
C1 * 2 + 11EAD8 = 11EC5A
11EC5A's value is 2A 5D, so the control code location beginst at 5D2A + 100000 = 105D2A

The control codes' details are mostly unknown:

C9 xx Play effect sound (takes precedence over that set in the magic graphics. 00 for none).
8B xx Use up to the XX-th frame of the animation pattern (starts from 00).
89 xx Pause xx units of time.


RE: Spell Graphics Document - Gi Nattak - 03-02-2011

Oh wow, this is fascinating stuff. The Japanese Log Translated was one of the funniest reads I ever read, also XD.

SHALL: "Can I be useful?"
Graham Smith: "With translating my game?" Laugh


RE: Spell Graphics Document - Zeemis - 03-02-2011

Lol.
Here is more stuff, maybe DJinn can translate some of it for us.
http://www9.atwiki.jp/ffbin/pages/26.html



If we can get this translated so that it's understandable, I'm going ham all over FFVI with custom animations.
This guys entire site is an encyclopedia of knowledge for hacking Final Fantasy VI.


RE: Spell Graphics Document - Gi Nattak - 03-02-2011

(03-02-2011, 06:52 PM)Zεεຕใร Wrote: This guys entire site is an encyclopedia of knowledge for hacking Final Fantasy VI.

Yeah, you're not kidding! Even with Google Chrome's piss poor translation I can see and learn a bunch of stuff from there. Actually, its not that bad at translating, I'm surprised. There's even more detailed explanations about the music control code, which is always nice. What a great find, I'm exited! Time to start copy and pasting into a doc I can print out and read Wink


RE: Spell Graphics Document - Zeemis - 03-02-2011

I hope that Djinn decides to translate a few of his documents, specifically Spell Animations and Music importing.
--------
First off, the Japanese offsets are different than that of the English offsets in Final Fantasy VI. Refer to this for the correct spell offsets.
http://mnrogar.slickproductions.org/hacking/spell_graphics_data.txt

Just by viewing the translation, I'm starting to grasp the concept. He talks about Fire and what the effects are. "???" is Byte 10, as FF3usME tells us.
[Image: imgshk.png]


From viewing the translation, I believe the first two bits "C1" and "00", as well as most of the other "FF's" are bits that call an animation. This much we know. I need to find out how these bits are related to an offset which pertains to the actual animation. If I can do that, I may be able to start somewhere.
The actual fire spells graphics start at somewhere around 132F00. I believe that's the exact offset in YY-CHR. 3BPP SNES.


RE: Spell Graphics Document - DjinnAndTonic - 03-02-2011

I clicked on the page you linked to... it looks like you already translated all of it? (And it looks like it was information that we already knew?)

Point me in a more specific direction and maybe I can translate something new for you?


RE: Spell Graphics Document - Zeemis - 03-02-2011

Can you do this?
http://www9.atwiki.jp/ffbin/pages/13.html

Is the translation 100% accurate on the spell animations?


RE: Spell Graphics Document - DjinnAndTonic - 03-03-2011

Okay, I can look at the sound effects thing when I have time. It looks pretty difficult to translate honestly, since I don't know any of the -English- terms for the sound information... But I'll give it a shot.

As for the accuracy of the Spell Graphics document, it looks correct to me from a quick glance, but if there's a particular part that you're having trouble understanding, I can look closer at it.


RE: Spell Graphics Document - Zeemis - 03-03-2011

After reading this for awhile, I'm starting to understand it. It's very complicated.


RE: Spell Graphics Document - madsiur - 01-20-2013

Necropost.

Zeemis, is your first post an accurate translation of the japanese web page ? Also, what is a chip (and chipset)?

I also noticed that the second byte of effect number 1 (byte 1) can have bit 7 set (0x80), for some blitzes and swtech, which is omitted in your 1st post.

Any idea what it does?