entropia / tip-toi-reveng

Trying to understand the file format of Tip Toi
http://tttool.entropia.de/
MIT License
657 stars 123 forks source link

Support for record / playback #192

Open Raincloud7 opened 5 years ago

Raincloud7 commented 5 years ago

I could not find any information on the new record playback commands.

Looking at the decoded file (and identifying the ids) i see this:

  3290:  // record
  - $0==1? $2:=3290 $4:=0
  - $0==2?
  - $0==3?
  - $0==4?
  - $0==5?
  - $0==6?  
  3291:  // play
  - $0==1? $2:=3291 $4:=0
  - $0==2?
  - $0==3?
  - $0==4?
  - $0==5?
  - $0==6?

which does not make sense to me. Variables $2 and $4 are not used otherwise as it seems. Did anyone manage to build custom books with recording / playback.

spinF commented 5 years ago

There are quite a few holes in at least Die verrueckte Weltreise.gme(meaning parts of the file that are not understood by tttool):

Unknown file segments: 15 (148652 bytes total)
   Offset: 000000AC to 00000200 (340 bytes)
   Offset: 000013A3 to 0000146B (200 bytes)
   Offset: 00004783 to 0000484B (200 bytes)
   Offset: 00007E11 to 00007ED9 (200 bytes)
   Offset: 0000B7E9 to 0000B8B1 (200 bytes)
   Offset: 0000E1E1 to 0000E2A9 (200 bytes)
   Offset: 000104BB to 00010583 (200 bytes)
   Offset: 00013427 to 000134EF (200 bytes)
   Offset: 00018B40 to 00019C6C (4396 bytes)
   Offset: 02D8C23B to 02D8C267 (44 bytes)
   Offset: 02D8E397 to 02D8E3BF (40 bytes)
   Offset: 02DA2FBF to 02DA2FE7 (40 bytes)
   Offset: 02DA512B to 02DA5153 (40 bytes)
   Offset: 02DB9E13 to 02DC0C47 (28212 bytes)
   Offset: 02DC0C4B to 02DDCA27 (114140 bytes)

My guess would be, that tttool does not understand the new record and playback commands, so they don't appear in the exported file.

Here are some OIDs that record and play back in that file (first code for recording, second one for playback), if that helps with examining the file:

* `3218`, `3219` sorcerer, record slot 0001 * `3221`, `3222` sorceress, record slot 0002 * `3226`, `3227` bird, record slot 0003 * `3237`, `3238` unicorn, record slot 0005 * `3245`, `3246` sheep, record slot 0006 * `3248`, `3249` ear, record slot 0007 * `3252`, `3253` owl, record slot 0008 * `3257`, `3258` iceman, record slot 0009 * `3270`, `3271` girl, record slot 0010 * `3274`, `3275` boy, record slot 0011 * `3278`, `3279` dog, record slot 0012 * `3286`, `3287` clown, record slot 0013 * `3290`, `3291` knight, record slot 0014 * `3294`, `3295` horse and pig, record slot 0015 * `3301`, `3302` dragon, record slot 0016
uli42 commented 5 years ago

On Thu, Nov 22, 2018 at 12:09 AM spinF notifications@github.com wrote:

There are quite a few holes in at least Die verrueckte Weltreise.gme(meaning parts of the file that are not understood by tttool):

Unknown file segments: 15 (148652 bytes total) Offset: 000000AC to 00000200 (340 bytes) Offset: 000013A3 to 0000146B (200 bytes) Offset: 00004783 to 0000484B (200 bytes) Offset: 00007E11 to 00007ED9 (200 bytes) Offset: 0000B7E9 to 0000B8B1 (200 bytes) Offset: 0000E1E1 to 0000E2A9 (200 bytes) Offset: 000104BB to 00010583 (200 bytes) Offset: 00013427 to 000134EF (200 bytes) Offset: 00018B40 to 00019C6C (4396 bytes) Offset: 02D8C23B to 02D8C267 (44 bytes) Offset: 02D8E397 to 02D8E3BF (40 bytes) Offset: 02DA2FBF to 02DA2FE7 (40 bytes) Offset: 02DA512B to 02DA5153 (40 bytes) Offset: 02DB9E13 to 02DC0C47 (28212 bytes) Offset: 02DC0C4B to 02DDCA27 (114140 bytes)

The last two are mostly addtional gametables as referenced at 0xc8 and 0xcc. Looks like tttool does not know about them. We do not know why we have several gametables but as the structure is known I'd say at least tttool explain and tttool holes should respect them!

@Joachim: I'll open an issue for that

Uli

uli42 commented 5 years ago

On Mon, Nov 19, 2018 at 10:31 PM Raincloud7 notifications@github.com wrote:

I could not find any information on the new record playback commands.

Looking at the decoded file (and identifying the ids) i see this:

3290: // record

  • $0==1? $2:=3290 $4:=0
  • $0==2?
  • $0==3?
  • $0==4?
  • $0==5?
  • $0==6? 3291: // play
  • $0==1? $2:=3291 $4:=0
  • $0==2?
  • $0==3?
  • $0==4?
  • $0==5?
  • $0==6?

which does not make sense to me. Variables $2 and $4 are not used otherwise as it seems. Did anyone manage to build custom books with recording / playback.

A did some check with random OIDs on that gme file. For every OID I checked (3290,3291,3292,3295,3495,308,3904) $2 is always set to the OID. So I guess $2 is something like "last selected OID". And $4 is always set to 0.

Uli