entropia / tip-toi-reveng

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

GME Game programming #295

Closed mgudemann closed 4 months ago

mgudemann commented 4 months ago

Hi, I have the "Mission im Lesedschungel" Tip Toi game.

Unfortunately card 16 is missing. So my idea is to change the OID in the game for card 16 to some other card's OID and just use that., i.e., instead of clicking on card 16 one would click on card 17 and the game would continue.

I think there are sounds that read the content of the cards, so it should be possible to make this mission playable doing this, effectively unblocking the game.

Is there a good pointer to game programming / debugging? I only found wip/games.txt which did not really help me.

nomeata commented 4 months ago

It depends a bit on how that gme file is programmed. If it contains “binaries”, i.e. logic in machine code, then you cannot edit the gme file with tttool without losing functionality.

So the first thing you could try is to disassemble and assemble the file, load it onto the stick, and see if stuff still works.

mgudemann commented 4 months ago

@nomeata thanks, I will try that. In the extracted yaml there are unknown entries for the games, could that be a problem? for example:

  subgames:
  - oids1: 1 2 3 4 5 88
    unknown: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    oids3: ''
    oids2: ''
    playlist:
    - '344'
    - '345'
    - 346,343
    - 347,348,349
    - 350,351,352
    - []
    - []
    - []
    - []
nomeata commented 4 months ago

Since you just want to change some oids somewhere, it might be ok. You'll see :-D

mgudemann commented 4 months ago

I managed to fix the game in the sense that this mission becomes playable.

Unfortunately there are "holes" in the GME file such that tttool cannot export and assemble a working game. Nevertheless, from looking very hard (and way longer than I had hoped for) at the program logic, I deduced that the OID to change was in an unknown section of one of the subgames

    unknown: 01 00 DE 31 01 00 02 00 00 00 3C 00 00 00 00 00 00 00 00 00

the OID of the missing card is 12766 / 0x31de and using a hex editor I changed this to OID 12765 / 0x31dd of a card we have. Playing the right meda file told us what is written on the card, so the mission can be finished now.

@nomeata thanks for this tool!

nomeata commented 4 months ago

Great to hear that!

mgudemann commented 4 months ago

luckily there are no checksums

nomeata commented 4 months ago

There are, but they are not checked :-D