# ctrhome/play architecture

> Architecture diagram of the GitHub repository ctrhome/play, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ctrhome/play
- Repository: https://github.com/ctrhome/play

## Overview

#### Purpose and Topology
This is a static deployment repository for multiple browser-playable Cut the Rope editions, not a unified application or source project. Each game is independently hosted beneath its own directory; the root `index.html` likely acts as the site entry/selector. Major editions are Energy, Experiments, Magic, Time Travel, and a tweaked original Cut the Rope build.

Paths: `index.html`, `cut-the-rope-energy/index.html`, `cut-the-rope-experiments/index.html`.

#### Independent Game Entrypoints
Each edition owns its HTML bootstrap and runtime payloads, so routing and asset paths must remain isolated. The Unity-based editions load through generated WebGL loaders; Time Travel has a bespoke JavaScript/WASM bootstrap; the original build is JavaScript-led.

Paths: `cut-the-rope-energy/Build/build6.loader.js`, `cut-the-rope-magic/Build/WebGL.loader.js`, `cut-the-rope-time-travel/ctrttboot.js`.

#### Unity WebGL Runtime Pipeline
Energy, Experiments, and Magic package game code as Unity WebGL artifacts. The page loads a loader script, which fetches compressed JavaScript framework/runtime code, WASM engine code, and a data payload. Browser-side WebAssembly is the execution boundary; no server-side game process is represented.

Paths: `cut-the-rope-energy/Build/build6.data.br`, `cut-the-rope-energy/Build/build6.framework.js.br`, `cut-the-rope-energy/Build/build6.wasm.br`.

#### Addressable/Streaming Content
Experiments and Magic separate core runtime from streamed Unity assets. Catalog/settings files resolve named or hashed bundles for scenes, level groups, visuals, audio, shaders, and UI. This is the main content-delivery boundary: modifying content references requires keeping catalog metadata and deployed bundle filenames consistent.

Paths: `cut-the-rope-experiments/StreamingAssets/aa/catalog.bundle`, `cut-the-rope-experiments/StreamingAssets/aa/settings.json`, `cut-the-rope-magic/StreamingAssets/aa/catalog.json`.

#### Gameplay Content Organization
Experiments distributes campaign scenes, level packs, reusable gameplay prefabs, animations, and popups as bundles. Magic similarly uses broad game/map/background/audio bundles. These are opaque generated artifacts rather than editable gameplay source in this repository.

Paths: `cut-the-rope-experiments/StreamingAssets/aa/WebGL/campaign_scenes_all_e661c3b1df5d2272179159cfa66ca210.bundle`, `cut-the-rope-experiments/StreamingAssets/aa/WebGL/levels_1_assets_all_a5291cb6d613efe8aaa502b7c947da45.bundle`, `cut-the-rope-magic/StreamingAssets/game_assets_all_d53f622c74af0f2c33203f5af2b71d18.bundle`.

#### Time Travel Runtime and Data
Time Travel is a separate compiled WASM game stack. Its bootstrap and JS glue load the WASM binary, with `fflate.js` likely supporting compressed asset handling. Levels are explicit XML map files, while `.pb` files appear to hold serialized visual/object/UI assets and OGG files hold audio. This edition has the clearest data-driven level boundary.

Paths: `cut-the-rope-time-travel/ctr-tt.js`, `cut-the-rope-time-travel/ctrtt.wasm`, `cut-the-rope-time-travel/assets/maps/allmaps.xml`.

#### Original/Tweaked HTML5 Build and Platform Integration
`tweak/cut-the-rope` is a standalone HTML5 build with a primary JavaScript runtime, JSON-defined level packs/sprites, localized resources, and media assets. Famobi manifests/interfaces and Microsoft Start interface scripts indicate host-platform SDK integration for lifecycle, ads, analytics, or portal APIs, though implementation behavior is inside bundled scripts.

Paths: `tweak/cut-the-rope/ctrr.js`, `tweak/cut-the-rope/res/box01/maps.json`, `cut-the-rope-experiments/famobi-game-interface.js`.

Main entry points: [`cut-the-rope-energy/Build/build6.loader.js`](https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/Build/build6.loader.js) (Energy Unity loader), [`cut-the-rope-experiments/index.html`](https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/index.html) (Experiments page), [`cut-the-rope-experiments/StreamingAssets/aa/settings.json`](https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/StreamingAssets/aa/settings.json) (Addressables catalogs), [`index.html`](https://github.com/ctrhome/play/blob/main/index.html) (Edition selector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Site shell"]
  node_root_index["Edition selector<br/>HTML entry<br/>[index.html]"]
end

subgraph group_unity["Unity WebGL editions"]
  node_energy_entry["Energy page<br/>HTML entry<br/>[index.html]"]
  node_experiments_entry["Experiments page<br/>HTML entry<br/>[index.html]"]
  node_energy_loader["Energy Unity loader<br/>WebGL loader<br/>[build6.loader.js]"]
  node_magic_loader["Magic Unity loader<br/>WebGL loader<br/>[WebGL.loader.js]"]
  node_unity_runtime{{"Unity browser runtime<br/>WASM execution"}}
  node_energy_data["Energy game data<br/>compressed data<br/>[build6.data.br]"]
  node_energy_framework["Energy framework<br/>compressed JS runtime"]
  node_energy_wasm["Energy WASM engine<br/>compressed WASM<br/>[build6.wasm.br]"]
  node_addressables["Addressables catalogs<br/>streaming metadata<br/>[settings.json]"]
  node_experiments_bundles["Experiments content bundles<br/>Unity bundles"]
  node_magic_bundles["Magic game assets<br/>Unity bundle"]
  node_famobi_interface["Famobi host interface<br/>platform SDK bridge"]
end

subgraph group_timetravel["Time Travel"]
  node_tt_bootstrap["Time Travel bootstrap<br/>JS bootstrap<br/>[ctrttboot.js]"]
  node_tt_glue["Time Travel JS glue<br/>runtime glue<br/>[ctr-tt.js]"]
  node_tt_wasm{{"Time Travel WASM<br/>WASM game engine<br/>[ctrtt.wasm]"}}
  node_tt_maps["Time Travel maps<br/>XML level data<br/>[allmaps.xml]"]
end

subgraph group_original["Tweaked original"]
  node_original_runtime["Original HTML5 runtime<br/>JavaScript game runtime<br/>[ctrr.js]"]
  node_original_levels["Original level packs<br/>JSON level data<br/>[maps.json]"]
end

node_root_index -->|"selects"| node_energy_entry
node_root_index -->|"selects"| node_experiments_entry
node_energy_entry -->|"loads"| node_energy_loader
node_energy_loader -->|"fetches"| node_energy_framework
node_energy_loader -->|"fetches"| node_energy_wasm
node_energy_loader -->|"fetches"| node_energy_data
node_energy_framework -->|"initializes"| node_unity_runtime
node_energy_wasm -->|"executes in"| node_unity_runtime
node_energy_data -->|"loads into"| node_unity_runtime
node_experiments_entry -->|"boots"| node_unity_runtime
node_magic_loader -->|"boots"| node_unity_runtime
node_unity_runtime -->|"resolves streamed assets"| node_addressables
node_addressables -->|"references"| node_experiments_bundles
node_addressables -->|"references"| node_magic_bundles
node_experiments_entry -.->|"integrates host SDK"| node_famobi_interface
node_tt_bootstrap -->|"loads"| node_tt_glue
node_tt_glue -->|"instantiates"| node_tt_wasm
node_tt_wasm -->|"reads levels"| node_tt_maps
node_original_runtime -->|"loads"| node_original_levels

click node_root_index "https://github.com/ctrhome/play/blob/main/index.html"
click node_energy_entry "https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/index.html"
click node_experiments_entry "https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/index.html"
click node_energy_loader "https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/Build/build6.loader.js"
click node_magic_loader "https://github.com/ctrhome/play/blob/main/cut-the-rope-magic/Build/WebGL.loader.js"
click node_energy_data "https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/Build/build6.data.br"
click node_energy_framework "https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/Build/build6.framework.js.br"
click node_energy_wasm "https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/Build/build6.wasm.br"
click node_addressables "https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/StreamingAssets/aa/settings.json"
click node_experiments_bundles "https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/StreamingAssets/aa/WebGL/campaign_scenes_all_e661c3b1df5d2272179159cfa66ca210.bundle"
click node_magic_bundles "https://github.com/ctrhome/play/blob/main/cut-the-rope-magic/StreamingAssets/game_assets_all_d53f622c74af0f2c33203f5af2b71d18.bundle"
click node_tt_bootstrap "https://github.com/ctrhome/play/blob/main/cut-the-rope-time-travel/ctrttboot.js"
click node_tt_glue "https://github.com/ctrhome/play/blob/main/cut-the-rope-time-travel/ctr-tt.js"
click node_tt_wasm "https://github.com/ctrhome/play/blob/main/cut-the-rope-time-travel/ctrtt.wasm"
click node_tt_maps "https://github.com/ctrhome/play/blob/main/cut-the-rope-time-travel/assets/maps/allmaps.xml"
click node_original_runtime "https://github.com/ctrhome/play/blob/main/tweak/cut-the-rope/ctrr.js"
click node_original_levels "https://github.com/ctrhome/play/blob/main/tweak/cut-the-rope/res/box01/maps.json"
click node_famobi_interface "https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/famobi-game-interface.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_index toneBlue
class node_energy_entry,node_experiments_entry,node_energy_loader,node_magic_loader,node_unity_runtime,node_energy_data,node_energy_framework,node_energy_wasm,node_addressables,node_experiments_bundles,node_magic_bundles,node_famobi_interface toneAmber
class node_tt_bootstrap,node_tt_glue,node_tt_wasm,node_tt_maps toneMint
class node_original_runtime,node_original_levels toneRose
```

## Components

### Site shell

- [Edition selector](https://github.com/ctrhome/play/blob/main/index.html): HTML entry · Root site entry for independently deployed games. · `index.html`

### Unity WebGL editions

- [Energy page](https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/index.html): HTML entry · `cut-the-rope-energy/index.html`
- [Experiments page](https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/index.html): HTML entry · `cut-the-rope-experiments/index.html`
- [Energy Unity loader](https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/Build/build6.loader.js): WebGL loader · `cut-the-rope-energy/Build/build6.loader.js`
- [Magic Unity loader](https://github.com/ctrhome/play/blob/main/cut-the-rope-magic/Build/WebGL.loader.js): WebGL loader · `cut-the-rope-magic/Build/WebGL.loader.js`
- **Unity browser runtime**: WASM execution · Browser-side execution boundary shared by Unity artifact layouts.
- [Energy game data](https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/Build/build6.data.br): compressed data · `cut-the-rope-energy/Build/build6.data.br`
- [Energy framework](https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/Build/build6.framework.js.br): compressed JS runtime · `cut-the-rope-energy/Build/build6.framework.js.br`
- [Energy WASM engine](https://github.com/ctrhome/play/blob/main/cut-the-rope-energy/Build/build6.wasm.br): compressed WASM · `cut-the-rope-energy/Build/build6.wasm.br`
- [Addressables catalogs](https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/StreamingAssets/aa/settings.json): streaming metadata · Catalogs and settings must match deployed bundle names. · `cut-the-rope-experiments/StreamingAssets/aa/settings.json`
- [Experiments content bundles](https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/StreamingAssets/aa/WebGL/campaign_scenes_all_e661c3b1df5d2272179159cfa66ca210.bundle): Unity bundles · Generated campaign, level, prefab, animation, and popup content. · `cut-the-rope-experiments/StreamingAssets/aa/WebGL/campaign_scenes_all_e661c3b1df5d2272179159cfa66ca210.bundle`
- [Magic game assets](https://github.com/ctrhome/play/blob/main/cut-the-rope-magic/StreamingAssets/game_assets_all_d53f622c74af0f2c33203f5af2b71d18.bundle): Unity bundle · Generated game, map, visual, and audio content. · `cut-the-rope-magic/StreamingAssets/game_assets_all_d53f622c74af0f2c33203f5af2b71d18.bundle`
- [Famobi host interface](https://github.com/ctrhome/play/blob/main/cut-the-rope-experiments/famobi-game-interface.js): platform SDK bridge · Bundled portal lifecycle, ads, analytics, or host APIs. · `cut-the-rope-experiments/famobi-game-interface.js`

### Time Travel

- [Time Travel bootstrap](https://github.com/ctrhome/play/blob/main/cut-the-rope-time-travel/ctrttboot.js): JS bootstrap · `cut-the-rope-time-travel/ctrttboot.js`
- [Time Travel JS glue](https://github.com/ctrhome/play/blob/main/cut-the-rope-time-travel/ctr-tt.js): runtime glue · `cut-the-rope-time-travel/ctr-tt.js`
- [Time Travel WASM](https://github.com/ctrhome/play/blob/main/cut-the-rope-time-travel/ctrtt.wasm): WASM game engine · `cut-the-rope-time-travel/ctrtt.wasm`
- [Time Travel maps](https://github.com/ctrhome/play/blob/main/cut-the-rope-time-travel/assets/maps/allmaps.xml): XML level data · Explicit data-driven level maps. · `cut-the-rope-time-travel/assets/maps/allmaps.xml`

### Tweaked original

- [Original HTML5 runtime](https://github.com/ctrhome/play/blob/main/tweak/cut-the-rope/ctrr.js): JavaScript game runtime · `tweak/cut-the-rope/ctrr.js`
- [Original level packs](https://github.com/ctrhome/play/blob/main/tweak/cut-the-rope/res/box01/maps.json): JSON level data · `tweak/cut-the-rope/res/box01/maps.json`

## Connections

- Edition selector → Energy page: selects
- Edition selector → Experiments page: selects
- Energy page → Energy Unity loader: loads
- Energy Unity loader → Energy framework: fetches
- Energy Unity loader → Energy WASM engine: fetches
- Energy Unity loader → Energy game data: fetches
- Energy framework → Unity browser runtime: initializes
- Energy WASM engine → Unity browser runtime: executes in
- Energy game data → Unity browser runtime: loads into
- Experiments page → Unity browser runtime: boots
- Magic Unity loader → Unity browser runtime: boots
- Unity browser runtime → Addressables catalogs: resolves streamed assets
- Addressables catalogs → Experiments content bundles: references
- Addressables catalogs → Magic game assets: references
- Experiments page → Famobi host interface: integrates host SDK
- Time Travel bootstrap → Time Travel JS glue: loads
- Time Travel JS glue → Time Travel WASM: instantiates
- Time Travel WASM → Time Travel maps: reads levels
- Original HTML5 runtime → Original level packs: loads
