Skip to content

The default scene β€” what a new project opens to

cli tutorial Beginner ⏱ 4 min vgai 0.1.0

Prerequisites: Take the editor tour

What you'll learn

  • Know what the default scene contains
  • Understand how the editor chooses the default scene
  • Know it's seeded on first run in the browser build

What you'll build: A terminal look at the default minimal box scene and the seeding flow.

When you open a fresh vgai project there’s already a minimal box scene on screen β€” the smallest useful starting point. There are actually two minimal starters: the one the template ships as a file, and the one the browser build seeds in code. This is a terminal look at both (real captured output below).

# transcript pending capture β€” run: node site/media/capture-cli.mjs
Terminal β€” The default scene β€” what a new project opens to Β· captured by site/media/capture-cli.mjs
  1. The template’s default scene. The template ships public/scenes/default.vscn.json (name Default) β€” the file the hosted/desktop editor fetches. Parsing it shows five entities: a hemisphere ambient light, a directional Sun (with shadows), a Ground box, a blue Box to look at, and a Camera. Nothing depends on external assets β€” it loads instantly.

  2. How it’s chosen β€” and the browser starter. initial-scene.ts loads project.config.defaultScene ?? 'scenes/default.vscn.json'. The browser build doesn’t ship a file β€” seed.ts (seedIfEmpty) writes its own inline minimal scene (name Starter β€” a camera, a directional Sun + a hemisphere fill light, a ground plane, and a box) to that same path after the user explicitly chooses Create a new game, plus a default input map and a project manifest. A fresh hosted visit shows the intent router and writes nothing. seedIfEmpty is also self-healing: if the stored scene ever fails to parse, it re-seeds a valid one. Both are minimal box scenes; they differ in the small details, not the idea.

Recap

New functionality

  • Listed the template default scene's five entities
  • Saw how the default is resolved and how explicit browser creation seeds its own starter

New concepts & skills

  • the template ships scenes/default.vscn.json (Default); browser Create seeds an inline Starter scene in code
  • both are asset-free minimal box scenes (lights, ground, box, camera) β€” they differ only in details
  • initial-scene.ts resolves project.config.defaultScene ?? scenes/default.vscn.json

Next lesson β†’ Scene I/O