FOE

From OHRRPGCE-Wiki
Jump to navigation Jump to search
Mobile-phone.png
This article is about the OHRRPGCE FMF project, which is an alternate implementation of the OHRRPGCE for Java mobile phones. Technical implementation details discussed here should not be confused with those of the RPG format

DT1 underwent its drawn-and-quartering to become the significantly compressed FOE. Its 16-byte header contains information used in this compression; however, the number of enemies stored is still kept in GEN.

Header Format[edit]

Data Meaning
BIT(4) x12 Most common widths of stats (see enemy record format)
BIT(2) x40 Flags for enemy bitsets.
First flag, if 1, means that bitset is the SAME for all enemies. Second bit is the value of that bitset for all enemies.


Enemy Record Format[edit]

Data Meaning
STR Enemy Name (null-terminated)
BYTE Enemy Picture
BIT(11)
BIT(2)
BIT(3)
Enemy Palette
Picture Size (0,1,2)
Number of Regular Attacks
BIT(3)
BIT(3)
BIT(2)
Number of Desperation Attacks
Number of Alone Attacks
Thievability of Enemy (0=no, 1=once, 2=infinte)
BYTE?
BYTE?
Item Steal %
Stealable Item
First byte only appears if thievability>0
Second byte only appears if first byte exists and is >0
BYTE?
BYTE?
Rare Item Steal % (if regular steal failed)
Stealable Rare Item
First byte only appears if thievability>0
Second byte only appears if first byte exists and is >0
INT Experience Reward
INT Gold Reward
BIT(1)
BIT(7)
Flag: If 1, use common stat widths
Item drop %
BYTE? Item Reward (only if drop% >0)
BIT(1)
BIT(7)
Wasted
Rare item drop % (if a reg. item is not dropped)
BYTE? Rare Item Reward (only if drop% >0)
BIT(4) x12? Widths of stats Only appears if stat widths flag is 0 (i.e., not common)
(varies+) Enemy Statistics
HP
MP
Strength
Accuracy
Defense
Dodge
Magic
Will
Speed
Counter
MP~
Extra Hits
BIT(40)? Enemy Bitsets*'
Weak to elements[1..8]
Strong to elements[1..8]
Absorbs elements[1..8]
Is enemy type[1..8]
Harmed by cure
MP Idiot
Is Boss
Unescapable
Die without boss
Flee instead of die
Untargetable by enemies
Untargetable by heroes
BIT(4)
(BIT(4) BYTE BYTE)
(BIT(4) BYTE)
Number of enemy spawn pairs
Spawn Pair 1 + number of enemies to spawn on trigger
Spawn Pairs 2 onwards
(A "spawn pair" contains 4 bits for the "type" of spawn[1..12], 1 being death, 2 being non-elemental death, etc. and 1 byte for the ID of the enemy to spawn. The first spawn pair has one byte piggybacked to this, which contains the number of enemies to spawn for any spawn pair.)
Note that this section may be padded with a wasted half-byte.
BYTE x5? Regular attacks (excluding empty attacks)
BYTE x5? Desperation attacks (excluding empty attacks)
BYTE x5? Alone attacks (excluding empty attacks)

+NOTE: Each stat has a "width", which may be the "common" width stored in the header, or may be a custom-defined width stored directly before the enemy statistics section. This width defines how many bits to set aside for each statistic, and ranges from 1 to 16 inclusive.
*Note that the enemy bitsets section is missing bits which are declared constant in the header. The gap between the enemy stats & enemy bitsets section might not align on a byte boundary; however, the end of the enemy bitsets section is padded with bits so as to align.
'WARNING: For some reason, it appears that all bitsets are byte-reversed in the OHRRPGCE. For instance, 0A 10 in binary is 00001010 00010000. This means that bits 2, 4, and 13 are on, the rest off. All of this is "fixed" (read: neutered) in XRPG format, such that one can directly read the bitstream from left to right.

List of Lumps specific to the XRPG format. Other lumps comply with existing .RPG lump specifications.

HEADER.LMP . _FNT.png . .PT4_# . .PT6_# . .HERO_#.png . SEZ . EFX . BFF . FOE . _TIL_#.png . _MXS_#.png . ###.MAP . HRO . ATK . SCRIPTS_#.HF . SCRIPTS.LST