UnityTrafficSimulation/Recovery/README.md

74 lines
4.5 KiB
Markdown

# Source recovery
The checkout contained asset contents replaced by `.meta` data, metadata
replaced by models/images/source code, duplicated GUIDs, and directories named
like missing files. The old Library cache was also damaged. Recoveries preserve
existing asset references wherever the original GUID could be recovered.
## Provenance
- `UnityProject/Assets/junctionAssets.zip`: restored the corrupted buildings and
fence models, seven materials, four prefabs, and several metadata files from
the bundled `junctionAssets - Copy` archive. Intact source files were retained.
- `UnityProject/Scripts/other.zip`: restored metadata for `canvasChooser`,
`serverRunningMenu`, and `destroyCar`.
- The bundled Windows server's `Simulation_Data/Managed/Assembly-CSharp.dll`:
decompiled `CarLL` and `trafficLightColor` with ILSpy 9.1.0.7988. Removed
generated UNet weaving methods and changed the woven `CallRpcDecodeBits` call
back to the source `RpcDecodeBits`, so Unity can weave the assembly again.
The assembly SHA-256 was
`9b23bd2b83c61ce07b579da9b594ddd535ed543435545b355f2c94d09d53a6e4`.
- [Unity PostProcessing v1](https://github.com/Unity-Technologies/PostProcessing/tree/933df236f509ed64ae5763ed57af33f2342cd1c2),
commit `933df236f509ed64ae5763ed57af33f2342cd1c2`: restored damaged editor
scripts, missing model editors, shaders, blue-noise textures, and metadata.
- Unity's original 2018.1.6 Standard Assets distribution, downloaded from the
[official release installer](https://download.unity3d.com/download_unity/a68afd074ea7/MacStandardAssetsInstaller/StandardAssets.pkg)
(MD5 `b891fafc108fec1232c5b1409c79bb9c`): restored `VirtualInput.cs`, the
damaged mobile control prefab/sprite, and associated metadata from the
CrossPlatformInput package.
- Original cached Unity import records: recovered lost GUIDs, model sub-asset
IDs/material mappings, and native asset metadata. Texture metadata uses the
corresponding intact neighboring import settings and the recovered GUID.
- Original cached textures: recovered `Lightmap-0_comp_dir.png` including its
directionality alpha channel, and `Lightmap-1_comp_light.exr` with HDR values.
UnityPy decoded the directional BC7 texture; [bcdec](https://github.com/iOrange/bcdec)
decoded BC6H into floating point for OpenEXR output. These are recoveries from
the imported, compressed cache, not byte-identical original source images.
The HDR decoding/orientation was checked against an intact source lightmap.
The old `UnityProject/Library` is preserved locally at
`Builds/recovery/Library-original`. Recovery intermediates and audit files are
under `Builds/recovery/`. Neither directory is required by the restored build.
## Small compatibility and startup changes
- Renamed `Assets/!ext` to `Assets/ThirdParty`, keeping its GUIDs. In the original
folder, the legacy Linux player build omitted the vendor C# classes although
editor compilation succeeded. The renamed folder produces the post-processing
and particle-effect classes in the player, eliminating missing-script warnings.
- Initialized traffic control and notification spawning in `OnStartServer`, so
starting networking after the scene loads works correctly.
- Initialized RPC receiver state before the first update can arrive and corrected
the client disconnect callback's base method.
- Added `--server`, `--connect`, `--traffic-url`, and `--event-url` startup options,
disabled the old resolution popup, and removed repetitive server log output.
- Added a launcher for the original Python backends plus separate UNet server
and client processes. The launcher binds the HTTP services to localhost; their
standalone default remains unchanged.
- Unity regenerated damaged PresetManager and UnityConnectSettings files, which
had contained unrelated PlayerSettings and TimeManager data respectively.
## Unrestored optional files
`unrestored/` preserves corrupt files outside Unity's import tree, under their
original paths. They are not required by Main:
- One unused motion-capture FBX animation.
- An unused `tweet.prefab`; the working scene uses `clientGame.prefab` instead.
- A reference photograph and three FBX exporter documentation/archive files.
- `FbxExportSettings.asset`, which incorrectly contained EditorSettings YAML
rather than the exporter's JSON settings and caused an import exception.
These files still need an intact source if their optional functionality is
wanted. The Windows-only FBX exporter tools were not ported. Existing backup
`.blend1` files are retained and ignored by Git.