# sdsandbox-rl-scripts Modified C# scripts for the sdsandbox Unity simulator, used with the [donkeycar-rl-autoresearch](https://paje.ca/git/paulh/donkeycar-rl-autoresearch) project. ## What's here - `Scripts/` — all C# scripts from `sdsim/Assets/Scripts/`, including our RL training modifications - `ProjectSettings/` — Unity project settings - `Packages/` — Unity package manifest ## Key modifications (vs upstream tawnkramer/sdsandbox) - **`Car.cs`** — per-wheel OverlapSphere barrier collision detection; CCD mode - **`TcpCarHandler.cs`** — `regen_road` message support with direct RoadBuilder+PathManager fallback when no TrainingManager present; `set_ai_text` overlay message - **`PathManager.cs`** — self-intersection fix: retry loop with XZ segment-segment math (up to 20 retries) - **`RoadBuilder.cs`** — BoxCollider per segment with overlap; `showBarrierMeshes` flag - **`MapOverlay.cs`** — minimap refresh on road node position change (not just count) ## Setup on a new machine 1. Clone the upstream sdsandbox (provides all binary assets Unity needs): ```bash git clone https://github.com/tawnkramer/sdsandbox ``` 2. Clone this repo: ```bash git clone git@paje.ca:paulh/sdsandbox-rl-scripts.git ``` 3. Overlay our scripts into the sdsandbox project: ```bash cp -r sdsandbox-rl-scripts/Scripts/* sdsandbox/sdsim/Assets/Scripts/ cp -r sdsandbox-rl-scripts/ProjectSettings/* sdsandbox/sdsim/ProjectSettings/ cp -r sdsandbox-rl-scripts/Packages/* sdsandbox/sdsim/Packages/ ``` 4. Open `sdsandbox/sdsim` in Unity 6000.4.4f1. Unity will reimport assets on first open. 5. Build: **Edit → Project Settings → Player Builder → WinBuild** (or use the batch build command from the donkeycar-rl-autoresearch SESSION_HANDOFF.md). ## Unity version **Unity 6000.4.4f1** — other versions are not tested and may have incompatible APIs.