FF7/Battle/Battle Mechanics

From Final Fantasy Inside
< FF7‎ | Battle
Revision as of 23:21, 17 September 2013 by my_wiki>NFITC1

This page will be for Battle memory structures. May be pretty unstructured for a while.

Contents

Command Defaults

Each command type has default execution values that can, in some cases, be overridden.

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 gets queued in a FIFO structure while there are actions queued or one is being performed. Up to 64 actions can be queued. This does not contain Counter Attacks or Limit Breaks.

Offset Value
0 Command Index
1 Command's Actor
2 Unknown
3 AI-related function parameter
4 Target Mask
6 Action Index


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. (These addresses are off)

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
01Ah Counter Attack Action Index
01Ch Counter Attack Chance
021h Some sort of divisor
022h Character Flags (Underwater, Long Range, HP<->MP, etc)
023h Eight entries of three bytes...
03Ch Attacking Elements
03Eh Halved Elements
040h Nullified Elements
042h Absorbed Elements
044h Attacking Elements
046h Self Mask as a DWord
04Ah Immune Statuses
04Eh Enabled Command Menu (16 entries of 6 bytes)
0ACh Limit Actions for current Limit Level
0B8h Enabled Limit Data (three entries in Attack Data format)
10Ch 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
2CCh Enabled Summons (format like above)
32Ch Enabled ESkills (format like above)
40Ch First 11 bytes of Weapon Data
41Ch Elements added to Attacking Elements above
420h 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 ""