Difference between revisions of "FF7/Battle/Battle Mechanics"

From Final Fantasy Inside
< FF7‎ | Battle
Jump to navigation Jump to search
my_wiki>NFITC1
(Actor Battle Data)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
This page will be for Battle memory structures. This is consistent with the memory structure of the PC version. PSX may or may not reflect these structures.
 
This page will be for Battle memory structures. This is consistent with the memory structure of the PC version. PSX may or may not reflect these structures.
  
==Command Defaults==
+
== Command Defaults ==
 +
 
 
Each command type has default execution values that can, in some cases, be overridden. These come from a hard-coded structure in the executable.
 
Each command type has default execution values that can, in some cases, be overridden. These come from a hard-coded structure in the executable.
  
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
+
{| class="wikitable"
! style="background:rgb(204,204,204)" align="center" | Offset
+
! Offset
! style="background:rgb(204,204,204)" | Default
+
! Default
 
|-
 
|-
 
| 0h
 
| 0h
Line 16: Line 17:
 
| 2h
 
| 2h
 
| Command Properties
 
| Command Properties
|-
 
 
|}
 
|}
  
==Queued Actions==
+
== Queued Actions ==
When a command is selected either by a player character or an enemy the action gets queued in a FIFO structure while there are actions queued or one is being performed. Up to 64 actions can be queued.
 
  
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
+
When a command is selected either by a player character or an enemy the action is inserted into a priority queue. Up to 64 actions can be queued. On each update loop, the main Queue function will pop off the next action with the lowest priority and execute it in FIFO order within priority bands.
! style="background:rgb(204,204,204)" align="center" | Offset
+
 
! style="background:rgb(204,204,204)" | Value
+
Queue entries have the following structure in memory:
 +
 
 +
{| class="wikitable"
 +
! Offset
 +
! Value
 
|-
 
|-
 
| 0
 
| 0
| Command Index
+
| Action Priority (limits/counters 0, player chosen spells 6)
 
|-
 
|-
 
| 1
 
| 1
| Command's Actor
+
| Queue position within priority band
 
|-
 
|-
 
| 2
 
| 2
| Priority (4 - ??; 3 - Auto commands (Added Cut, Poison, Death Sentence, etc); 2 - Normal; 1 - ??; 0 - Counters and Limit Breaks)
+
| Attacker actor ID
 
|-
 
|-
 
| 3
 
| 3
| AI-related function parameter
+
| Action command index (e.g CMD_MAGIC = 0x02)
 
|-
 
|-
 
| 4
 
| 4
| Target Mask
+
| Action attack index (e.g Bolt = 0x21). (This index is absolute, not command relative)
 
|-
 
|-
 
| 6
 
| 6
| Action Index
+
| Action target mask
 
|}
 
|}
  
==AI Structure==
+
== AI Structure ==
 +
 
 
There is a single block of memory that holds AI information on the current running script. Each Actor "owns" this while their scripts are executing.
 
There is a single block of memory that holds AI information on the current running script. Each Actor "owns" this while their scripts are executing.
  
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
+
{| class="wikitable"
! style="background:rgb(204,204,204)" align="center" | Offset
+
! Offset
! style="background:rgb(204,204,204)" | Function
+
! Function
 
|-
 
|-
 
| 0h
 
| 0h
Line 96: Line 100:
 
| 7Ch - 27Ch
 
| 7Ch - 27Ch
 
| Stack of values
 
| Stack of values
|-
 
 
|}
 
|}
  
==Active Character Data==
+
== Active Character Data ==
This is an array that each playable character maintains an instance of. (These addresses are off)
 
  
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
+
This is an array that each playable character maintains an instance of.
! style="background:rgb(204,204,204)" align="center" | Offset
+
 
! style="background:rgb(204,204,204)" colspan=2 | Value
+
{| class="wikitable"
 +
! Offset
 +
! style="background: rgb(204,204,204)" colspan="2" | Value
 
|-
 
|-
 
| 000h
 
| 000h
| colspan=2 | Character ID
+
| colspan="2" | Character ID
 
|-
 
|-
 
| 001h
 
| 001h
| colspan=2 | Cover Chance
+
| colspan="2" | Cover Chance
 
|-
 
|-
 
| 002h
 
| 002h
| colspan=2 | Strength
+
| colspan="2" | Strength
 
|-
 
|-
 
| 003h
 
| 003h
| colspan=2 | Vitality
+
| colspan="2" | Vitality
 
|-
 
|-
 
| 004h
 
| 004h
| colspan=2 | Magic
+
| colspan="2" | Magic
 
|-
 
|-
 
| 005h
 
| 005h
| colspan=2 | Spirit
+
| colspan="2" | Spirit
 
|-
 
|-
 
| 006h
 
| 006h
| colspan=2 | Speed
+
| colspan="2" | Speed
 
|-
 
|-
 
| 007h
 
| 007h
| colspan=2 | Luck
+
| colspan="2" | Luck
 
|-
 
|-
 
| 008h
 
| 008h
| colspan=2 | Phys Attack
+
| colspan="2" | Phys Attack
 
|-
 
|-
 
| 00Ah
 
| 00Ah
| colspan=2 | Phys Def
+
| colspan="2" | Phys Def
 
|-
 
|-
 
| 00Ch
 
| 00Ch
| colspan=2 | Mag Attack
+
| colspan="2" | Mag Attack
 
|-
 
|-
 
| 00Eh
 
| 00Eh
| colspan=2 | Mag Def
+
| colspan="2" | Mag Def
 
|-
 
|-
 
| 010h
 
| 010h
| colspan=2 | Current HP
+
| colspan="2" | Current HP
 
|-
 
|-
 
| 012h
 
| 012h
| colspan=2 | Max HP
+
| colspan="2" | Max HP
 
|-
 
|-
 
| 014h
 
| 014h
| colspan=2 | Current MP
+
| colspan="2" | Current MP
 
|-
 
|-
 
| 016h
 
| 016h
| colspan=2 | Max MP
+
| colspan="2" | Max MP
 
|-
 
|-
 
| 018h
 
| 018h
| colspan=2 | Timer
+
| colspan="2" | Timer
 
|-
 
|-
| 01Ah
+
| 01Ch
| colspan=2 | Counter Attack Action Index
+
| colspan="2" | Counter Attack Action Index
 
|-
 
|-
| 01Ch
+
| 01Eh
| colspan=2 | Counter Attack Chance
+
| colspan="2" | Counter Attack Chance
 
|-
 
|-
 
| 021h
 
| 021h
| colspan=2 | Some sort of divisor
+
| colspan="2" | Some sort of divisor?
 
|-
 
|-
| 022h
+
| 023h
| colspan=2 | Character Flags (Underwater, Long Range, HP<->MP, etc)
+
| colspan="2" | Character Flags (Underwater, Long Range, HP&lt;-&gt;MP, etc)
 
|-
 
|-
| 023h
+
| 024h
| colspan=2 | Eight entries of three bytes...
+
| colspan="2" | Eight entries of three bytes...
 
|-
 
|-
 
| 03Ch
 
| 03Ch
| colspan=2 | Attacking Elements
+
| colspan="2" | Attacking Elements
 
|-
 
|-
 
| 03Eh
 
| 03Eh
| colspan=2 | Halved Elements
+
| colspan="2" | Halved Elements
 
|-
 
|-
 
| 040h
 
| 040h
| colspan=2 | Nullified Elements
+
| colspan="2" | Nullified Elements
 
|-
 
|-
 
| 042h
 
| 042h
| colspan=2 | Absorbed Elements
+
| colspan="2" | Absorbed Elements
 
|-
 
|-
 
| 044h
 
| 044h
| colspan=2 | Attacking Elements
+
| colspan="2" | Attacking Elements
 
|-
 
|-
| 046h
+
| 048h
| colspan=2 | Self Mask as a DWord
+
| colspan="2" | Immune Statuses
 
|-
 
|-
| 04Ah
+
| 04Ch
| colspan=2 | Immune Statuses
+
| colspan="2" | Enabled Command Menu (16 entries of 6 bytes)
|-
 
| 04Eh
 
| colspan=2 | Enabled Command Menu (16 entries of 6 bytes)
 
 
|-
 
|-
 
| 0ACh
 
| 0ACh
| colspan=2 | Limit Actions for current Limit Level
+
| colspan="2" | Limit Actions for current Limit Level
 
|-
 
|-
| 0B8h
+
| 0B4h
| colspan=2 | Enabled Limit Data (three entries in Attack Data format)
+
| colspan="2" | Enabled Limit Data (three entries in Attack Data format(0x1C))
 
|-
 
|-
| 10Ch
+
| 108h
| colspan=2 | Enabled Magics (54 entries of 8 bytes)
+
| colspan="2" | Enabled Magics (54 entries of 8 bytes)
 
|-
 
|-
| style="background:rgb(204,204,255)" rowspan=7 |
+
| style="background: rgb(204,204,255)" rowspan="7" |
 
| 0
 
| 0
 
| Magic Index
 
| Magic Index
Line 227: Line 228:
 
| Properties
 
| Properties
 
|-
 
|-
| 2CCh
+
| 2C8h
| colspan=2 | Enabled Summons (format like above)
+
| colspan="2" | Enabled Summons (format like above)
 
|-
 
|-
| 32Ch
+
| 348h
| colspan=2 | Enabled ESkills (format like above)
+
| colspan="2" | Enabled ESkills (format like above)
 
|-
 
|-
| 40Ch
+
| 408h
| colspan=2 | First 11 bytes of Weapon Data
+
| colspan="2" | First 11 bytes of Weapon Data
 +
|-
 +
| 40Dh
 +
| colspan="2" | Status of weapon added to Attacking Statuses above
 +
|-
 +
| 410h
 +
| colspan="2" | Weapon's Accuracy
 +
|-
 +
| 418h
 +
| colspan="2" | Additional Attack Elements
 
|-
 
|-
 
| 41Ch
 
| 41Ch
| colspan=2 | Elements added to Attacking Elements above
+
| colspan="2" | Four sets of two DWords : (Stat to increase, Increase value)
|-
 
| 420h
 
| colspan=2 | Four sets of two DWords : (Stat to increase, Increase value)
 
 
|-
 
|-
 
| 43Ch
 
| 43Ch
| colspan=2 | Gil Bonus granted by this character
+
| colspan="2" | Gil Bonus granted by this character
 
|-
 
|-
 
| 43Dh
 
| 43Dh
| colspan=2 | Encounter rate ""
+
| colspan="2" | Encounter rate ""
 
|-
 
|-
 
| 43Eh
 
| 43Eh
| colspan=2 | Chocobo Chance ""
+
| colspan="2" | Chocobo Chance ""
 
|-
 
|-
 
| 43Fh
 
| 43Fh
| colspan=2 | PreEmptive Chance ""
+
| colspan="2" | PreEmptive Chance ""
|-
 
 
|}
 
|}
  
==Actor Battle Data==
+
== Actor Battle Data ==
 +
 
 
Similar to Active Character Data, but more detailed. This data is dependent on who is performing the current action and only one instance of it exists during each action and all stats are relative to the performing actor and current action unless otherwise noted. Addresses 200h and above will change for each target of the action.
 
Similar to Active Character Data, but more detailed. This data is dependent on who is performing the current action and only one instance of it exists during each action and all stats are relative to the performing actor and current action unless otherwise noted. Addresses 200h and above will change for each target of the action.
  
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
+
{| class="wikitable"
! style="background:rgb(204,204,204)" align="center" | Offset
+
! Offset
! style="background:rgb(204,204,204)" colspan = 2 | Value
+
! style="background: rgb(204,204,204)" colspan="2" | Value
 
|-
 
|-
 
| 0h
 
| 0h
| colspan = 2 | Index
+
| colspan="2" | Index
 
|-
 
|-
 
| 4h
 
| 4h
| colspan = 2 | Level
+
| colspan="2" | Level
 
|-
 
|-
 
| 8h
 
| 8h
| colspan = 2 | Formation Entry (Enemy A, Enemy B, etc)
+
| colspan="2" | Formation Entry (Enemy A, Enemy B, etc)
 
|-
 
|-
 
| 0Ch
 
| 0Ch
| colspan = 2 | Command Index
+
| colspan="2" | Command Index
 
|-
 
|-
 
| 10h
 
| 10h
| colspan = 2 | Action Index
+
| colspan="2" | Action Index
 
|-
 
|-
 
| 14h
 
| 14h
| colspan = 2 | Action Animation Base (for relative to absolute animation indexes)
+
| colspan="2" | Action Animation Base (for relative to absolute animation indexes)
 
|-
 
|-
 
| 18h
 
| 18h
| colspan = 2 | Allowed Targets (Active and targetable)
+
| colspan="2" | Allowed Targets (Active and targetable)
 
|-
 
|-
 
| 1Ch
 
| 1Ch
| colspan = 2 | Active Allies?
+
| colspan="2" | Active Allies?
 
|-
 
|-
 
| 20h
 
| 20h
| colspan = 2 | Command Animation (player characters only)
+
| colspan="2" | Command Animation (player characters only)
 
|-
 
|-
 
| 24h
 
| 24h
| colspan = 2 | [[FF7/Battle/Attack Effect Id List|Attack Effect]]
+
| colspan="2" |
 +
[[FF7/Battle/Attack_Effect_Id_List|Attack Effect]]
 
|-
 
|-
 
| 28h
 
| 28h
| colspan = 2 | Command Index (again)
+
| colspan="2" | Command Index (again)
 
|-
 
|-
 
| 2Ch
 
| 2Ch
| colspan = 2 | Action Index (again)
+
| colspan="2" | Action Index (again)
 
|-
 
|-
 
| 30h
 
| 30h
| colspan = 2 | Self Mask
+
| colspan="2" | Self Mask
 
|-
 
|-
 
| 38h
 
| 38h
| colspan = 2 | MP Cost
+
| colspan="2" | MP Cost
 
|-
 
|-
 
| 3Ch
 
| 3Ch
| colspan = 2 | Action Accuracy
+
| colspan="2" | Action Accuracy
 
|-
 
|-
 
| 40h
 
| 40h
| colspan = 2 | [[FF7/Battle/Damage Calculation|Damage Calculation]]
+
| colspan="2" |
 +
[[FF7/Battle/Damage_Calculation|Damage Calculation]]
 
|-
 
|-
 
| 44h
 
| 44h
| colspan = 2 | [[FF7/Battle/Elemental Data|Action's Element]]
+
| colspan="2" |
 +
[[FF7/Battle/Elemental_Data|Action's Element]]
 
|-
 
|-
 
| 48h
 
| 48h
| colspan = 2 | Action's Power
+
| colspan="2" | Action's Power
 
|-
 
|-
 
| 4Ch
 
| 4Ch
| colspan = 2 | Phys/Mag Attack Power
+
| colspan="2" | Phys/Mag Attack Power
 
|-
 
|-
 
| 50h
 
| 50h
| colspan = 2 | Action's Target(s) Mask
+
| colspan="2" | Action's Target(s) Mask
 
|-
 
|-
 
| 54h
 
| 54h
| colspan = 2 | Normal Impact Sound
+
| colspan="2" | Normal Impact Sound
 
|-
 
|-
 
| 58h
 
| 58h
| colspan = 2 | Critical Impact Sound
+
| colspan="2" | Critical Impact Sound
 
|-
 
|-
 
| 5Ch
 
| 5Ch
| colspan = 2 | Miss Sound
+
| colspan="2" | Miss Sound
 
|-
 
|-
 
| 60h
 
| 60h
| colspan = 2 | Single Target Camera
+
| colspan="2" | Single Target Camera
 
|-
 
|-
 
| 64h
 
| 64h
| colspan = 2 | Multi Target Camera
+
| colspan="2" | Multi Target Camera
 
|-
 
|-
 
| 68h
 
| 68h
| colspan = 2 | Action Reaction Animation Index
+
| colspan="2" | Action Reaction Animation Index
 
|-
 
|-
 
| 6Ch
 
| 6Ch
| colspan = 2 | [[FF7/Battle/Attack_Special_Effects|Attack Special Effects]]
+
| colspan="2" |
 +
[[FF7/Battle/Attack_Special_Effects|Attack Special Effects]]
 
|-
 
|-
 
| 78h
 
| 78h
| colspan = 2 | Non-self target mask?
+
| colspan="2" | Non-self target mask?
 
|-
 
|-
 
| 80h
 
| 80h
| colspan = 2 | [[FF7/Battle/Status Effects|Inflicting Status(es)]]
+
| colspan="2" |
 +
[[FF7/Battle/Status_Effects|Inflicting Status(es)]]
 
|-
 
|-
 
| 84h
 
| 84h
| colspan = 2 | [[FF7/Battle/Status Effects|Curing Status(es)]]
+
| colspan="2" |
 +
[[FF7/Battle/Status_Effects|Curing Status(es)]]
 
|-
 
|-
 
| 88h
 
| 88h
| colspan = 2 | [[FF7/Battle/Status Effects|Toggling Status(es)]]
+
| colspan="2" |
 +
[[FF7/Battle/Status_Effects|Toggling Status(es)]]
 
|-
 
|-
 
| 8Ch
 
| 8Ch
| colspan = 2 | Chance to inflict Status
+
| colspan="2" | Chance to inflict Status
 
|-
 
|-
 
| 90h
 
| 90h
| colspan = 2 | Command Properties (details pending)
+
| colspan="2" | Command Properties (details pending)
 
|-
 
|-
 
| 94h
 
| 94h
| colspan = 2 | Target Mask
+
| colspan="2" | Target Mask
 
|-
 
|-
 
| 98h
 
| 98h
| colspan = 2 | Attack Index position in scene data (enemy only)
+
| colspan="2" | Attack Index position in scene data (enemy only)
 
|-
 
|-
 
| A0h
 
| A0h
| colspan = 2 | Action Accuracy function (upper nybble of [[FF7/Battle/Damage Calculation|Damage Calculation]])
+
| colspan="2" |
 +
Action Accuracy function (upper nybble of [[FF7/Battle/Damage_Calculation|Damage Calculation]])
 
|-
 
|-
 
| A4h
 
| A4h
| colspan = 2 | Action Damage function (lower nybble of [[FF7/Battle/Damage Calculation|Damage Calculation]])
+
| colspan="2" |
 +
Action Damage function (lower nybble of [[FF7/Battle/Damage_Calculation|Damage Calculation]])
 
|-
 
|-
 
| ACh
 
| ACh
| colspan = 2 | Quad Magic Count?
+
| colspan="2" | Quad Magic Count?
 
|-
 
|-
 
| B0h
 
| B0h
| colspan = 2 | Number of attack damage calculations?
+
| colspan="2" | Number of attack damage calculations?
 
|-
 
|-
 
| B4h
 
| B4h
| colspan = 2 | Follow-up action count (Tifa's Limits, Finishing Touch, etc)
+
| colspan="2" | Follow-up action count (Tifa's Limits, Finishing Touch, etc)
 
|-
 
|-
 
| B8h
 
| B8h
| colspan = 2 | Number of Targets?
+
| colspan="2" | Number of Targets?
 
|-
 
|-
 
| BCh
 
| BCh
| colspan = 2 | [[FF7/Battle/Attack_Special_Effects|Attack Additional Effects]]
+
| colspan="2" |
 +
[[FF7/Battle/Attack_Special_Effects|Attack Additional Effects]]
 
|-
 
|-
 
| C0h
 
| C0h
| colspan = 2 | Additional Effect Modifier
+
| colspan="2" | Additional Effect Modifier
 
|-
 
|-
 
| C4h
 
| C4h
| colspan = 2 | Attack Power
+
| colspan="2" | Attack Power
 
|-
 
|-
 
| C8h
 
| C8h
| colspan = 2 | Actor's current status
+
| colspan="2" | Actor's current status
 
|-
 
|-
 
| D0h - D7h
 
| D0h - D7h
| colspan = 2 | Follow-up Action(s)
+
| colspan="2" | Follow-up Action(s)
 
|-
 
|-
 
| D8h
 
| D8h
| colspan = 2 | Actor's Strength
+
| colspan="2" | Actor's Strength
 
|-
 
|-
 
| DCh
 
| DCh
| colspan = 2 | Used during String display?
+
| colspan="2" | Used during String display?
 
|-
 
|-
 
| E0h
 
| E0h
| colspan = 2 | Number of successful hits
+
| colspan="2" | Number of successful hits
 
|-
 
|-
 
| F0h
 
| F0h
| colspan = 2 | Character-specific action properties (mp absorb, hp absorb, etc)
+
| colspan="2" | Character-specific action properties (mp absorb, hp absorb, etc)
 
|-
 
|-
 
| F8h
 
| F8h
| colspan = 2 | Related to enabled magic. Also ACh above.
+
| colspan="2" | Related to enabled magic. Also ACh above.
 
|-
 
|-
 
| FCh
 
| FCh
| colspan = 2 | Multiple hit count
+
| colspan="2" | Multiple hit count
 
|-
 
|-
 
| 100h - 1FFh
 
| 100h - 1FFh
| colspan = 2 | large unused gap
+
| colspan="2" | large unused gap
 
|-
 
|-
 
| 200h
 
| 200h
| colspan = 2 | ???
+
| colspan="2" | ???
 
|-
 
|-
 
| 204h
 
| 204h
| colspan = 2 | Character Map (players only)
+
| colspan="2" | Character Map (players only)
 
|-
 
|-
 
| 208h
 
| 208h
| colspan = 2 | Current Target Index
+
| colspan="2" | Current Target Index
 
|-
 
|-
 
| 20Ch
 
| 20Ch
| colspan = 2 | Formation Slot
+
| colspan="2" | Formation Slot
 
|-
 
|-
 
| 210h
 
| 210h
| colspan = 2 | Target's Phys/Mag Def (whichever attack type is)
+
| colspan="2" | Target's Phys/Mag Def (whichever attack type is)
 
|-
 
|-
 
| 214h
 
| 214h
| colspan = 2 | Damage done to target
+
| colspan="2" | Damage done to target
 
|-
 
|-
 
| 218h
 
| 218h
| colspan = 2 | Properties of attack
+
| colspan="2" | Properties of attack
 
|-
 
|-
| style="background:rgb(204,204,255)" rowspan = 8 |
+
| style="background: rgb(204,204,255)" rowspan="8" |
 
| 1
 
| 1
 
| missed
 
| missed
Line 469: Line 486:
 
|-
 
|-
 
| 220h
 
| 220h
| colspan = 2 | More properties (heal, critical, damage MP, etc)
+
| colspan="2" | More properties (heal, critical, damage MP, etc)
 
|-
 
|-
 
| 224h
 
| 224h
| colspan = 2 | Target's reaction animation
+
| colspan="2" | Target's reaction animation
 
|-
 
|-
 
| 228h
 
| 228h
| colspan = 2 | Target's status
+
| colspan="2" | Target's status
 
|-
 
|-
 
| 22Ch
 
| 22Ch
| colspan = 2 | Target's status immunities
+
| colspan="2" | Target's status immunities
 
|-
 
|-
 
| 230h
 
| 230h
| colspan = 2 | Damage level to current Action
+
| colspan="2" | Damage level to current Action
 
|-
 
|-
| style="background:rgb(204,204,255)" rowspan = 8 |
+
| style="background: rgb(204,204,255)" rowspan="8" |
 
| 1
 
| 1
 
| Death (if not immune)
 
| Death (if not immune)
Line 491: Line 508:
 
|-
 
|-
 
| 4
 
| 4
| Double (Damage & Accuracy)
+
| Double (Damage &amp; Accuracy)
 
|-
 
|-
 
| 8
 
| 8
Line 497: Line 514:
 
|-
 
|-
 
| 10
 
| 10
| Half (Damage & Accuracy)
+
| Half (Damage &amp; Accuracy)
 
|-
 
|-
 
| 20
 
| 20
Line 509: Line 526:
 
|-
 
|-
 
| 234h
 
| 234h
| colspan = 2 | Target condition flags (back exposed, multiple targets, etc)
+
| colspan="2" | Target condition flags (back exposed, multiple targets, etc)
 
|-
 
|-
 
| 238h
 
| 238h
| colspan = 2 | Status(es) to add to Target
+
| colspan="2" | Status(es) to add to Target
 
|-
 
|-
 
| 23Ch
 
| 23Ch
| colspan = 2 | Status(es) to Cure from Target
+
| colspan="2" | Status(es) to Cure from Target
 
|-
 
|-
 
| 240h
 
| 240h
| colspan = 2 | Status(es) to Toggle from Target
+
| colspan="2" | Status(es) to Toggle from Target
 
|-
 
|-
 
| 244h
 
| 244h
| colspan = 2 | All Target's statuses that will be affected from action
+
| colspan="2" | All Target's statuses that will be affected from action
 
|-
 
|-
 
| 248h
 
| 248h
| colspan = 2 | Sound to play (determined from hit/critical/miss sounds above)
+
| colspan="2" | Sound to play (determined from hit/critical/miss sounds above)
 
|-
 
|-
 
| 24Ch
 
| 24Ch
| colspan = 2 | Action Animation to use (varies from single/multiple targets)
+
| colspan="2" | Action Animation to use (varies from single/multiple targets)
 
|-
 
|-
 
| 254h
 
| 254h
| colspan = 2 | Target's Level
+
| colspan="2" | Target's Level
 
|-
 
|-
 
| 258h
 
| 258h
| colspan = 2 | Target's HP
+
| colspan="2" | Target's HP
 
|-
 
|-
 
| 25Ch
 
| 25Ch
| colspan = 2 | Target's MP
+
| colspan="2" | Target's MP
 
|-
 
|-
 
| 260h
 
| 260h
| colspan = 2 | Action's final Accuracy
+
| colspan="2" | Action's final Accuracy
|-}
+
|}

Latest revision as of 00:56, 15 July 2019

This page will be for Battle memory structures. This is consistent with the memory structure of the PC version. PSX may or may not reflect these structures.

Command Defaults

Each command type has default execution values that can, in some cases, be overridden. These come from a hard-coded structure in the executable.

Offset Default
0h Animation
1h Damage Calculation
2h Command Properties

Queued Actions

When a command is selected either by a player character or an enemy the action is inserted into a priority queue. Up to 64 actions can be queued. On each update loop, the main Queue function will pop off the next action with the lowest priority and execute it in FIFO order within priority bands.

Queue entries have the following structure in memory:

Offset Value
0 Action Priority (limits/counters 0, player chosen spells 6)
1 Queue position within priority band
2 Attacker actor ID
3 Action command index (e.g CMD_MAGIC = 0x02)
4 Action attack index (e.g Bolt = 0x21). (This index is absolute, not command relative)
6 Action target mask

AI Structure

There is a single block of memory that holds AI information on the current running script. Each Actor "owns" this while their scripts are executing.

Offset Function
0h Actor Index
4h Script Position
8h Remaining Stack Space (initially 200h)
0Ch Current AI OpCode
10h OpCode Lower Nybble
14h OpCode Upper Nybble
18h First Group Type
1Ch Second Group Type
20h OpCode Lower Nybble (related to group 1?)
24h OpCode Lower Nybble (related to group 2?)
28h Mask of non-null values in Group 1
2Ah Mask of non-null values in Group 2
2Ch - 50h Group 1 of variables
54h - 78h Group 2 of variables
7Ch - 27Ch Stack of values

Active Character Data

This is an array that each playable character maintains an instance of.

Offset Value
000h Character ID
001h Cover Chance
002h Strength
003h Vitality
004h Magic
005h Spirit
006h Speed
007h Luck
008h Phys Attack
00Ah Phys Def
00Ch Mag Attack
00Eh Mag Def
010h Current HP
012h Max HP
014h Current MP
016h Max MP
018h Timer
01Ch Counter Attack Action Index
01Eh Counter Attack Chance
021h Some sort of divisor?
023h Character Flags (Underwater, Long Range, HP<->MP, etc)
024h Eight entries of three bytes...
03Ch Attacking Elements
03Eh Halved Elements
040h Nullified Elements
042h Absorbed Elements
044h Attacking Elements
048h Immune Statuses
04Ch Enabled Command Menu (16 entries of 6 bytes)
0ACh Limit Actions for current Limit Level
0B4h Enabled Limit Data (three entries in Attack Data format(0x1C))
108h Enabled Magics (54 entries of 8 bytes)
0 Magic Index
1h MP Cost
2h All Count
3h Quad Enabled?
4h Quad Count?
5h Target Data
6h Properties
2C8h Enabled Summons (format like above)
348h Enabled ESkills (format like above)
408h First 11 bytes of Weapon Data
40Dh Status of weapon added to Attacking Statuses above
410h Weapon's Accuracy
418h Additional Attack Elements
41Ch Four sets of two DWords : (Stat to increase, Increase value)
43Ch Gil Bonus granted by this character
43Dh Encounter rate ""
43Eh Chocobo Chance ""
43Fh PreEmptive Chance ""

Actor Battle Data

Similar to Active Character Data, but more detailed. This data is dependent on who is performing the current action and only one instance of it exists during each action and all stats are relative to the performing actor and current action unless otherwise noted. Addresses 200h and above will change for each target of the action.

Offset Value
0h Index
4h Level
8h Formation Entry (Enemy A, Enemy B, etc)
0Ch Command Index
10h Action Index
14h Action Animation Base (for relative to absolute animation indexes)
18h Allowed Targets (Active and targetable)
1Ch Active Allies?
20h Command Animation (player characters only)
24h

Attack Effect

28h Command Index (again)
2Ch Action Index (again)
30h Self Mask
38h MP Cost
3Ch Action Accuracy
40h

Damage Calculation

44h

Action's Element

48h Action's Power
4Ch Phys/Mag Attack Power
50h Action's Target(s) Mask
54h Normal Impact Sound
58h Critical Impact Sound
5Ch Miss Sound
60h Single Target Camera
64h Multi Target Camera
68h Action Reaction Animation Index
6Ch

Attack Special Effects

78h Non-self target mask?
80h

Inflicting Status(es)

84h

Curing Status(es)

88h

Toggling Status(es)

8Ch Chance to inflict Status
90h Command Properties (details pending)
94h Target Mask
98h Attack Index position in scene data (enemy only)
A0h

Action Accuracy function (upper nybble of Damage Calculation)

A4h

Action Damage function (lower nybble of Damage Calculation)

ACh Quad Magic Count?
B0h Number of attack damage calculations?
B4h Follow-up action count (Tifa's Limits, Finishing Touch, etc)
B8h Number of Targets?
BCh

Attack Additional Effects

C0h Additional Effect Modifier
C4h Attack Power
C8h Actor's current status
D0h - D7h Follow-up Action(s)
D8h Actor's Strength
DCh Used during String display?
E0h Number of successful hits
F0h Character-specific action properties (mp absorb, hp absorb, etc)
F8h Related to enabled magic. Also ACh above.
FCh Multiple hit count
100h - 1FFh large unused gap
200h ???
204h Character Map (players only)
208h Current Target Index
20Ch Formation Slot
210h Target's Phys/Mag Def (whichever attack type is)
214h Damage done to target
218h Properties of attack
1 missed
2 Physical if set; Magical if unset
4 Attempt Steal
20 Won't Miss
4000 Physical Barrier
8000 Magical Barrier
40000 ???
800000 ???
220h More properties (heal, critical, damage MP, etc)
224h Target's reaction animation
228h Target's status
22Ch Target's status immunities
230h Damage level to current Action
1 Death (if not immune)
2 Always hit?
4 Double (Damage & Accuracy)
8 Normal (Never checked)
10 Half (Damage & Accuracy)
20 Null (won't miss?)
40 Absorb (won't miss?)
80 Full-Heal
234h Target condition flags (back exposed, multiple targets, etc)
238h Status(es) to add to Target
23Ch Status(es) to Cure from Target
240h Status(es) to Toggle from Target
244h All Target's statuses that will be affected from action
248h Sound to play (determined from hit/critical/miss sounds above)
24Ch Action Animation to use (varies from single/multiple targets)
254h Target's Level
258h Target's HP
25Ch Target's MP
260h Action's final Accuracy