palworld-host-save-fix icon indicating copy to clipboard operation
palworld-host-save-fix copied to clipboard

Underlying mechanism for "Windows<>Linux" incompatibility with UID generation

Open cheahjs opened this issue 1 year ago • 4 comments

The underlying mechanism for UIDs being generated differently on Windows and Linux is actually not OS related, but related to how Palworld handles conversion of a FUniqueNetId (in the case of Steam clients, the client's 64-bit SteamID) to 32-bit PlayerUid.

In the event that the Steam online subsystem is not available, Palworld uses a different algorithm for converting the Steam IDs. The Steam online subsystem could be unavailable if the -nosteam CLI argument was used, or if the Steamworks SDK failed to initialise (for example if no Steam client was installed).

I've built a tool for performing these conversions so that people can check if their existing save is using the standard conversion or the no Steam conversion, and take action accordingly.

cheahjs avatar Feb 19 '24 17:02 cheahjs

You sir are a genius! I've been looking for this information since I first made the script!

I really appreciate you opening the issue and I'll be adding it to my script asap!

xNul avatar Feb 20 '24 03:02 xNul

Automatic conversion is non-trivial, as generation involves a one-way hash. Ideally you would ask the user for the players' Steam IDs. My tool provides the ability to bruteforce convert all 2^32 possible Steam IDs (a 64-bit SteamID consists of a 32-bit account ID and 32-bits of static information for public accounts) to all UIDs to attempt to search for Steam IDs that match a specific UID. However, as it is hashing a number with 32-bits of information into a 32-bit hash, for example the UID 7715B8D6 is generated for 6(!) different Steam IDs. image

cheahjs avatar Feb 20 '24 10:02 cheahjs

I understand it's not a perfect solution, but it should be able to help a lot. I was thinking about providing two options: an automatic option for bruteforcing the Steam IDs and a manual option for letting the user provide the Steam IDs. In the automatic option, if there are multiple Steam IDs which result in the same hash and each belongs to a valid account, I'd provide the user with the option to choose between the different usernames of those corresponding Steam IDs.

Also, can we reduce the search space by leveraging the fact there is no Steam ID greater than 1.3 billion?

xNul avatar Feb 20 '24 21:02 xNul

Also, can we reduce the search space by leveraging the fact there is no Steam ID greater than 1.3 billion?

yea the data is almost 1/3rd the size then. No sense in going to ~4.3 bill

asdf4w3t5 avatar Feb 27 '24 21:02 asdf4w3t5