View Single Post
djazz djazz's Avatar

JCF Member

Joined: Feb 2009

Posts: 257

djazz is OFF DA CHARTdjazz is OFF DA CHARTdjazz is OFF DA CHART

Oct 20, 2012, 08:14 AM
djazz is offline
Reply With Quote
The J2S file format

Behold, a complete JJ2 language editor!

I made it on request from Grytolle, who wanted to improve his Swedish translation of JJ2.
Here it is, including translation of the helpstrings in the default levels:
Some are really funny, if you speak Swedish.

J2S File Format
From J2NSM Haxia
The Jazz Jackrabbit 2 Language file. Contains text strings and some other stuff.
struct J2S_File_Format {
	unsigned int offset_array_size; // Size of the array with string offsets for the first text array
	unsigned int text_array_size; // Size of the first text array
	unsigned char text_array[text_array_size]; // The first text array - contains null-terminated strings
	unsigned int offset_array[offset_array_size / 4]; // An array of integers, each containing the offset for a string in the first array.
	unsigned int level_entry_count; // Number of level entries
	level_entry entry[level_entry_count]; // See the level_entry struct definition below
	unsigned int text_array_2_size; // The total size of the secondary text array
	array_2 text_array_2[]; // Secondary text array - see definition below
struct level_entry { // 12 bytes each
	unsigned char name[8]; // Null terminated...
	char zeroByte;
	char unknown;		// Some amount maybe
	unsigned short offset; // Some offset
I am not sure whether is a good idea to use a variable-length struct to display the data, but it's only for informational purposes.

struct array_2 { // Secondary text array entry
	unsigned char some_index; // Probably has to do with level entries eg. which entry this text belongs to
	unsigned char t_size; // Size of the following text
	unsigned char text[t_size]; // The text itself (variable-length)
That's a brief definition of the J2S format. The first text array contains messages that you get to see during the game like Player entered the game, Player was roasted by Grytolle, etc. The offset array tells you where a certain text begins. Strings inside this array are null-terminated. The second half of the J2S contains some outdated level data. Probably the devs considered putting text that was to be displayed in levels into language files, but later moved it into J2L structure.
It is not a complete specification, see my code for how I did it. Also, TSF language files contains more helpstrings (in text_array_2), but TSF supports loading 1.20-1.23 language files. My program can only handle 1.20-1.23 languages. ENJOY!
WebJCS 2 (new and in progress)
WebJCS 1 (old but complete)
SGIP Simple Games in Progress list
Level Packer v2 - With a GUI!
PHP Tileset Compiler