BattletechPerformanceFix icon indicating copy to clipboard operation
BattletechPerformanceFix copied to clipboard

Strip battletech registry data.

Open m22spencer opened this issue 6 years ago • 7 comments

BattleTech is currently storing multiple megabyte keys in the registry. This has to go. It's related to analytics, so may be best to just nuke the analytics entirely.

Additionally, the registry data is a common reason people can't play vanilla battletech, due to corrupt data. Moving this to a file will provide users with a simpler cache cleaning method.

m22spencer avatar Jan 06 '19 02:01 m22spencer

nice, but we need this feature in ModTek itself, alongside save game data storage location manipulation. see https://github.com/BattletechModders/ModTek/issues/36

CptMoore avatar Jan 06 '19 11:01 CptMoore

Just wanted to track it somewhere before I forgot.

You're right about the save stuff needing to be in ModTek (I can't even hook the game early enough in bfix).

Stripping analytics probably falls under bfix though.

m22spencer avatar Jan 06 '19 14:01 m22spencer

C:\Users[USERNAME]\AppData\LocalLow\Harebrained Schemes\
steam\userdata[USERID]\637090\

^ These two seem to be either or, depending on cloud state.

HKEY_CURRENT_USER\Software\Harebrained Schemes\BATTLETECH

^ This is unity, playerprefs goes here on windows.

C:\Users[USERNAME]\AppData\Local\HarebrainedSchemes
C:\Users[USERNAME]\AppData\Local\Temp\Harebrained Schemes
steam\steamapps\shadercache\637090

^ Unsure.

Critical path is Application.persistentDataPath & PlayerPrefs callees. Looks like potentially 20-ish patches.

m22spencer avatar Jan 07 '19 23:01 m22spencer

It may be possible to do a WriteLocation patch to redirect the core of the saves.

Two things are required: usePlatform = false, and modifying the root path to point where we want it.

Note: The code which uses this information is pretty crazy, and seems to store information about how to load things in the file string itself, so best to stay as minimal as possible here.

m22spencer avatar Jan 08 '19 00:01 m22spencer

Seems that just handling the WriteLocation & CachedSettings is sufficient.

m22spencer avatar Jan 08 '19 02:01 m22spencer

Yea cachesettings contains the skirmish mechdef / lance data

CptMoore avatar Jan 08 '19 06:01 CptMoore

see https://github.com/BattletechModders/NewSaveFolder for save game folder redirection (was an ME feature that was extracted since it doesnt work for ModLoader)

CptMoore avatar Jul 04 '20 20:07 CptMoore