REDnode is a Node-based API for scripting Cyberpunk 2077, built on the same injection points that RED4ext, Cyber Engine Tweaks and redscript already use. Asynchronous mods run in a normal Node process. A small sandboxed tier runs inside the game for the few cases that must change a value mid-call.
fs, require and a live event loop.Checked against the install on this machine. Two independent injection points are already in use, so a new framework can attach to either.
| Component | How it attaches | Seen on this install |
|---|---|---|
| Ultimate ASI Loader | Proxy version.dll that loads every .asi in bin/x64/plugins/. | v6.0.0. Loads cyber_engine_tweaks.asi. |
| RED4ext | Proxy winmm.dll loads red4ext/RED4ext.dll, which loads red4ext/plugins/*/*.dll. | v1.30.0. Plugins: ArchiveXL, Codeware, RedData, mod_settings, input_loader. |
| Cyber Engine Tweaks | In-process Lua runtime with reflection access to game types and an ImGui overlay. | Closest precedent for an embedded scripting runtime. |
| redscript | Compiles .reds files into the game's script bytecode at launch. Not a runtime embed. | Many mods under r6/scripts/. |
| REDmod | Official CDPR deploy tool for archives, tweaks, scripts and audio. No injection. | redMod.exe present, mods/ empty. |
.reds files. Mod authors already expect that packaging shape.| Plan | Approach | Strengths | Weaknesses |
|---|---|---|---|
| A | Embed Node in a RED4ext plugin or .asi. | Closest to CET. JS runs inside hooks as plain function calls. | 30 to 80 MB runtime. Event loop and threads inside a DX12 game process. Hard to keep stable. |
| B | Thin native RED4ext plugin plus a separate Node process over IPC. | Crash isolation. Normal npm tooling. Easy hot reload. Small native surface to maintain. | No synchronous access from hooks. Round-trip latency on every call. |
| C | Embed QuickJS only. | About 1 MB. Fast start. Easy to sandbox. | Not Node. No npm ecosystem. |
A hook runs inside the game's own function call, on the game thread, and the game waits for it to return. If the logic lives in another process, the hook must block on a round trip. That costs roughly 50 to 200 µs when healthy and much more when Node is busy. A 60 fps frame has about 16 ms, and hooks such as damage or per-frame ticks can fire thousands of times a frame. If the Node process crashes or hangs, the game thread blocks until a timeout.
| Pattern | Plan B |
|---|---|
| Notify: "the player took damage" | Works. The hook enqueues an event and returns. |
| Query: "what is the player's health?" | Works. Node awaits the answer. |
| Command: "set health to 100" | Works. Queued and applied on the game thread next tick. |
| Intercept: change a value before the call continues | Does not work well. Needs a synchronous answer while the game waits. |
Keep Plan B as the main path. Add a small in-process tier for interceptors only. A mod can ship either tier or both.
await, no I/O, no require.| Engine | Size | Notes |
|---|---|---|
| Full Node / V8 | 30 to 80 MB | Brings back every problem of Plan A. Not recommended for interceptors. |
| Bare V8 isolate | 10 to 30 MB | Same JS dialect as Node. Fast. No Node APIs. Heavier to ship. |
| QuickJS | about 1 MB | Recommended. Small, easy to sandbox and to time-limit. TypeScript is compiled ahead of time. Slower than V8, which is fine for tiny functions. |
Tier 1 shares TypeScript types with Tier 2 but is not Node. The documentation must say so plainly.
For the simplest cases, such as "multiply incoming damage by X", offer a no-code rule that the native plugin applies directly in the hook. It needs no JS engine and no IPC, and it covers a large share of real mods.
export default defineInterceptor({ target: "PlayerPuppet.OnDamageReceived", run(ctx) { ctx.args.damage *= ctx.params.multiplier; // pushed from Tier 2 } });
import { game } from "rednode"; game.on("PlayerPuppet.OnDamageReceived", async (e) => { await db.log(e); // fine, the game is not waiting game.player.setHealth(100); // queued, runs next tick }); const hp = await game.player.getHealth(); // async query interceptor("damage-scale").set("multiplier", 0.5);
CName, Vector4, handles, arrays) to and from JSON-like values.Proposed on 2026-10-18, not scheduled. The game draws its own UI with ink: a tree of widgets (inkCanvasWidget, inkTextWidget, inkImageWidget and so on) with logic controllers for behavior (inkButtonController, inkSliderController and so on). redscript mods build their menus and HUD parts into that tree. REDnode should let JavaScript and TypeScript mods do the same, with a set of tags and an ink API in the rednode package.
Neither of REDnode's two UI paths is ink. Overlay apps write HTML, and the ui builder lets Node mods describe a window as a tree of nodes. Both are drawn by Chromium in the overlay host, and the plugin composites the picture over the game's frame. The game's UI never sees them. The "Native button" sample is an HTML window styled like the game, not ink.
Overlay (HTML apps, ui) | Ink (proposed ink) | |
|---|---|---|
| Drawn by | Chromium offscreen; the plugin composites it over the frame | The game's renderer, inside its own UI |
| Look | The REDnode UI kit, or any web content | The game's fonts, styles and library widgets |
| HUD hiding, photo mode, UI scale, HDR | REDnode follows them by hand (the HUD widget rules) | Follows them as the game's own UI does, by layer (unverified) |
| Input | F10 Using mode with REDnode's cursor | The game's cursor in menus; none on the HUD in gameplay (open question) |
| Cost | A Chromium process and its textures | Widgets in the game's tree, no extra process |
| Reach | Anything a web page can do | Ink widgets and the game's library items only |
The generic game API (rtti.call, api in the package) can already call ink functions one at a time. inkCompoundWidget.AddChild returns a reference, and SetText works on it. With Codeware, a Node mod could reach the HUD layer and add raw widgets. That is unverified: nobody has tried it. Five things are missing: a root to attach to without Codeware, events, ownership and cleanup, a rebuild after a save load, and speed. Each call is one round trip, and a styled panel of 40 widgets takes hundreds of calls.
Checked in REDnode's base-game RTTI dump for game 2.31 (gameapi/2.31/rtti.json) and in the installed Codeware's scripts.
| Part | Classes and functions |
|---|---|
| Containers | inkCanvasWidget, inkVerticalPanelWidget, inkHorizontalPanelWidget, inkFlexWidget, inkGridWidget, inkUniformGridWidget, inkScrollAreaWidget |
| Leaves | inkTextWidget, inkRichTextBoxWidget, inkTextInputWidget, inkImageWidget, inkRectangleWidget, inkCircleWidget, inkShapeWidget, inkBorderWidget, inkMaskWidget, inkVectorGraphicWidget, inkVideoWidget |
| Controls | No button widget exists. A game button is a compound widget, from a library resource, with a controller attached: inkButtonController, inkSliderController, inkListController, inkScrollController, inkSelectorController, inkStepperController, inkRadioGroupController, inkComboBoxController |
| Building | inkCompoundWidget.AddChild(type), RemoveChild, ReorderChild. From a logic controller, SpawnFromExternal(parent, resource, libraryID) spawns the game's own library items, with their controllers and styles |
| Events | inkWidget.RegisterToCallback(event, object, function) calls a function on a script object: OnPress, OnRelease, OnHoverOver, OnHoverOut, and the controllers' own callbacks, such as a slider's value change |
| Roots | Base-game scripts reach a root only from inside a controller (GetRootCompoundWidget); gameuiRootHudGameController owns the HUD. Codeware adds GameInstance.GetInkSystem().GetLayer(n"inkHUDLayer").GetVirtualWindow() and AttachController |
| Names | The dump uses native names, and redscript renames some of them: gameuiWidgetGameController is inkGameController in redscript, and inkWidgetLogicController is inkLogicController. Mods using the tags see neither |
The first phases need neither Tier 1 nor a new engine in the game; frame drawing adds Tier 1 later (below). The work splits between the native plugin and Tier 2:
ink API (Node, TypeScript)UI needs very few synchronous answers. Wherever the game would wait, the answer can be declared in the tree ahead of time, the same way Tier 2 pushes parameters to an interceptor:
| Need | How it works without a synchronous call |
|---|---|
| Build or change the UI | Commands, batched and applied on the next frame |
| Click, hover, value change | An event goes out and the handler runs in Node. Its changes apply one or two frames later |
| Hover and pressed looks | Ink states and styles declared on the node; the engine switches them with no round trip |
| Animation | An ink animation (inkanimDefinition) declared on the node and played by the engine |
| A value every frame, such as a health bar | A binding the plugin reads each frame, like a declarative rule; or the mod sets the value at its own rate |
| Keep the game from also acting on a click | A consume flag on the node, applied by the plugin when the event fires |
Phases I1 to I5 need no Tier 1. Frame drawing does, and comes in a later phase (I6, agreed with the user on 2026-10-18): richer animations and cosmetic effects on screens and widgets, computed every frame. A Tier 1 draw function runs on the game thread each frame, inside the same sandbox and time budget as an interceptor. It changes its package's own widgets directly, with no round trip: opacity, translation, rotation, scale, tint, shape points and effect parameters. Tier 2 pushes it parameters, as it does for interceptors.
export default defineFrame({ target: "bounties", // a screen or mounted tree of this package draw(f) { f.widget("glow").opacity = 0.5 + 0.5 * Math.sin(f.time * f.params.speed); f.widget("scan").translation.y = (f.time * 120) % f.height; } });
| Tag | Ink |
|---|---|
canvas, vbox, hbox, flex, grid, scroll | The containers above; scroll adds inkScrollController |
text, richtext, input | inkTextWidget, inkRichTextBoxWidget, inkTextInputWidget |
image, rect, circle, border, mask, vector, video | The leaves above. image takes an atlas and a part, or a TweakDB icon |
button, slider, list, selector, stepper, radio, combo | The game's library items with their controllers, so they look and sound like the game's own |
library | Any item of a game .inkwidget library, by resource path and item name |
widget | The escape hatch: any ink class by name, with raw properties |
One tree format, written three ways. In .tsx files the tags are JSX, which TypeScript compiles with REDnode's factory and checks against generated types. Plain JavaScript can write the same tags in a tagged template, or call the functions, which mirror the ui builder. A tree mounts on a layer: hud (display only; hides with the HUD), menu (inside the game's menus, with the game's cursor), and later world (in-world screens through IWorldWidgetComponent). The layers are unverified.
import { ink } from "rednode"; const board = ink.mount("hud", { anchor: "top-right", x: -40, y: 120 }, <vbox gap={6}> <text style="title">Bounty board</text> <text bind="player.health" /> // read by the plugin every frame <list items={contracts} item={(c) => <text>{c.name}</text>} /> </vbox>); ink.mount("menu", { menu: "pause" }, <button label="Track contract" consume onClick={() => track()} />); // event, async board.update(...); // diffed, only changes are sent
ink.mount("hud", { anchor: "top-right" }, ink.vbox({ gap: 6 }, ink.text("Bounty board", { style: "title" })));
Modders are not engine developers. A modder should write what they want, not how ink builds it. If the engine takes ten lines to place a button, the modder writes one tag with a few properties. Ink is a low-level kit. REDnode adds the layer a UI toolkit has and ink lacks.
<button label="Track" onClick={track} />
The look, sounds, hover state, controller navigation and cleanup come with it.
| Area | What ink has | What REDnode gives the modder |
|---|---|---|
| Layout | Anchors, margins, paddings, size rules and alignments, set one by one on each widget and panel | row, column, stack and grid with gap, pad, align and sizes such as fill, auto or 40%. Placement relative to the screen's safe area |
| Look | Style resource paths, font family paths, colors as numbers | Theme words: style="title", tone="danger", and the game's palette by name (red, cyan, yellow). Defaults that already look like the game |
| Composite widgets | Primitives and a few controllers | Ready pieces: panel (the game's frame with a title), tabs, dialog and confirm (modal; Back closes), tooltip on any node, table and list from an array (long lists only draw what shows), toggle, progress, icon, keyhint (the right key or pad glyph for the player's input), menu, slots (an inventory-style grid), notify |
| Handlers | A script object and a function name per event, registered and unregistered by hand; raw ink events | Plain functions with plain values: onClick (mouse, pad button or Enter), onHover, onChange(value), onHold. Removed with the node |
| Data and state | Widgets changed one by one through references | Trees made from data. Change the data, and the API sends only what changed. Nodes are named with id, not held as references. bind to game values |
| Controller and keyboard | Navigation set up per screen | Focus order worked out from the layout, so pad and arrow keys work by default |
| Sounds | Played by name, per event | The game's hover and click sounds by default; a property to change or mute them |
| Lifecycle | Widgets live until removed; they vanish on a save load | Mount and unmount; removed when the package stops; rebuilt after a load; screens handle pause and Back |
| Your own pieces | Library resources made in an editor | Components as plain functions: a modder's <BountyCard> is a function that returns tags. REDnode's own composites are written the same way, so modders can read them and copy the pattern |
| Escape hatch | Everything | The widget tag and ink.raw(id), which give the real ink widget to the api for what the tags do not cover |
Most of this layer lives in Tier 2. Composites expand into primitives inside the package before anything is sent, so they hot reload and modders can read their source. Only what needs the engine sits in the plugin's driver: focus navigation, sounds, input glyphs, measuring text, and pause and Back. The names and properties match the ui builder where the two overlap, so button, toggle and slider mean the same thing in an overlay window and in ink. A modder learns one vocabulary.
Localization covers all of REDnode, not only ink: its plan is on the Localization page. For ink, any text property, such as a button's label, a text or a tooltip, takes either a plain string or a key:
| Write | What it shows | Resolved by |
|---|---|---|
label="Track" | The string as it is | Nobody |
label="LocKey#12345" | The game's own text for that key, in the player's language. This is the form TweakDB records use, so a record's name works as it is | The engine: SetLocalizedText, so it follows a language change by itself |
label={t("bounty.track")} | The package's own text, from locales/<language>.json in its folder. A key the package lacks falls back to the game's secondary keys (t("UI-…")), then to English, then to the key itself | REDnode: sends it again when the language changes |
// locales/en-us.json locales/fr-fr.json { "bounty.reward": "Reward: {amount} €$", { "bounty.reward": "Récompense : {amount} €$", "bounty.thanks": { "m": "…", "f": "…" } } … <text text={t("bounty.reward", { amount: 500 })} />
{name} placeholders take values from the call. For game keys they become the engine's text parameters (textTextParameterSet), which can hold localized names too.m and f forms, picked by V's gender the way the game's own GetLocalizedTextGanderDepened does for its keys (body or voice tone: unverified).game.language() gives the interface language, using the game's names such as en-us and fr-fr, and an event fires when it changes. How the plugin reads it is unverified: the settings path, or the engine's language-changed event.ModLocalizationPackage.t() and LocKey# strings work in overlay windows (the ui builder and HTML apps), notifications and the Mod Manager's package names. There, REDnode looks game keys up with GetLocalizedText.Besides single widgets, mods need whole screens: open and switch the game's own full-screen menus (inventory, character, cyberware and the rest), and build new ones that behave the same way. A new screen should pause the game, take the game's cursor and Back key, and sit in the hub's row of tabs where that fits. The game does this with two pieces, both in the dump:
| Piece | What it is |
|---|---|
| Menu resource | inkMenuResource: a list of inkMenuEntry (a menu name, its widget library resource, depth, spawn mode and input context) and the scenario names. Codeware declares both for scripts |
| Scenarios | Scripted state machines that open, switch and close menus: MenuScenario_HubMenu (OpenMenu, SwitchMenu, OpenSubMenu, OnBack), plus PauseMenu, Vendor, Storage, Wardrobe, FastTravel and others. inkMenuScenario.SwitchToScenario(name, userData) moves between them |
| Opening one | A StartHubMenuEvent carrying HubMenuInitData (menuName, submenuName, userData), queued with GetUISystem().QueueEvent. Inside the hub, an OpenMenuRequest. The hub's tabs are the HubMenuItems enum: Crafting, Character, Inventory, Map, Journal, Phone, Database, Stats, Backpack, Codex, Shards, Gallery, Tarot, Gear, Cyberware, VisualSets |
Opening and switching the game's screens needs no new engine work. The API wraps these events, so a mod writes ink.screens.open("inventory"). The names map to the game's menu names, kept in one table. Screens that need context, such as a vendor or a stash, take it as an argument or are left out. The plugin also reports the open screen as an event, so mods can follow the player through the menus.
New screens need an entry in the menu resource, because a scenario can only open the menus listed there. The proposal is one generic entry: REDnode adds a single menu, rednode_screen, whose widget is an empty canvas with a REDnode controller. Every package screen opens that one entry, with userData naming the package and screen, and the ink driver builds the package's tree into the canvas. One entry serves every mod, so adding a screen never touches game files. How the entry gets in is unverified and is part of the spike:
| Way in | Notes |
|---|---|
| The plugin adds the entry to the loaded menu resource | No game files changed. Needs the resource in memory before the menu layer reads it |
A small REDnode .archive with the canvas widget and a patched menu list | The usual modding route. The widget file can be built with REDbridge (WolvenKit's engine). Patching the menu list may need ArchiveXL |
| Draw on the menu layer while REDnode holds the game in a menu state | A fallback with no menu entry. Pause, input and Back must then be handled by hand |
REDnode's scripts add their own scenario class, extending MenuScenario_BaseMenu, for screens outside the hub. Screens that belong in the hub open as hub menus, and a hub tab can be added by wrapping the hub's controller (MenuHubGameController), as redscript mods do.
ink.screens.open("inventory"); // a game screen ink.screens.on("change", (s) => log(s.name)); // which screen is open const bounties = ink.screen({ id: "bounties", title: "Bounties", hub: { tab: true, after: "Journal" }, // a tab in the hub's row }, <BountyBoard />); bounties.open(); // pauses, takes the cursor and Back bounties.on("back", () => bounties.close());
| Phase | What |
|---|---|
| I1 Spike | Reach a root on the HUD and in a menu, with and without Codeware. Add a text and a rectangle through rtti.call. Have a listener class in REDnode's scripts receive OnRelease. Measure how many calls fit in a frame. Read a live screen's tree (for Dump source). Open the inventory with a StartHubMenuEvent, and try adding a menu entry to the loaded menu resource. Check the script changes with redscript-cli first |
| I2 Display | The driver: kept trees, batched changes, cleanup per package, rebuild on load. ink.mount on hud with the containers, text, images, shapes and bindings. The layout words (row, column, gap, pad, align), theme words, data-driven trees and id. Localization: LocKey# strings, t() with package locale files, parameters, V's gender forms, the language and its change event. Sample: an ink version of Coords HUD |
| I3 Input | Buttons, sliders, lists, toggles and text input on the menu layer. Plain handlers, consume, focus order for pad and keys, default sounds, and an answer to the cursor question |
| I4 Game look | The game's library items, styles, states and animations. The composites: panel, tabs, dialog, tooltip, table, keyhint, slots. JSX typings and the docs page, with a gallery of every tag. Dump source (proposed 2026-10-22): write an open game screen as REDnode tags, as a starting point for a modder's own; a primitives-only version can come with I2 (plan) |
| I5 Screens | Open and switch the game's screens, and report the open one. The rednode_screen entry and REDnode's scenario. ink.screen for new screens, with pause, cursor and Back. Hub tabs |
| I6 Frame drawing | Tier 1 defineFrame: a draw function each frame for animations and cosmetic effects on a package's own widgets, with Tier 1's time budget and fault handling. Comes with or after P4, which builds the Tier 1 runner |
ink API requires Codeware. REDnode's own hooks gave no full-screen HUD root (I1 results).rednode_screen entry (above)? Can a new hub tab coexist with other mods that wrap the hub? Which game screens can open without context?A buggy interceptor must never crash or freeze the game.
Each call is time-limited. On overrun, return to default game behavior.
Catch exceptions, fall back to defaults, and auto-disable an interceptor after repeated failures.
Define priority and chaining when several mods hook the same function.
Validate every write to ctx.args against the real parameter types before it reaches the game.
Read-only accessors and shared-memory reads only. No arbitrary game calls from a hook, to avoid reentrancy bugs.
Swap Tier 1 code between frames. Tier 2 reloads freely.
| Risk | Impact | Mitigation |
|---|---|---|
| Game patch breaks hooks | Mods stop working until the plugin updates. | Use the Address Library and RED4ext hooking. Never hard-code offsets. |
| Conflicts with other plugins | Double hooks, crashes. | Use RED4ext's hook API. Do not add a third loader. |
| Thread-safety bugs | Random crashes. | All game access goes through the game-thread queue. |
| IPC latency or stalls | Stutter. | Async by default. Fast-path rules and shared memory for hot paths. |
| Tier 1 scope creep | Maintenance load. | Build it last, only for hooks modders actually need. |
| Modding terms | Distribution limits. | Check CD Projekt and Nexus Mods terms before publishing. Single-player only. |
Read the RED4ext plugin entry points and the imports and exports of an installed plugin. Inspect how cyber_engine_tweaks.asi hooks and resolves addresses.
A RED4ext plugin that logs the RTTI class count. Confirms build, load and logging on the current game version.
Expose one function over a named pipe and call it from Node. Then events, queries, commands and generated types.
Native fast-path rules applied inside hooks with no IPC. Gives synchronous behavior with no engine.
Add the sandboxed runner, time limits, ordering and fault handling. Only after P2 and P3 show which hooks need it. Ink frame drawing (I6, section 06) is a second use of the same runner.
red4ext-rs (Audioware is a Rust precedent)?red4ext/plugins layout or its own folder?