Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting TM 2020 server ghosts to clips #40

Open
jmgraeffe opened this issue Mar 30, 2022 · 5 comments
Open

Converting TM 2020 server ghosts to clips #40

jmgraeffe opened this issue Mar 30, 2022 · 5 comments
Labels
probably impossible This isn't likely possible to implement requires RE This requires reverse engineering effort

Comments

@jmgraeffe
Copy link

jmgraeffe commented Mar 30, 2022

Hey,

is it possible to convert TM 2020 ghosts that were collected by the server automatically to clips that can be imported into replays?

I tried the GhostToClip example and the tool does indeed output a clip that can be imported, but there are two problems:

  • the ghost object seems to have no or zero value in ghost.RaceTime attribute
  • when you import the output clip into Trackmania, it has the length of the fixed offset defined in Program.cs:37 but the car is just floating under the map, not moving at all

There are also hints that some parts of CGameCtnGhost are unknown to the parser:

2022-03-30 16:26:36 dbug: Program[0] GBX magic found
2022-03-30 16:26:37 dbug: Program[6] Version: 6
2022-03-30 16:26:37 dbug: Program[7] Format: Byte
2022-03-30 16:26:37 dbug: Program[8] Ref. table compression: Uncompressed
2022-03-30 16:26:37 dbug: Program[9] Body compression: Compressed
2022-03-30 16:26:37 dbug: Program[10] Unknown byte: R
2022-03-30 16:26:37 dbug: Program[11] Class ID: 0x03092000
2022-03-30 16:26:37 dbug: Program[12] User data size: 0 kB
2022-03-30 16:26:37 dbug: Program[13] Number of nodes: 1
2022-03-30 16:26:37 dbug: Program[0] Header complete
2022-03-30 16:26:37 dbug: Program[0] Reading the body...
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0303F006 (0.0146627575%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0303F007 (0.11730206%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x0303F007 [unknown] (4 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092000 (0.17595308%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092005 (0.94208217%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092008 (1.0007331%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309200A (1.0593842%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309200B (1.1180352%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309200C (1.1766862%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309200E (1.2060117%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309200F (1.2353373%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092010 (1.345308%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092013 (1.4882698%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092014 (1.5615835%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309201A (1.6202345%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x0309201A [unknown] (4 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309201B (1.6788857%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x0309201B [unknown] (18 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309201C (1.7888563%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309201D (1.9208212%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x0309201D [unknown] (26145 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092022 (97.80425%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x03092022 [unknown] (8 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092023 (97.87757%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092024 (98.09384%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x03092024 [unknown] (8 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092025 (98.16716%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092026 (98.66936%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x03092026 [unknown] (16 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092027 (98.771996%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x03092027 [unknown] (16 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092028 (98.87463%)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x03092029 (98.918625%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x03092029 [unknown] (20 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309202A (99.03593%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x0309202A [unknown] (8 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309202B (99.10924%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x0309202B [unknown] (28 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309202C (99.25587%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x0309202C [unknown] (12 bytes)
2022-03-30 16:26:37 dbug: Program[1] => CGameCtnGhost 0x0309202D (99.34384%)
2022-03-30 16:26:37 dbug: Program[4] => CGameCtnGhost 0x0309202D [unknown] (167 bytes)
2022-03-30 16:26:37 dbug: Program[2] => CGameCtnGhost DONE! (27.2223ms)
2022-03-30 16:26:37 dbug: Program[0] Body chunks parsed without major exceptions.

So maybe the server feature does not work anymore as a stub from old Trackmania versions, or maybe the ghost parser needs to be implemented for TM2020?

The map and an example ghost file is attached if you've the time: example.zip

Thanks in advance.

CC @derkalle4

@BigBang1112 BigBang1112 added the probably impossible This isn't likely possible to implement label Apr 4, 2022
@BigBang1112
Copy link
Owner

Server ghosts (at least the TM2020 ones) seem to be a special kind that don't store the same kind of samples as with a regular ghost you know from the club record leaderboard for example. They store data more focused around inputs and it appears to be some Shootmania leftover.

MediaTracker doesn't recognize this kind of data, but realizes that this data might be correct, just not usable for MediaTracker. Therefore porting the same data chunk over to the CGameCtnMediaBlockGhost is not a valid option.

One and only solution seems to be transferring the actual sample structure from one chunk or another, basically casting the values formatted in one way to a different way, which to me sounds like a very difficult job, near impossible if we count in that not many ghost samples were discovered since then.

@BigBang1112 BigBang1112 added the requires RE This requires reverse engineering effort label Apr 4, 2022
@derkalle4
Copy link

Many thanks for your feedback and time. Somewhat sad to hear that these files are currently useless but included in the default server configuration. But that's none of your business but depends on the game developers.

@BigBang1112
Copy link
Owner

This is getting me a bit curious though, I'll see what's behind in February and March.

@derkalle4
Copy link

:D sounds good, however, it is worth noticing that I do not need that anymore because the use case was actually a internal tournament with like 50 players. But would also like to know whether this is possible or not :)

@AurisTFG
Copy link
Contributor

Hey, a bit late to the party, but I don't think this specific ghost has any sample data at all. The fact that the file size is really small and the mediatracker doesn't want to load the file makes me think the car travel data just doesn't exist. I've also came across similar files when testing dedicated server autosaves, this seems like a normal thing, however, there's also a way to save car data as well, I think there's a different setting you need to turn on in the config.... I tried to test something but it all seems broken rn for me so cannot confirm 100% xd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
probably impossible This isn't likely possible to implement requires RE This requires reverse engineering effort
Projects
None yet
Development

No branches or pull requests

4 participants