Skip to main content

Studio Dock

A Studio dock is a panel in your game where a player works on their own mods and Mod Scripts with the Studio agent: they pick a project, the agent edits it, and the player runs it on their grid. This page is the platform side of such a dock. Your game draws the panel and hosts the agent's page. The SDK makes the calls, and each one answers or refuses plainly.

Every call is the signed-in player's own, made with their app token, and nothing is cached. Each is latent: On Done or On Failed fires once, on the game thread, never inside the call. Your module needs CrowdyServices in its Build.cs. Grid ids are 64-bit: keep them as Integer64 in Blueprint and int64 in C++.

Boot the agent​

The Crowdy Studio Agent subsystem (UCrowdyStudioAgent, a Game Instance subsystem) lives under Crowdy SDK > Studio.

BlueprintC++Does
Get Agent BootGetAgentBoot(OnDone)What the page hosting the agent needs: App Id, Graph QL Url, Model Base Url, Connect Origins, Studio Origin, Wallet Url and Models, the models the app allows, with their prices. It holds no token. It answers No Model when no model is available to the app.
noneGetAgentToken()The app token to hand to the agent. Empty while signed out.
noneOnAgentTokenChangedFires with the user id and the new token after a token rotation and after each sign-in, and with an empty token on sign-out.
On Agent Boot ChangedOnAgentBootChangedThe SDK's API origin moved, so the boot material is stale. It is noticed when the app token changes and when the boot material is read.

Connect Origins lists every origin the agent may connect to. Put nothing else in the page's connect-src. The token hand-off is C++ only, so no Blueprint graph can read it, and it is never the session token. Studio Origin and Wallet Url come from the platform. If its links are missing or not https, they come from the Studio the API address implies: ck.<root> gives studio.<root>, and a local API's Studio is on port 3001. Only https links are handed out (http to this machine works outside a Shipping build). With no Studio address at all, the boot answers Refused. Wallet Url is where the player adds funds, so open it in their own browser.

BlueprintC++Does
Get Consent NoticeGetConsentNotice()The SDK's notice text: what reaches the model provider, who pays, and where sessions stay. Show it before asking.
Get Provider ConsentGetProviderConsent(OnDone)Whether the player consented to provider data use for this app: Consented and Consented At Ms.
Record Provider ConsentRecordProviderConsent(OnDone, bConsented)Records the consent after the player saw the notice. Consented false takes it back.
Get Model UsageGetModelUsage(OnDone)Who pays (Unknown, Player, App or Platform), today's requests, today's charge and the day's limit, in millionths of a US dollar.
Authorize Live ModdingAuthorizeLiveModding(Action, OnDone)Asks the app's Allow Live Modding switch whether a Draft Test or a Live run may go ahead. Allowed is false unless Result is Success.
Call Authorize Live Modding before every run.

Only Authorize Live Modding checks the app's Allow Live Modding switch. Run Project, Build Client Mod, Deploy Client Mod and the platform's build and deploy calls do not. A Draft Test is a real deploy on the player's grid, not a dry run.

A Studio call ends with one of these results; in Blueprint a result other than Success arrives on On Failed.

ResultMeans
SuccessDone.
Not Signed InThe player has no app token yet.
DeniedA missing permission such as use_studio_agent, or the app's agent policy. Message names which.
Not FoundNo such project or model.
RefusedAny other refusal, the platform's or the SDK's before sending.
FailedThe request did not complete, or the platform could not confirm the model provider's policy. Try again.
Bad ReplyThe answer was malformed, so nothing from it is returned.
Not BuiltThis SDK version does not carry the call yet, so nothing was sent.
No ModelGet Agent Boot only: no model is available to the app, from its agent policy and the platform's together, so the agent cannot start. The app's operator or the platform fixes it, not the player.

Studio projects​

The Crowdy Studio Projects subsystem (UCrowdyStudioProjects, a Game Instance subsystem) reads and creates the player's Studio projects in this app.

BlueprintC++Does
List Studio ProjectsListProjects(OnDone)The player's projects, newest first, up to 50 a call, archived ones left out. More is true when the platform holds others.
Get Studio ProjectGetProject(ProjectId, OnDone)One project read fresh, with its Files ordered by target and path.
Create Studio ProjectCreateProject(Name, Kind, OnDone)A new project of that Kind, filled from the platform's starters.

A project has a Project Id, Name, Source (Studio, or GitHub when a bound repository is the working tree), Kind, Server Module, Client Module, Grid Id (0 when none) and Revision. The revision is an opaque token that changes whenever the source does: hand it back as it is. For a GitHub project it is the revision joined to the commit as revision@sha. A file has a Target, a Path (Cargo.toml, README.md or a Rust file under src/), its Content and its own Revision.

Kind says which halves the project has: Server (a server mod only), Client (a Mod Script only, riding the platform's starter mod), Paired (both, which run only together) or Independent (both, either of which may run alone).

Create Studio Project names the modules from Name: the server module is its lowercase slug, and the client module is the slug plus -client, so a client module never shares a name with a server mod. A name with no ASCII letters or digits is refused. In C++ an overload takes the module names too: 1 to 48 lowercase letters, digits, - and _, different from each other. Every half the kind has needs a name, and a name for a half it does not have is refused.

The server half starts from the platform's starter, and the client half from its client starter, with the package named for the client module. If the platform does not serve the client starter, the SDK uses its own copy of the same crate. If the platform refuses a starter, or it does not arrive, the create fails with the platform's reason.

Run a project​

Run Project builds one revision of a project and puts it on one of the player's grids. Pass the revision your panel showed the player as Expected Revision. It, Get Project Status and the two pieces below need Application API v2.73.0; an older one refuses them with GRAPHQL_VALIDATION_FAILED.

BlueprintC++Does
Run ProjectRunProject(GridId, ProjectId, ExpectedRevision, Mode, OnDone)Builds and deploys exactly that revision on the grid.
noneRunProject(GridId, ProjectId, ExpectedRevision, Mode, ExpectedServerModule, ExpectedClientModule, OnDone)The same, and answers Revision Changed before building when the project's server or client module name is not the one given, since those names pick the mods the run overwrites. An empty name is not checked.
Get Project StatusGetProjectStatus(GridId, ProjectId, OnDone)Where each half of the project is on the grid.

A run goes in this order:

  1. The client half is built first, so a build that fails publishes nothing.
  2. The server half is built, deployed and switched on.
  3. The client half is attached to its mod, and consented to as its author.

A client-only project rides a mod named for its client module. That mod is deployed from the platform's starter when the grid has none, and the run is refused when it exists and is switched off.

The run is pinned. An empty Expected Revision, a grid id below 1 and a signed-out player are refused before anything is sent. If the saved revision, or in the C++ overload a module name, is not the one you passed, the answer is Revision Changed and nothing was built. A GitHub project's revision includes its commit. Each build a run sends names the project and revision, so the mod and its client half read back with that Studio Project Id and Studio Revision. One run per app runs at a time: a second answers Busy. A run keeps to its grid and to the player and app it started for. If either changes, it answers Failed and sends nothing more, though a step it already sent may still complete on the grid.

Result is Success when the run went to its end. A crate that does not compile is still Success, with that half's Phase at Build Failed, so read the phases. The answer holds:

FieldIs
Mode, Grid Id, Project IdWhat the run was for.
RevisionThe revision built, always the one asked for.
TargetsEach half the project has, server first: Target, Phase, Module, Mod Id, Digest, Version, Running Revision, Saved Revision and Message.
Build LogThe compiler's output for every half built, at most 64 KB each with the end kept.
DiagnosticsMessages about project files, such as compiler errors: Target, Source (rustc, Local or Runtime), Path, Line, Column, End Line, End Column (0 when there is no end), Severity, Message and Code. Lines and columns count from 1.

A half's Phase is Not Started, Building, Build Failed, Deploying, Deploy Failed, Deployed or Running. Deployed means it is deployed but not running now, and Message says why.

Get Project Status reads the platform back every time, so it needs no earlier run. It answers Run In Flight (a run of this project is still going), and the same targets. Saved Revision is the project's saved revision when it was read. Running Revision differs by half:

  • Server: the revision the platform says its mod was built from. It is empty when the mod was built from another project or from none.
  • Client: the revision a run deployed since this game started. It shows only while the platform still serves that run's digest, since the platform names no revision for a client half.

A GitHub project's older revision reads as the platform's number alone, without its commit.

The pieces of a run​

Build Client Mod builds one client crate and waits for it, as Build Mod does, with the same limits. Deploy Client Mod attaches a successful client build as a mod's client half on one of the player's grids; the mod must exist. Both are building blocks with no run lock, no pinned revision and no Allow Live Modding check. A dock uses Run Project instead.

Run results​

Mods lists the mod results. Two more come with a run:

ResultMeans
BusyAnother run for this app is still going, or the platform is already building one for this player. Try again once it ends.
Revision ChangedThe project's saved revision or module names are not the ones asked for, so nothing was built.

Grid channels and script logs​

List Grid Channels (UCrowdyClaims::ListGridChannels(GridId, OnDone), under Crowdy SDK > Claims) answers the channels a grid owns, oldest first. A grid id of 0 or less is refused without sending. A row that is not one of the grid's own fails the whole list as Bad Reply. It answers with the Chunk Claims results.

Get Script Status and Get Script Log read the Mod Scripts running for the player. Both answer Not In Grid unless the grid is the one the player stands in.

From C++​

Each C++ callback runs once on the game thread. If the game instance ends first it does not run, and a step a run already sent may still complete. The types behind the calls:

TypeIs
FCrowdyStudioAgentBoot, FCrowdyStudioConsent, FCrowdyStudioModelUsage, FCrowdyStudioLiveModdingThe agent's answers. Each holds a Result (ECrowdyStudioResult) and a Message.
FCrowdyStudioModelOne model the agent may use: ModelId, Name, ContextWindow (tokens, 0 when not given), InputModalities, and its prices in millionths of a US dollar per million tokens: InputMicroUsdPerMillion, OutputMicroUsdPerMillion, ReasoningMicroUsdPerMillion and CachedInputMicroUsdPerMillion (0 when not given).
FCrowdyStudioProjectOne project: ProjectId, Name, Source, Revision, Kind, ServerModule, ClientModule, UpdatedAtMs, GitHubSha, GitHubRef and GridId.
FCrowdyStudioProjectFileOne file: Target, Path, Content and Revision.
FCrowdyStudioProjectList, FCrowdyStudioProjectInfoThe answers to list, and to get and create.
ECrowdyStudioRunMode, ECrowdyStudioTargetDraftTest or Live; Server or Client.
ECrowdyStudioPayer, ECrowdyStudioProjectKind, ECrowdyStudioProjectSourceThe enums described above.
FCrowdyModRun, FCrowdyModProjectStatusThe answers to a run and a status read, each with an ECrowdyModResult.
FCrowdyModRunTarget, ECrowdyModRunPhaseOne half of a run, and its phase: NotStarted, Building, BuildFailed, Deploying, DeployFailed, Deployed, Running.
FCrowdyModDiagnostic, ECrowdyModDiagnosticSeverity, ECrowdyModDiagnosticSourceOne message about a project file; the severity is Error, Warning, Info or Hint, and the source is Rustc, Local or Runtime.
FCrowdyModClient, FCrowdyModClientInfoA mod's client half on a grid, and the answer to Deploy Client Mod. A client half has ModId, GridId, Name, OwnerUserId, ClientVersion, Digest, SizeBytes, CapabilitySummaryJson, CapabilityHash, TickIntervalMs, UpdatedAtMs, and the StudioProjectId and StudioRevision it was built from (empty when its build named none).
UCrowdyGetAgentBoot, UCrowdyGetProviderConsent, UCrowdyRecordProviderConsent, UCrowdyGetModelUsage, UCrowdyAuthorizeLiveModding, UCrowdyListStudioProjects, UCrowdyGetStudioProject, UCrowdyCreateStudioProject, UCrowdyBuildClientMod, UCrowdyDeployClientMod, UCrowdyRunProject, UCrowdyGetProjectStatusThe nodes. C++ calls the subsystems instead.
FCrowdyStudioBootAsyncResult, FCrowdyStudioConsentAsyncResult, FCrowdyStudioUsageAsyncResult, FCrowdyStudioLiveModdingAsyncResult, FCrowdyStudioProjectAsyncResult, FCrowdyStudioProjectListAsyncResult, FCrowdyModClientInfoAsyncResult, FCrowdyModRunAsyncResult, FCrowdyModProjectStatusAsyncResultThe delegate types of the nodes' pins.
FOnCrowdyAgentTokenChanged, FOnCrowdyAgentBootChangedThe delegate types of OnAgentTokenChanged (C++ only) and OnAgentBootChanged.