Construct TCP Examples
Go clients that connect to SoulGlitch’s Planet construct host on
127.0.0.1:17000 — spawn rigid-body constructs, query planets, and drive simulations over JSON.
Synced from openfluke/construct-tcp-examples.
Video walkthrough — all 13 examples + planet walk on macOS. YouTube
Before you run an example
In SoulGlitch: dock → Planet (center globe) → turn on Construct TCP host.
Then from your machine: git clone https://github.com/openfluke/construct-tcp-examples.git and
go run . 13 (shape showcase) or pick any numbered test below.
construct-tcp-examples
Example integration harness for the Construct TCP simulation API.
Read tutorial
Test 1: Pin-Jointed Skeleton
Test 1** is the introductory Construct TCP example. It spawns a humanoid skeleton made of capsule parts connected with **pin joints**, then drives a simple animation loop with `update_construct`.
Read tutorial
Test 2: Multi-Client Constructs
Test 2** stress-tests **multiple simultaneous TCP clients**, each owning its own construct. Four goroutines connect in parallel and run independent animation loops for ~60 seconds.
Read tutorial
Test 3: Procedural Bestiary
Test 3** spawns **20 procedurally generated creatures** in parallel. Each creature gets random DNA (type, colors, scale, mutations) and a behavior loop matched to its morphology.
Read tutorial
Test 4: Planetary Architecture
Test 4** builds **30 procedural structures** aligned to a synthetic planet surface. Each building uses a local tangent basis so box parts sit upright relative to the surface normal.
Read tutorial
Test 5: Auto-Discovery Satellite
Test 5** demonstrates **`query_state`**-driven spawning. It reads live planet center, radius, and player position from the server, then launches five orbiting satellites whose paths are computed from that state.
Read tutorial
Test 6: Universal Query Loop
Test 6** is a **read-only diagnostic client**. It connects once and polls the server every 2 seconds, printing nearby planets and connected players. Useful for verifying multiverse discovery and player slot reporting.
Read tutorial
Test 7: Surface Gadgets
Test 7** deploys a **mixed grid of surface contraptions** on every nearby planet. It discovers planets via **`query_nearby_planets`**, then spawns 20 random gadgets per planet with type-specific controllers.
Read tutorial
Test 8: Multi-Bubble Discovery
Test 8** uses **`query_state`** to discover **bubble waypoints** on the current planet, then spawns a visual marker group at each bubble — one sphere on the bubble, one 5 m above, and a connector capsule between them.
Read tutorial
Test 9: Planetary Transfiguration
Test 9** is a large-scale **planet decoration** demo. It queries the **current planet** via **`query_state`**, then spawns **150 mixed magical objects** scattered across the surface with animated controllers.
Read tutorial
Test 10: Swarm Reinforcement Learning
Test 10** implements a **distributed multi-agent reinforcement learning system** where 100 autonomous cube agents learn to navigate a 3D planetary environment using deep neural networks and policy gradient methods.
Read tutorial
Test 11: Walking Skeleton Reinforcement Learning
Test 11** implements a **distributed multi-agent reinforcement learning system** where 20 humanoid skeleton creatures learn to walk upright using deep neural networks and policy gradient methods. This builds on the sw...
Read tutorial
Test 12: Swarm Skeletons
Test 12** spawns **pin-jointed skeletons at every bubble waypoint** on the current planet. For each bubble it places three skeletons in a ring 8 m from the bubble center, offset above the surface.
Read tutorial
Test 13: Shape Showcase (default)
Test 13** — *Rons Gone Wrong* — is the **default example** (`go run .`). It queries live planet state, then spawns **300 random constructs** clustered above the current planet surface, exercising every supported p...
Read tutorial