News:

Zatikon is back and free to play! https://www.chroniclogic.com/zatikon.htm

Main Menu

The level format

Started by Jonathan_NL, May 27, 2005, 09:26:28 AM

Previous topic - Next topic

Jonathan_NL

This is what I think is the final lvl format (stored in LSB first):

int magic == 9;
char background[32];
int tileset, gametype, gametime;
struct { int x1, y1, x2, y2; } rects[64]; /* the colored rects you get when you select a region and press 5678 */
char back[0x10000]; /* encrypted */
char mid[0x10000]; /* encrypted */
char front[0x10000]; /* encrypted */
float unused[3]; /* was start position in older versions (might be int) */
struct { float r, g, b; } backcolor, midcolor, frontcolor, waybackcolor;

int numobjects;
struct {
int type, texture, link;
float x, y, z; /* set z to 0 if you don't want to mess up sticking */
int unused; /* probably something in older versions */
float xscale, yscale;
float mass, friction;
int lighttype;
float red, green, blue, intensity;
int unused; /* probably something in older versions */
} objects[numobjects];

int numropes;
struct {
int type, texture;
int object1, anchor1;
int object2, anchor2;
} ropes[numropes]; /* note that I never tested them... */

struct {
int width;
if(width) { /* if not the texture is what is currently in memory */
int height, unused[2]; /* would be mag and min filters but never got implemented. always GL_LINEAR == 0x2601 */
int tex[width*height]; /* encrypted RGBA */
}
int numlines;
struct { float x1, y1, x2, y2, unused[4]; /* left in from older versions where it was {friction, breakpoint, x, x} */ } lines[numlines];
float friction, breakpoint;
int middamage, foredamage;
float density, drag;
int animation, animatespd;
} tiles[250]; /* tiles 1-250, was 1-255 in older versions but they are now ignored by gish */


(sorry about the spacing, but iB can't do much better)

I won't tell anything about the encryption unless they (CL) allow me to.
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.

Jonathan_NL

Josiah/Alex: Do you think the encryption is still useful? Can I add it here?
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.

Kampfschaf

Very interesting!!! I understand the code! Some changes will make the Game much better ^^ No really... I programmed the GISH Trainer and decompile and use the Hex Codes to change some settings. I think this here is usefull to make much more... So tell more...

Jonathan_NL

It's the whole level format. I figured it out mainly by looking with a hexeditor, and writing a program that parsed as much as possible and often presented parts in a better format than the hexeditor. That way I reached the end fairly quickly.
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.

Kampfschaf

If you would like to make much more hacks please contact me n ICQ: 306155901

I program the Gish Trainer in VB! Maybe we can program a tool to make much more ;)

Jonathan_NL

Quote (Kampfschaf @ Sep. 16 2005,10:21)
If you would like to make much more hacks please contact me n ICQ: 306155901

I don't have ICQ.
I program the Gish Trainer in VB!
I used C, and I'm not using Windows.
Maybe we can program a tool to make much more ;)
I don't feel like doing much with it now.
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.

Kampfschaf

No ICQ? Where you live? ^^

Can you send me you C Code? I can this a little bit! I think i can use this 4 my VB Code a little bit! http://67.15.141.32/iB_html/non-cgi/emoticons/smile.gif" border="0" valign="absmiddle" alt=':)'> To make the GISH Trainer much better.

Jonathan_NL

Quote (Kampfschaf @ Sep. 17 2005,1:31)
No ICQ? Where you live? ^^

In front of my computer. http://67.15.141.32/iB_html/non-cgi/emoticons/laugh.gif" border="0" valign="absmiddle" alt=':laugh:'>
Can you send me you C Code? I can this a little bit! I think i can use this 4 my VB Code a little bit! http://67.15.141.32/iB_html/non-cgi/emoticons/smile.gif" border="0" valign="absmiddle" alt=':)'> To make the GISH Trainer much better.
How would code to read levels help reading player files?
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.

Kampfschaf

ould like to see the code with you decompile the LevelHexCode!

Jonathan_NL

What do you mean? Reading a .pla file works like this:
Code Sample
fp = fopen(path, "rb");
fread(&plastruct, sizeof plastruct, 1, fp); /* making assumptions about struct packing */
fclose(fp);
/* swap bytes on a big-endian machine */

Reading levels works almost the same, but there are points where you depend on previous data, such as lists of dynamic size. That gives:
Code Sample
fread(&lvlstruct, untilfirstlist, 1, fp);
/* swap bytes on a big-endian machine */
int i;
for(i=0; i<numitems; i++) fread(&somewhere, sizeof somewhere, 1, fp);
/* etc */

Of course there should be error checks in a real program.
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.