"s&box project folder layout"
▸ SYMPTOM
Files scattered in the wrong place; editor doesn't see scenes; generators write where the engine won't compile; you're copying a working project and don't know which folders are load-bearing.
▸ CAUSE
s&box projects follow a small fixed layout. Assets are compiled from Assets/; game code lives in Code/ against a csproj that references the Steam install; ProjectSettings/ holds input/collision/platform config; tools/ is optional offline generation.
▸ FIX
<project>/
├── <project>.sbproj
├── Assets/
│ ├── scenes/*.scene # StartupScene points here (no Assets/ prefix in sbproj)
│ ├── models/…/*.obj + .vmdl
│ └── materials/…/*.png + .vmat
├── Code/
│ ├── Assembly.cs
│ ├── <project>.csproj
│ └── <domain>/*.cs + UI/*.razor(.scss)
├── Editor/ # editor-only assembly (usually untouched)
├── ProjectSettings/
│ ├── Input.config
│ └── Collision.config / Platform.config
└── tools/ # python: Blender gen_models + pure-python gen_assetsConventions:
- Resource paths in code are root-relative forward slashes, no
Assets/prefix (models/foo/bar.vmdl). - Loose PNG/MP3/JSON that must ship need Resource Files registration at publish time (loose-resource-files-publish).
- Keep Blender-only scripts vs pure-python asset emitters split under
tools/for fast iteration (blender-headless-pipeline).
▸ WHY IT WORKS
The editor mounts the project root and compiles known trees. Matching this layout means scenes, code, and settings resolve without custom path hacks, and generators can target the same places every project expects.