Add traffic lane GPS weighting toolkit
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
# 2077 Edge Weight Mod
|
||||
|
||||
Experimental Cyberpunk 2077 GPS route-weighting mod tooling.
|
||||
|
||||
## Feasibility
|
||||
|
||||
Cyberpunk exposes a native `gamegpsGPSSystem`, but the current public RTTI dump does
|
||||
not expose script-callable methods for replacing or overriding the GPS planner. The
|
||||
useful surface is the traffic lane resource data:
|
||||
|
||||
- `worldTrafficPersistentResource.data.lanes`
|
||||
- `worldTrafficLanePersistent.length`
|
||||
- `worldTrafficLanePersistent.maxSpeed`
|
||||
- `worldTrafficLanePersistent.flags`
|
||||
- `worldTrafficLanePersistent.playerGPSInfo`
|
||||
- `worldTrafficLanePersistentFlags.Highway`
|
||||
- `worldTrafficLanePersistentFlags.GPSOnly`
|
||||
|
||||
That strongly suggests the in-game GPS path is computed natively over the traffic
|
||||
lane graph, using lane metadata as edge cost inputs. A full replacement planner
|
||||
would require native hooks or patching the game executable. A feasible REDmod-style
|
||||
mod is to patch lane resources so highways and major roads have better effective
|
||||
costs than side streets.
|
||||
|
||||
## Current Implementation
|
||||
|
||||
This repo currently contains a WolvenKit-export patcher:
|
||||
|
||||
```bash
|
||||
python3 tools/patch_traffic_lanes.py exported-json-dir patched-json-dir
|
||||
```
|
||||
|
||||
The patcher recursively scans WolvenKit JSON exports for `lanes` arrays that look
|
||||
like `worldTrafficLanePersistent` data and applies configurable speed weighting:
|
||||
|
||||
- highways get boosted toward a preferred GPS speed
|
||||
- regular roads get a moderate speed floor
|
||||
- pavement, crosswalk, and disabled traffic lanes are left alone
|
||||
- optional non-highway speed caps can make highways more attractive
|
||||
|
||||
After patching, deserialize the JSON back into CR2W and pack the resulting
|
||||
resources into an archive.
|
||||
|
||||
The toolbox now has WolvenKit CLI installed:
|
||||
|
||||
```bash
|
||||
toolbox run --container 2077 bash -lc '$HOME/.dotnet/tools/cp77tools --help'
|
||||
```
|
||||
|
||||
See [docs/tooling.md](docs/tooling.md) for the end-to-end archive build flow.
|
||||
|
||||
## Status
|
||||
|
||||
This is not yet a packaged playable mod because this workspace does not contain
|
||||
the Cyberpunk archive resources. The toolbox has the required CLI tooling now, so
|
||||
the next step is running the archive build script against a local Cyberpunk 2077
|
||||
install path.
|
||||
Reference in New Issue
Block a user