Author Topic: Item data format.  (Read 7553 times)

Akari

  • *
  • Posts: 766
    • View Profile
Item data format.
« on: 2007-02-13 06:56:20 »
I work on Item data from kernel recently.
Here is some info I found.

Every Item record is 28 bytes long.

First 8 byte are always 0xFF

Next two bytes looks like animation data (camera distance or something like that). Don't know for sure.

After that are 2 bytes Restriction mask

Code: [Select]
0xFEFF Battle Appear
0xFDFF Battle Use
0xFBFF Item Use

After that are 1 byte Target mask

Code: [Select]
0x00 Unselectable Self
0x01 Selectable
0x02 Enemy By Default
0x04 Target All
0x08 Can Select Target One/All (if selectable enabled)
0x10 Only Party Target
0x20 ???
0x40 Hits Everyone
0x80 Random Target

After that are 1 byte Animation Id.

After that are Formula that will be used to calculate damage/restore.
Does anyone have this formula documented? It's pretty much shared between attacks magics and all other damade/restore dealing things. I found only very few of them =(

Next are 1 byte variable to that formula.

Next are restore type. It's not only restore HP/MP but shows stat window. If set to 0x03-0xFE - it shows blank window.

Code: [Select]
0x00 - HP Data
0x01 - MP Data
0x02 - Status Data
0xFF - None

Next are 1 byte status inflict/restore chance

Code: [Select]
0x00 - 0x3F Chance Add Status
0x40 - 0x7F Chance Remove Status
0x92        Toggle On/Off
0xFF        None

Next two bytes has something to do with special effects. It is set only to Stardust (0x0004), Smoke Bomb (0x05FF), Hero Drink (0x1582). Do not know anything about it =(

Next 4 bytes are status mask for restore/inflict status.


Code: [Select]
0x00000001 Death
0x00000002 Near-Death
0x00000004 Sleep
0x00000008 Poison
0x00000010 Sadness
0x00000020 Fury
0x00000040 Confusion
0x00000080 Silence
0x00000100 Haste
0x00000200 Slow
0x00000400 Stop
0x00000800 Frog
0x00001000 Small
0x00002000 Slow-numb
0x00004000 Petrify
0x00008000 Regen
0x00010000 Barrier
0x00020000 MBarrier
0x00040000 Reflect
0x00080000 Unused
0x00100000 Shield
0x00200000 D.Sentence
0x00400000 Manipulate
0x00800000 Berserk
0x01000000 Peerless
0x02000000 Paralyzed
0x04000000 Darkness
0x08000000 Dual
0x10000000 DeathForce
0x20000000 Resist
0x40000000 Lucky Girl
0x80000000 Imprisoned

Next two bytes are elemental mask.

Code: [Select]
0x0000 Non Elemental
0x0001 Fire
0x0002 Ice
0x0004 Lightning
0x0008 Earth
0x0010 Poison
0x0020 Gravity
0x0040 Water
0x0080 Wind
0x0100 Holy
0x0200 Restorative
0x0400 Cut
0x0800 Hit
0x1000 Punch
0x2000 Shoot
0x4000 Shout

And last two bytes are mask for some special atributes.

Code: [Select]
0x0001 Attack MP instead of HP
0x0002 ?
0x0004 ?
0x0008 ?
0x0010 Drain Damage Dealt
0x0020 Drain HP/MP
0x0040 Blade Beam
0x0080 Ignore Status
0x0100 Miss if Not in “Death” Status
0x0200 Reflectable
0x0400 Piercing (Unblockable)
0x0800 Angel Whisper/Pulse of Life
0x1000 ?
0x2000 Critical Hits
0x4000 ?
0x8000 ?

Terence Fergusson seems can help here since his THE FF7 PARTY MECHANICS have a lot of data. Maybe someone else can help to fill blank parts in item description?

Squall78

  • *
  • Posts: 130
    • View Profile
Re: Item data format.
« Reply #1 on: 2008-02-16 08:40:09 »
Hi Akari

I was reading your item description and the one on QhimmWiki and I have a question :

Quote from: Akari
0x00 Unselectable Self
0x01 Selectable
0x02 Enemy By Default
0x04 Target All
0x08 Can Select Target One/All (if selectable enabled)
0x10 Only Party Target
0x20 ? ? ?
0x40 Hits Everyone
0x80 Random Target

Quote from: QhimmWiki
0x01    One Target
0x03    Unknown
0x05    Multiple Targets
0x07    Unknown
0x10    On Party Only

The Megalixir target mask is 0x05. It could be 0x04 + 0x01 which means Selectable + Target all but Megalixir does not allow us to select the target (only tagetting all).
And I didn't found any 0x04 targat mask in the items.

So how did you find this ?
« Last Edit: 2008-02-16 08:43:37 by Squall78 »

Ragna

  • *
  • Posts: 266
    • View Profile
Re: Item data format.
« Reply #2 on: 2008-02-16 09:21:19 »
Yeah, I were gonna ask the same. O.o
Also, isn't there information about items ID sorting (name, type, +, -, etc.)?  :?

I thought it was in the kernel... ._.U
« Last Edit: 2008-02-16 09:34:23 by Henkäys Ikuisuudesta »

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Item data format.
« Reply #3 on: 2008-02-16 10:42:49 »
Not quite sure about Megalixir, but doesn't it allow to select your enemies instead of your party? That way you can select all your party members or all your enemies. Looks like a choice to me :P

Squall78

  • *
  • Posts: 130
    • View Profile
Re: Item data format.
« Reply #4 on: 2008-02-16 10:52:58 »
Haaa you right dziugo :) Indeed. I was thinking about only the Item menu... Thanks for your remark :)

Squall78

  • *
  • Posts: 130
    • View Profile
Re: Item data format.
« Reply #5 on: 2008-02-16 14:34:26 »
Another question :)

The Restriction Mask is :
FEFF : Battle appear    ====> 11111110    in binary
FDFF : Battle use        ====> 11111101    in binary
FBFF : Item menu use ====> 11111011    in binary

I've a problem with the "battle appear" value. I've tested on the Potion item but it does not work... On the Zeio nut too... the default value is 11111110 (so it should not appear in battle) but Zeio nut appears in battle item menu...

Why ?

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Item data format.
« Reply #6 on: 2008-02-16 15:46:31 »
You got that the other way around:
If the LSB is set, item won't appear in battle, if it's cleared (like in Zeio nut) it will appear.

Akari probably meant to use the restriction masks as follows:
Perform the logical AND (&) with
0xFE - and you'll get an item that appears in battle menu
0xFD - and you'll get an item that can be used in battle
0xFB - and you'll get an item that can be used in the menu
Perform the logical OR (|) with
~0xFE <-> 0x01 - and the item won't appear in battle menu
~0xFD <-> 0x02 - and the item won't be usable in battle
~0xFB <-> 0x04 - and the item won't be usable in the menu

So, if the bit is set, it would mean that some restriction exists.

Squall78

  • *
  • Posts: 130
    • View Profile
Re: Item data format.
« Reply #7 on: 2008-02-16 16:37:42 »
Sorry I made a mistake. I meant :

FEFF (1111111111111110) : item should appear in battle menu
FFFF (1111111111111111) : item should not appear in battle menu

I've put the value FFFF (1111111111111111) on the Potion, but it still appears in battle ???

On Zeio nut, the same thing :
default value (put by Square) is FEFF (1111111111111110) so the Zeio appears... I agree...
But if I replace this value by FFFF (1111111111111111) the Zeio still appears too...
« Last Edit: 2008-02-16 16:41:10 by Squall78 »

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Item data format.
« Reply #8 on: 2008-02-16 16:53:28 »
Can you change the item's targeting logic? For example, to change it, so the potion could be used on all party members. That way we would know that the editing itself is successful.

Squall78

  • *
  • Posts: 130
    • View Profile
Re: Item data format.
« Reply #9 on: 2008-02-16 16:55:09 »
Yes I've begun to write a little program which edits some features of items. I've changed Amount multiplier, Target mask, etc...
That why I don't understand.

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Item data format.
« Reply #10 on: 2008-02-16 17:20:34 »
Can't really help you without FF7 installed. It was confirmed by at least 2 people, so I can't believe it's not right.

Akari

  • *
  • Posts: 766
    • View Profile
Re: Item data format.
« Reply #11 on: 2008-02-16 19:10:07 »
Wow... one year topic resurection.
It is a very old data. In the middle of summer I was reversing battle algorithm for a few weeks. I found a lot of inner things, but it is not completed yet.

This things was posted based on modifying ram and seeing what happenes. It is not based on actual reversing so it is not accurate. You can post here addition to this data. It may help when I get back to reversing battle.