-
-
Notifications
You must be signed in to change notification settings - Fork 2
Code graph
English | 日本語
Experimental. This came in with framework 1.4.0 and may change or go away in a later version.
The code graph draws the game's code for you. For a method you see its blocks and branches, what it calls, the fields it reads and writes, whose patches sit on it and which events lead to it, and clicking a call opens that method. It's meant for modders who want to know where to hook and what else a method touches, without opening dnSpy. Think of it as the Inspector's Code view, drawn as a picture instead of a list.
It's a page the Bridge serves on this computer, and you see it in its own window on Windows, or in your browser.
For one method:
- Blocks are the method's basic blocks, in order. Each block says in words what it does: the calls it makes, the fields it reads and writes, what it compares, and what it returns or throws.
- Branches are the arrows between blocks, labelled true / false, case n, loop back, catch or finally.
- Calls are all listed, each in the block that makes it. The game's methods open when you click them, and Unity's and .NET's are shown but don't open.
- Callers are the game's methods that call it. Callers that reach it through a base method are listed too, marked through that method.
- Patches are the Harmony prefixes, postfixes, transpilers and finalizers on it, each with the mod that owns it (the name the Mods screen shows, not only the Harmony ID).
- Events are the UnityEvent listeners in the loaded scenes, and the Unity messages, that lead to it.
-
Coroutines get special handling. A coroutine or
asyncmethod is drawn through the hidden class the compiler makes for it, as the method's body, and eachyieldorawaitbecomes a labelled edge.
For one type (the type view) you get its methods in groups (Unity messages such as Update, public, private), with the calls between them. Click one to open it.
It draws the game's own code, and the code of its studio's and authors' libraries. It doesn't draw Unity's code, .NET's, bundled libraries or mods' own code (a mod shows up as its patches).
You need:
- Developer tools turned on (Options → Mods → Drag'n Wash ModFramework).
- The Inspector and the Bridge libraries installed, with the Bridge turned on. You do that with Turn on in the Bridge tab of the F1 window (or
bridge onin the Console). If it's off, the Graph buttons tell you the graph needs the Bridge.
Then, in the game:
- F1 → Inspector → select an object → a component → Code → Graph on a method. Graph only shows up on the game's own methods.
- Type graph in the same Code view opens the type view of the whole type.
Or from the Console:
-
op bridge.page.open focus=m:<method id>opens a method. The id is writtenNamespace.Type::Method(ParameterType,...). -
op bridge.page.open focus=t:<type>opens a type. -
op bridge.page.openwith no focus opens the page at its search.
While the Bridge is on, the game keeps running even when its window is behind another one, so the graph answers straight away.
The [Bridge] OpenPageIn setting picks where it opens. On the Mods screen it's under Drag'n Wash ModFramework: Bridge → Settings → Open the code graph in.
| Value | Where |
|---|---|
App (default) |
On Windows, CodeGraph.exe, a window of its own. It's in the Bridge's CodeGraph folder. |
Browser |
Your default browser. |
If the app isn't there, or you're not on Windows, it always opens in the browser. The browser link signs you in by itself and works once, within a minute. If it's expired, just open the graph again from the F1 window. On the Steam Deck it opens in Desktop Mode's browser (that hasn't been tried yet).
CodeGraph.exe shows the same page as the browser, in a window of its own.
- Every 3 seconds it checks that the game answers. While the game is closed it shows Waiting for the game, and when the game comes back it signs in again by itself, at the method it was showing.
- There's only one window. Pressing Graph again while it's open shows that method in the same window and brings it to the front.
- Keep on top (a button in the page's header, only in the app) keeps the window above the game and other windows.
- It remembers its size and position, Keep on top, the width of the details and whether the results are folded. Its title bar goes dark when Windows' apps are dark.
- Steam doesn't count it as part of the game, so closing the game doesn't leave Steam saying the game is still running.
- Only the Bridge's page loads in it.
Along the header, from left to right, are Results, ← / →, the search box, Fit and, in the app, Keep on top. Under it are three columns: the results, the graph and the details.
- To search, type part of a type or method name (for example
DragonorUpdate). Enter searches right away. Click a result to open it. - ← and → go back and forward through what you've opened.
- To move around the graph, drag the background to pan, turn the mouse wheel to zoom, or use the arrow keys. Fit (or the F key) fits the graph to the window again.
- Click a block to mark it in the IL, over in the details.
- The details show the method's type and signature, plus tags for its assembly, Unity message, coroutine or async, and patched. You also get Whole type (the type view), Patches on it, Called by (click a caller to open it), Events that lead here, and the IL block by block, scrolled so the marked block is in view. For a coroutine's hidden method, Open the coroutine's method takes you back to the method that starts it. In a coroutine, the dashed purple edges are where it resumes after a
yieldor anawait. - To change the width of the details, drag the line between the graph and the details (or focus it and use the left and right arrow keys). The width is remembered.
- The Results button folds or shows the results column, and that's remembered too.
New token, Disconnect all and turning the Bridge off all sign the page out. If that happens, open it again from the F1 window.
-
The page only, never MCP. Only the page (and the console's
op) can read the graph. AI clients connected to the Bridge over MCP (Bridge) never see it, so the game's code stays on this computer. - Structure, not source. There's no C# decompilation (that's still a job for dnSpy and ILSpy). The page shows the structure: blocks, calls, fields and patches.
- Nothing leaves the computer. The game's code is Gator Dragon Games' work. None of it is written to a file or sent anywhere except to the page on this computer, and the page itself loads nothing from the internet.
Design: docs/CODE_GRAPH.md.
Players
Mod authors
- Getting started
- Playing well with others (the guide)
- Going online
- Installer
- Mod reload
- Overrides (no code)
- Graphs (no code, makes things happen)
Tools (F1, developer tools)
- Inspector
- Console
- Code graph
- Bridge (AI clients, MCP)
API
日本語
- ホーム
- プレイヤー向け · ランチャー · FAQ · クラッシュレポート
- はじめての Mod · ほかの Mod と一緒に動かす · 外と通信する Mod · インストーラー · Mod の再読み込み · Overrides · Graphs
- Inspector · Console · コードのグラフ · Bridge
- 中核 API · 操作の登録簿 · Text · Dialogue · Tool window · Assets · Flags and saves · GameEvents · SettingMeta
Links
- Repository
- Releases
- Changelog
- Design records: DESIGN · ROADMAP · CONTENT_POLICY