øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=945.msg9457e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index7ee8.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=945.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index7ee8.html.zxiˆg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0P]ΕOKtext/htmlISO-8859-1gzip8:ÖΕÿÿÿÿÿÿÿÿTue, 10 Mar 2020 12:46:56 GMT0ó°° ®0®P®€§²ð®hˆg^‰Ε Monster Data Code

Author Topic: Monster Data Code  (Read 1640 times)

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Monster Data Code
« on: January 27, 2009, 09:23:57 AM »
This code seems ok for the most part, yet the current docs JCE has is incomplete... (the editors are driving me nuts, so I'm trying to decypher the data myself for my own sake).

The Imp data has the following...

Code: [Select]
03 06 00 01 60 A0 02 78 00 00
So, it's clear that the following is true...

Byte 0 - Boss? and Level
Bit 0: Boss
Bit 1-7: Level (seems to go up to 127?, 99 is the known highest level)

Byte 1 and 2 (16-bit value) - HP

Note: Byte 1 and 2 make up a monster's entire HP... so in Hex, you might see (01 00), you should read it as (00 01) which means 1 HP. (00 10) -> (10 00) which means 32768 HP...

Byte 3 - Attack table index
Byte 4 - Defense table index
Byte 5 - Magic Defense table index

Note: The indexes are actually of the same table.

Byte 6 - Speed table index

Byte 7 - Item Drop info
Bit 0-1?: Drop frequency cipher (00 = 5%... the others I'm not sure of yet, but the other possibilities are 25%, 100%, and 0%)
Bit 2-7? - Drop table (determines what you get for a drop/steal)

Byte 8 - Attack Sequence index

Byte 9 - ?? It looks like some sort of "extra info" cipher. 00 = no extra info
Possible changes include: Elemental Attack, Status Attack (2 bytes) , Elemental Resistance, Status Resistance (2 bytes), Monster Race, Elemental Weakness, Magic Power (used like Wisdom and/or Will), Reflex/Counter table index (which shares with the Attack Sequence index data)

So.. if someone doesn't already have this documented (because, this is driving me nuts), please say so.

For the Basilisk..

Quote
05 5A 00 06 62 A6 06 4D 06 48 00 18 00 04

48 has to mean something... as the following code implies..

Resistance to Pig and Small (18)
Creature type = Reptile (04)

The extra 00 might mean something else...

 :edit:

The leading 00 = Elemental Resistance.
The second 00 = The second byte of the resistance table..

In the cypher, 0x48 implies..

Byte 0 - Elemental Resistance
Byte 1+2 - Status Resistance
Byte 3 - Monster Race

Ok, so now we goto the Eagle (skipping the other stuff and just posting the cypher and etc.)

Code: [Select]
60 00 38 00 20
In the cypher.. it seems a bit straight forward..

Resistance vs Toad, Mini, Small (38)
Weak vs Wind (20)

Editing the 00 data... I have determined the following..

Byte 0 - Elemental Resistance
Byte 1+2 - Status Resistance
Byte 3 - Elemental Weakness

In determining that, 0x48 and 0x60 share 0x40 (bitwise), therefore 0x40 implies Elemental and Status Resistance... and 0x20 implies elemental weakness and 0x08 implies racial property.. if I'm reading this correctly.

Larva

Code: [Select]
44 00 38 00 30
With what we know...

Resistances (38)
Counter Script (30)

Therefore 0x04 implies Counter script for Byte 3....

Treant...

Code: [Select]
74 00 38 00 01 02 15
First 00 - no resistance
(38 00) - Pig Small Toad resist
01 - weak vs Fire
15 - Counter script index

02 happens to be the monster's magic power

Therefore, 0x10 = Monster's spell power

Onto something more interesting..

Skull

Code: [Select]
E8 00 00 80 08 BF FC 91 80
first (00 80) = status attack
(08) = elemental resistance
(BF FC) = status resistances
(91) = weakness
second (80) = racial property

So, this implies the leading bit 0x80 is the elemental attack and status property... if I'm reading this correctly.

In summation:

0x80 = elemental attack (1 byte), then status attack (2 bytes)
0x40 = elemental resistance (1 byte), then status resistance (2 bytes)
0x20 = elemental weakness (1 byte)
0x10 = monster's magic power (1 byte)
0x08 = racial property (1 byte)
0x04 = counter script index (1 byte)
0x02 = unused???
0x01 = unused???

That should account for the extra 10 bytes in JCE's document.

If there are other cypher bites that I have missed, please let me know.
« Last Edit: January 27, 2009, 10:43:49 AM by Deathlike2 »
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: Monster Data Code
« Reply #1 on: January 27, 2009, 04:57:45 PM »
This has all been documented within the Tower of Bab-il documents. I've edited it a little bit, but here's mostly the original data, from the monsterdata.txt document:

Code: [Select]
Enemy stat data is stored from 72A60 to 738BF. Because the entries are of
variable length (explained below), a pointer table is necessary to tell the
game exactly where data for each type of enemy is. The pointer table is
located from 728A0 to 72A5F; each pointer is two bytes long. To find the
address, reverse the bytes and add 0x68200.

Each enemy's entry is at least ten bytes in size, but could be in theory up
to twenty bytes if all optional bytes were used. The first ten bytes always
have the same meaning. The meanings of any extra bytes are determined
by which bits are set in the tenth byte.

byte 00:
bit 7: boss bit (immunity to normal-enemy-only spells and status anomalies from hits)
bits 0-6: level
bytes 01-02: max HP
byte 03: physical attack table entry
byte 04: physical defense table entry
byte 05: magical defense table entry
byte 06:
bits 6-7: unused
bits 0-5: speed table entry
byte 07:
bits 6-7: item drop frequency
00: never
01: 5% chance
10: 25% chance
11: always
bits 0-5: item drop table entry
byte 08: attack sequence group
byte 09: "extra" byte
bit 7: attack status/elemental bytes used
bit 6: defense status/elemental bytes used
bit 5: elemental weakness byte used
bit 4: spell power byte used
bit 3: creature type byte used
bit 2: reflex attack sequence group byte used
bits 0-1: unused

================================================
Optional Bytes
================================================

Attack status/elemental bytes:
    byte 0: attack elementals
bit 7: force
bit 6: drain
bit 5: spears/arrows
bit 4: holy
bit 3: dark
bit 2: lightning
bit 1: ice
bit 0: fire
    byte 1: status inflicted by hit
bit 7: dead
bit 6: stone
bit 5: toad
bit 4: mini
bit 3: piggy
bit 2: mute
bit 1: blind
bit 0: poison
    byte 2: status inflicted by hit
bit 7: curse
bit 6: float
bit 5: paralyze
bit 4: sleep
bit 3: charm
bit 2: berserk
bit 1: petrify (2/3 petrified)
bit 0: d (1/3 petrified)
Defense status/elemental bytes:
    byte 0: elemental resistance (damage x1/2)
bit 7: immune (including to force)
bit 6: absorb (also resists drain)
bit 5: spears/arrows
bit 4: holy
bit 3: dark
bit 2: lightning
bit 1: ice
bit 0: fire
    byte 1: status immunity
bit 7: dead
bit 6: stone
bit 5: toad
bit 4: mini
bit 3: piggy
bit 2: mute
bit 1: blind
bit 0: poison (this doesn't seem to work properly for some reason)
    byte 2: status immunity
bit 7: curse
bit 6: float
bit 5: paralyze
bit 4: sleep
bit 3: charm
bit 2: berserk
bit 1: petrify (2/3 petrified)
bit 0: d (1/3 petrified)
Weakness (damage x2) byte:
bit 7: susceptible (damage x4, including from force)
bit 6: drain
bit 5: spears/arrows (add immunity to quake)
bit 4: holy
bit 3: dark
bit 2: lightning
bit 1: ice
bit 0: fire
Creature type byte:
bit 7: undead (reverses cure effects, immune to instant death spells)
bit 6: mage
bit 5: slime
bit 4: giant
bit 3: spirit (immune to instant death spells)
bit 2: reptile
bit 1: machine (immune to instant death spells)
bit 0: dragon
Reflex action byte: References Attack Sequence Data index

:edit:
Also, 0x1000 = 4092, not 32768
« Last Edit: January 27, 2009, 05:29:34 PM by Phoenix »

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Monster Data Code
« Reply #2 on: January 27, 2009, 06:24:35 PM »
After all the fustration with the editor, I'm just happy I took some time to learn the damned data.  :tongue:
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3