← Paracosm·Docs/Handbook
Contents · Contents

Handbook: building a world with this OpenSimulator fork

This handbook is the distilled experience of building one standalone OpenSimulator region (a 256 x 256 m island with a cottage and mill, a climbable stone tower, a harbour, a grown woodland, birds, weather, seasons, rain, snow and thunder) almost entirely headless, by an AI assistant driving the region through the WorldBridge control API in this repo, with a human walking the result in a real viewer.

It is written for the next assistant (and its human) who builds a world with this fork, so that you start from what was already learned instead of rediscovering it. Almost every lesson below cost at least one visible failure in the real viewer. Each lesson states the rule, the failure that taught it (when the build logs record one), and the file or tool in this repo that embodies it.

Nothing here is speculative. Where the sources in this repo disagree with each other, the disagreement is listed in handbook/CONFLICTS.md instead of being resolved silently.

First principles

These recur in every chapter. If you remember nothing else, remember these.

  1. Look through the real viewer early, and again after every deploy that matters. Every headless proxy in this project (software skinning, numeric round-trips, OpenSim's own asset decoder, offline renders) verified only that the encoder agreed with itself. The viewer then found what they could not: a whole herd of rigged animals rendered as collapsed sheets while every check passed at 0.000004; one night of "all offline renders pass" still produced five viewer-only faults (a tower's walls invisible, bird wings shredded to specks, reeds through a jetty, a woodpile on a block, vegetables tinted white). Anything the viewer interprets (a mesh asset, a skin block, an .anim, a texture, a sound mix) is proven only in the viewer. See verification.md.

  2. When a foreign format fights you, make the real tool emit a known-good specimen and decode it. Reasoning about the SL mesh format cost weeks. Uploading one asset through the viewer's own uploader, pulling it out of Asset.db and diffing it against this repo's encoder found the missing TexCoord0Domain key in one pass, and later the exact skin-block convention. tools/cmp_mesh_struct.py and tools/decode_llmesh.py are the decoders; assets/firestorm-ref-skin.json is the decoded rigged reference.

  3. A bench or checker only catches what it does not share with the thing it checks. The animesh bench used the same hand-written bone-parent table as the encoder, so a wrong parent passed at 0.00002 m while the viewer was 1.56 m out. Take the foreign system's structure (hierarchies, joint lists, conventions) from that system's own files, in both the encoder and the bench: tools/sl_skeleton.py reads the viewer's own avatar_skeleton.xml (vendored as tools/avatar_skeleton.xml). Any table written from memory is a hypothesis.

  4. Prove a new path on the smallest possible object first. The UV bug was found on a 24-vertex box, not on the elephant. The rigging fix was proven on a 4 x 2 x 1 box folding on two bones (tools/make_bend_box.py) before any creature was rebuilt. A first sit pose was made diagnostic (one unmistakable joint) before a library of poses was built on it.

  5. Make every change readable back, and read the real verdict, not the proxy's. set_script answers started=True even when the script failed to compile; OpenSim's own mesh decoder accepts assets the viewer rejects. Design each change so it has an observable channel (inspect colour and material, list position/size/description, the region log), and find where the real verdict is written (the YEngine lines in OpenSim.log, the viewer's own log).

  6. Never derive a base value from a live read that may already be disturbed; keep recorded originals. A growth script that took its base size from a prim disturbed by testing compounded the error; a wet-stone script restarted in the rain would have darkened already-wet stone; a regrower that read its own grown output swelled the object every run; a terrace rebuild that read the cut terrain took its own cut for the hill; a sky blend that re-captured its baseline after a storm would compound the storm. Record the design values once (a JSON beside the builder, the builder's source constants) and rebuild from those.

What is in this repo

path what it is
build/ build_server.py: one command from the pristine OpenSimulator 0.9.3.0 source zip to a runnable server with our patches, SQLite and WorldBridge. See quickstart.md and build/README.md.
opensim-patches/ Seven source patches as unified diffs against 0.9.3.0, applied in the order of opensim-patches/series, each with a README: asset-instr (optional asset-request logging), sqlite-groups (Groups V2 storage on SQLite), bulletsim-ghost (a physics race that left solid invisible bodies), startup-script-guard (a group deleted during the startup script pass crashed the region), terrain-script-pbr (script-set terrain textures reach PBR viewers), sqlite-offlineim (offline IM storage on SQLite), sqlite-profiles (four bugs in the SQLite profile storage). See operations.md; the write-ups offered upstream are in docs/upstream/.
config/ The config templates: Paracosm's overlay on OpenSim's example files, filled from .env by tools/make_config.py. See config.md.
.env.example The template for .env, which holds every secret and per-install value (git-ignored).
run/ Running the server without a particular supervisor: a systemd unit and notes; tools/run_server.py is the launcher.
worldbridge/ The WorldBridge region module: a loopback-only, token-authenticated HTTP control API into the live region. See worldbridge.md.
mcp/ A standard-library-only Python MCP server: 26 tools over WorldBridge and the AI's own viewer.
tools/ Python (and two JavaScript) builders and helpers. tools/wb.py is the canonical WorldBridge client; tools/backup.py and tools/RESTORE.md are backup and restore.
bot/ A LibreMetaverse console bot that logs an avatar in and moves it.
viewer/ Early headless world views (an isometric HTML render). The build logs later use tools/render_scene.py.
viewer-patches/, viewer-build/ The ten Firestorm-Paracosm patches, one per change against a pinned Firestorm commit, and the Windows build and packaging scripts (see viewer.md and packaging.md).
scenes/ The first small scene builders.
docs/ship/ The ship plan and the two read-only ship audits (server, viewer).
LICENSE, NOTICE.md BSD-3-Clause for our code; what licence each part is under.
opensim-src/ Not versioned (see .gitignore): the reference install's own OpenSimulator tree. Your server is built elsewhere by build/build_server.py.
PLAN.md, docs/WORLD.md The original build logs. Useful history, but PLAN.md's animesh/rigging notes are partly wrong and superseded; follow animesh.md.

Before you run anything

Chapters

Setting up and running a world:

chapter covers
quickstart.md From nothing to logged in: prerequisites, .env, building the server, config, first start, the viewer, first login, more accounts, connecting an AI through the MCP server, var regions, LAN and remote access.
config.md Every .env key and every overlay block, their defaults, and the security-relevant settings.
backup.md tools/backup.py: what a backup contains; restoring (with tools/RESTORE.md).
packaging.md A release: the source export, the portable viewer zip, the server build output, and what never ships.
tls.md Serving a world to other machines safely: what travels in clear, OpenSim's HTTPS listener or a reverse proxy, WorldBridge and the REST console, the firewall. Untested.
voice.md Voice with FreeSWITCH (the module, the server, the keys, the hard-coded voice password), or leaving it off as shipped. Untested.
hypergrid.md Opening a standalone to other grids: the Hypergrid config, visitors, content leaving and arriving, the switches. Untested.
assets.md The SQLite asset store and what fills it, FSAssets (needs MySQL/PostgreSQL) and when to switch, migrating, prune_script_assets.py, the Flotsam cache.

Building a world:

chapter covers
worldbridge.md Every WorldBridge endpoint, its body, its role, and the traps in its behaviour; the MCP server.
operations.md Building and running OpenSim headless, region-module mechanics, restarts and DLL swaps, the patches, memory and CPU cost, logging in with a viewer, the bot.
meshes.md spawn_mesh's input format, Z-up and winding, the 65,535-vertex face limit, bbox-centre placement, faces and submeshes, LODs, instances, tubes, drape meshes, z-fighting.
textures.md J2C with MCT=0, square textures, per-face texturing, repeats and offsets, alpha modes and the alpha ladder, normal maps, specular, daylight whitening, tileable noise.
animesh.md Rigged creatures on the viewer's fixed skeleton (the authoritative rigging section), the two-bone test, the viewer-faithful bench, .anim export, behaviour.
sitting-and-poses.md Sit targets, poseballs, avatar .anim poses, beds, sit cameras.
scripts.md LSL through set_script: one behaviour per script name, compile verdicts, shared clocks, durable memory, talking to scripts, reading state back, testing slow cycles.
motion.md Keyframed motion (llSetKeyframedMotion and WorldBridge wander/behavior), llTargetOmega, sway about a pivot, texture animation, and what motion costs.
sound.md OGG upload, radius and summing, one sound setting, the live-sound truth, loudness by crest factor, hearing the viewer's output.
terrain-and-ground.md Heightmap editing, one record of the ground, building on slopes, water fitted to the ground, things that lie on the ground, terrain textures.
physics-and-walkability.md Physics shapes for meshes, ghost bodies, raycasts, walker tests, clearance, the resize memory leak.
weather-and-light.md The region environment (sky and water), time of day, particles (fire, rain, rings), a flash dome, lights and glow readable at any viewer setting.
verification.md Headless benches versus the real viewer; how to look and listen in-world; reading state back.
sharing-and-inventory.md Groups on SQLite, permissions, giving objects and inventory, keeping linkset copies, the displayed balance.
viewer.md Building your own patched Firestorm, the ten patches (its own settings and cache, no phone-home, the Second Life double opt-in, voice off, LEAP camera and snapshots), the LEAP helper bridge, and the command-line trap that once sent a local login to Second Life.
gifts.md The starter world and the Gifts from Neap box: what is in it, how its animals come alive anywhere (gift brains, roam notecards), how it is built and added to
handbook/CONFLICTS.md Places where the sources disagree.