DaviMedrade / ETS2Sync-Helper-4

ETS2Sync Helper v4.0+
Other
56 stars 22 forks source link

Support for binary save format #10

Closed JhowDroid closed 2 years ago

JhowDroid commented 7 years ago

In an older version, the application already supported the binary save format. Could we have this feature again?

DaviMedrade commented 7 years ago

SCS changed the binary format with version 1.25. I haven't been able to figure out the new format used to store the placement of the truck. That meant that when the save was loaded, it had a bogus placement and the truck would appear floating in the middle of nowhere. The code is all there, actually, because I only noticed the change after I reimplemented the binary save reader in C++, but because of this change I had to disable that feature.

I haven't played ETS2 or ATS all that much lately, but I certainly would like to have this feature again. If one day I have the time I'll look into it again.

Here's what happened: the placement of the truck is a set of seven float numbers, representing the truck's location (where it is) and its orientation (what direction it's pointing to). Each float number is 32 bits wide, so I could just read 28 bytes from the save file, four at a time, casting them to floats, and I'd have the placement. In version 1.25, the placement became 30 bytes long. Two bytes were added between the 3rd and 4th numbers. They somehow affect the placement, because just ignoring them doesn't work. There seems to be some sort of calculation between those two bytes and the other numbers that yield the actual placement values, but I haven't been able to figure out what that calculation is.

cassiano00 commented 7 years ago

oi Davidsantos-br estou tendo problemas com o sincronizador ele não esta sincronizando direito as cargas e quando sincroniza ele manda meu caminhão no eurotruck de volta para a garagem inicial me ajude por favor ai por que esta dando este erro

DaviMedrade commented 7 years ago

@cassiano00, veja #13.