XRPG Format

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


XRPG file format[edit]

The XRPG file format is a streamlined version of the . RPG format, and is used explicitly for the OHRRPGCE FMF; it will not work in CUSTOM.EXE or GAME.EXE. This section of the Wiki is intended primarily as a memory cache for the poor developer working on the OHRRPGCE FMF, although it is certainly useful to developers trying to poke around with their game if, say, it crashes when ported to the phone.

Folder Format[edit]

An XRPG file is simply an unlumped RPG file, with a few lumps changed. The folder's name is the same as the game's short name (e.g. "WANDER"). One can turn any .RPG file into a folder in the XRPG specification by using the java utility "RPG2XRPG" distributed with the source code to the OHRRPGCEFMF.

  • A note about passwords: No, RPG2XRPG won't ask for the game's password, since this would require developers to package their games specifically for the FMF. But fear not! The XRPG file format is so confounding that no-one in their right mind would attempt to hack your game this way. It's much easier to read the password from GEN.

Byte Order and Signage[edit]

Integers are stored in two bytes as follows: YY XX such that the integer one desires = 0x100*XX + YY. In fact, this code can be seen all over the place in the OHRRPGCE FMF's source, although the developers are well aware that left-shifting is faster.

Signed integers, when they appear, are stored in two's complement notation.

Naming Conventions[edit]

Most lumps are named in accordance with the traditional .RPG conventions (e.g., WANDER.???). Eventually, this may change. The OHRRPGCE FMF developers provide one guarentee:

No XRPG lump will be named in conflict with a traditional RPG lump.

In other words, (except for internal lumps) unlumping a game and then copy+pasting all lumps into an XRPG folder will not corrupt the XRPG when it is run.

Internal lumps are declared in the same fashion as traditional RPG internal lumps.

A Moot Point[edit]

If you are a general user of the OHRRPGCE FMF, you will never see an XRPG folder. The utility used to import games into the GAME_FMF.JAR file will ensure that no temporary files are left hanging around; all game files will be zipped into the JAR file.

But you're not reading this page if you're a general user, are you?


RPG 2 XRPG Mappings[edit]

WARNING: During alpha development of the OHRRPGCE FMF, the XRPG format is subject to change at any moment, and without warning or update. The format has already changed several times.

If a lump name does not appear in this table, it means it has not been dealt with yet, and still conforms to the .RPG specification (except that it is un-lumped, of course).

RPG Lump XRPG Location Comments Bytes saved+
ARCHINYM.LMP
BROWSE.TXT
HEADER.LMP Easier to add new headers ~20
.FNT _FNT.png   347 (17%)
.PT1 .PT1_#   0 (0%)
.PT2 .PT2_#   0 (0%)
.PT4 .PT4_#   0 (0%)
.PT6 .PT6_#   0 (0%)
.PT0[0] .HERO_#.png   N/A (N/A)
SAY SEZ   113KB (75%)
HSP
SCRIPTS.TXT
SCRIPTS.BIN
SCRIPTS.LST   ??? ???
HSZ SCRIPTS_#.HF Still planning... ??? ???
EFS EFX   1.4KB (93%)
FOR BFF   6.2KB (83%)
DT1 FOE   17.4KB (86%)
.TIL _TIL_#.png   782KB (78%)
.MXS _MXS_#.png   1.1MB   (69%)
BINSIZE.BIN (Dropped) 4 (100%)
DOR (Dropped) 11KB (100%)
.DT6
ATTACK.BIN
.ATK   21KB (71%)
DT0 HRO   36KB (98%)
MAP
MN
DOX
.D##
.T##
.P##
.E##
.L##
.N##
###.MAP   209KB (69%)

+ In Wandering Hamster. Other games compress to different degrees; for instance, a game which duplicated NPCs by hand (in .N) would be much larger than one that just added entries in .L.

Progress[edit]

 
4MB .5MB


Goal: 500KB for WH
Typical .RPG Size: 4.08MB
WH .XRPG Size: 1.74MB Uncompressed
Remaining Overflow: 35%