Jump to navigationJump to search
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

This lump contains all the text boxes. It uses run-length encoding to remove long sequences of zeroes.

Note that, for efficiency reasons, SEZ is split into a new file at every 50 boxes. So, if your game has 135 boxes, then the following files will contain the following boxes:

File Name Boxes
NAME.SEZ 1 through 50
NAME_1.SEZ 51 through 100
NAME_2.SEZ 101 through 135

Formal Specs[edit]

Color Status in the OHRRPGCE FMF
Fully Implemented
Partly Implemented
Intended (in a future release)


Section Data Description
Text STR Null-terminated string, with '\n' characters to delimit newlines.
Choice 1 STR Null-terminated string without newlines
Choice 2 STR Null-terminated string without newlines
Text Box Choice Bitset BYTE(ABCDXXXX) A=choicebox enabled
B=disable box
C= disable translucent
D=enable restore music
29 Other Stats* INT (1) conditional tag (jump to text box/script # instead)
INT (1) param.
0-32767 are textboxes 0-32767
-1 to -32768 are negated plotscript Triggers
INT (1) conditional tag (set tag #n = on/off (x2))
INT (1) param.
+n = "tag #n=on"
-n = "tag #n=off"
INT (1) param.
+n = "tag #n=on",
-n = "tag #n=off"
INT (1) conditional tag (fight formation #)
INT (1) param.
index of battle formation
INT (1) conditional tag (restore/shop/inn)
INT (1) param.
0 = restore hp/mp.
-n = go to an inn that costs $n.
+n = go to shop #n
INT (1) conditional tag (add/remove/swap/unlock/lock hero)
INT (1) param.
-n = remove hero #n
+n = add hero n
0 = do nothing
INT (1) conditional tag (jump to text box/script # after)
INT (1) param.
0-32767 are textboxes 0-32767
-1 to -32768 are negated Plotscript Triggers
INT (1) conditional tag (gain/lose money)
INT (1) param.
+n = amount of money to gain.
=n = amount of money to lose
INT (1) conditional tag (use door #)
INT (1) param.
door number on current map
INT (1) conditional tag (add/remove items)
INT (1) param.
-n = remove item
+n = add item
INT (1) param.
swap in/out hero.
-n = hero to swap out
+n = hero to swap in
INT (1) param.
lock/unlock hero.
-n = hero to lock
+n = hero to unlock
INT (1) Choice 1 Tag (positive ON, negative OFF)
INT (1) Choice 2 Tag (positive ON, negative OFF)
INT (1) vertical position. Y position of box is value*4 + 4
INT (1) box shrink. Height of box is 88 - 4 * shrink pixels
INT (1) text color. If 0, use color 15.
INT (1) border color. Box body color is value*16 + 18, box frame color is value*16 + 28
INT (1) backdrop index + 1, 0 for none
INT (1) music + 1

*Due to the large number of consecutive zeroes appearing in the average SAY lump (consider: are you going to remove money, use a door, and then add an item all that often?), all integers are compressed with a BYTE(BXXX XXXX), where X is the number of integers following which are zero. If B is 0, then there is ONE integer after these zeroes, followed by another BYTE(BXXX XXXX). Otherwise, this byte is followed immediately by a BYTE containing the number of integers to read. After these integers, the normal BYTE(BXXX XXXX) appears to designate the length of the next run of zeroes. We save space by neglecting to actually put the zeroes in the lump file.

Simple Example[edit]

Hex Digits Section Means
42 6F 62 3A 20 42 6F 75 6C 64 65 72 73 20...00 Text "Bob: Boulders..."
00 Choice 1 "" (empty)
00 Choice 2 "" (empty)
00 Text Choice Bitset choicebox DISabled
ENable box
ENable translucent
DISable restore music
82 (10000010) jump to text box/tag conditional = 0
jump to text box/tag param = 0
2 zeroes, followed by MORE THAN ONE integer
03 three integers follow
05 00
55 00
set tag conditional = -1 (in 2's complement)
set tag param = 5
set tag param = 85
(just three integers)
13 flight formation conditional=0
flight formation param=0
shop/inn conditional=0
shop/inn param=0
hero change conditional=0
hero change param=0
jump to box conditional=0
jump to box param=0
change money conditional=0
change money param=0
door conditional=0
door param=0
item conditional=0
item param=0
swap hero param=0
lock hero param=0
choice 1 tag=0
choice 2 tag=0
vertical position=0
19 zeroes, followed by ONE integer
0A 00 box shrink = 10 (just an integer)
04 text color=0
border color=0
backdrop index=0 (none)
music=0 (none)
4 zeroes, followed by ONE integer. (In fact, this could have been 84 and it wouldn't have mattered; runs are not allowed to extend past one message box).

Notice how the total size of this box is 141 bytes, as opposed to the traditional size of 400 bytes? Consider also that 88% of these are used for text, and Wandering Hamster (from which this example is taken) is quite text-heavy, and you'll see the promise of this algorithm.

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