Skip to content

Code graph

Tom_XV edited this page Sep 19, 2026 · 3 revisions

English | 日本語

Experimental, not released yet: on main, in the next release.

The code graph shows the game's code as a drawing: a method's blocks and branches, what it calls, the fields it reads and writes, whose patches sit on it and which events lead to it. Clicking a call opens that method. It is for people who make mods and want to know where to hook and what else a method touches, without dnSpy. It is the Inspector's Code view, drawn instead of listed.

It is a page served by the Bridge on this computer, shown in its own window on Windows or in your browser.

What it shows

For one method:

  • Blocks: the method's basic blocks, in order. Each block says what it does in words: the calls it makes, the fields it reads and writes, what it compares, what it returns or throws.
  • Branches: arrows between blocks, labelled true / false, case n, loop back, catch, finally.
  • Calls: every called method, listed in the block that calls it. The game's methods open on click; Unity's and .NET's are shown but not opened.
  • Callers: which of the game's methods call it. Callers that reach it through a base method are listed too, marked through that method.
  • Patches: the Harmony prefixes, postfixes, transpilers and finalizers on it, with the mod that owns each (the name the Mods screen shows, not only the Harmony ID).
  • Events: the UnityEvent listeners in the loaded scenes, and the Unity messages, that lead to it.
  • Coroutines: a coroutine or async method is drawn through the hidden class the compiler makes for it, as the method's body; each yield or await is a labelled edge.

For one type (the type view): its methods, grouped (Unity messages such as Update, public, private), with the calls between them. Clicking one opens it.

Drawn: the game's own code and that of its studio and authors' libraries. Not drawn: Unity's, .NET's, bundled libraries, and mods' own code (a mod shows up as its patches).

Opening it

You need:

  • Developer tools on (Options → Mods → Drag'n Wash ModFramework).
  • The Inspector and the Bridge libraries installed, and the Bridge turned on: Turn on in the Bridge tab of the F1 window (or bridge on in the Console). Without it, the Graph buttons say the graph needs the Bridge.

Then, in the game:

  • F1 → Inspector → select an object → a component → Code → Graph on a method. Graph appears on the game's own methods only.
  • 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 written Namespace.Type::Method(ParameterType,...).
  • op bridge.page.open focus=t:<type> opens a type.
  • op bridge.page.open with no focus opens the page on its search.

While the Bridge is on, the game keeps running when its window is behind another one, so the graph answers at once.

Where it opens

The setting [Bridge] OpenPageIn (on the Mods screen: Drag'n Wash ModFramework: Bridge → Settings → Open the code graph in) chooses:

Value Where
App (default) On Windows, CodeGraph.exe, a window of its own, in the Bridge's CodeGraph folder.
Browser Your default browser.

Without the app, and off Windows, it always opens in the browser. The browser link signs in by itself and works once, within a minute; if it has expired, open the graph again from the F1 window. On the Steam Deck it opens in Desktop Mode's browser (not tried yet).

The app (Windows)

CodeGraph.exe shows the same page as the browser, in a window of its own.

  • Waiting for the game: it checks every 3 seconds 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.
  • One window: pressing Graph again while the window is open shows that method in the same window and brings it to the front.
  • Keep on top (a button in the page's header, in the app only) keeps the window above the game and other windows.
  • It remembers its size and place, Keep on top, the details' width and whether the results are folded. Its title bar is dark when Windows' apps are.
  • Steam does not count it as part of the game: closing the game does not leave Steam saying the game is still running.
  • Only the Bridge's page loads in it.

Using the page

The header holds, left to right: Results, ← / →, the search box, Fit and, in the app, Keep on top. Below it are three columns: the results, the graph and the details.

  • Search: type part of a type or method name (for example Dragon or Update); Enter searches at once. Click a result to open it.
  • Back and forward: ← and → go through what you opened.
  • 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.
  • A block: click it to mark it in the IL, in the details.
  • Details: the method's type and signature; tags for its assembly, Unity message, coroutine or async, and patched; 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, the marked block scrolled into view. For a coroutine's hidden method, Open the coroutine's method goes back to the method that starts it. In a coroutine, dashed purple edges resume after a yield or an await.
  • Details width: drag the line between the graph and the details (or focus it and use the left and right arrow keys). The width is remembered.
  • Results: the Results button folds or shows the results column; that is remembered too.

New token, Disconnect all and turning the Bridge off sign the page out; open it again from the F1 window.

Privacy

  • The page only, never MCP. The graph can be read only by the page (and the console's op). AI clients connected to the Bridge over MCP (Bridge) never see it: the game's code stays on this computer.
  • Structure, not source. No C# decompilation (that stays with dnSpy and ILSpy). The page shows the structure: blocks, calls, fields, patches.
  • Nothing leaves the computer. The game's code is Gator Dragon Games' work. Nothing of it is written to a file or sent anywhere but to the page on this computer; the page itself loads nothing from the internet.

Design: docs/CODE_GRAPH.md.

Clone this wiki locally