# Stride `dotnet new` Templates Four NuGet packages ship Stride templates for the `dotnet new` engine: | Package | Contents | Distribution | |---|---|---| | **`Stride.Templates.Games`** | `stride-game` (blank NewGame starter) | Bundled with GameStudio installer | | **`Stride.Templates.Games.Starters`** | `stride-fps`, `stride-platformer2d`, `stride-topdownrpg`, `stride-thirdpersonplatformer`, `stride-vrsandbox` | nuget.org (CLI install / future template store) | | **`Stride.Templates.Samples`** | 18 feature demos (tutorials, games, graphics, physics, UI, particles, input, audio) | nuget.org (CLI install / future template store) | | **`Stride.Templates.AssetPacks`** | 4 asset packs as item templates: `stride-pack-buildingblocks`, `stride-pack-animatedmodels`, `stride-pack-materials`, `stride-pack-particles` | nuget.org (downloaded on demand by GameStudio's New Game dialog / the `stride` CLI) | GameStudio's "New Project" dialog and CLI `dotnet new` consume the same packages — there is one template flow, not two. ## End-user usage (CLI) ```bash dotnet new install Stride.Templates.Games dotnet new stride-game -n MyGame cd MyGame dotnet run --project MyGame.Windows ``` Genre starters and feature demos require their own package install: ```bash # Opinionated game-genre starter (FPS, Platformer2D, TopDownRPG, third-person, VR) dotnet new install Stride.Templates.Games.Starters dotnet new stride-fps -n MyShooter cd MyShooter && dotnet run --project MyShooter.Windows # Feature demos / tutorials (18 templates: stride-csharp-beginner / -intermediate, # stride-jumpyjet, stride-spaceescape, stride-animatedmodel, stride-particles, # stride-bepuphysics, stride-physics, stride-ui-menu, ...) dotnet new install Stride.Templates.Samples dotnet new stride-jumpyjet -n MyJumpyJet cd MyJumpyJet && dotnet run --project MyJumpyJet.Windows ``` Asset packs are *item* templates: they drop ready-made assets into an existing game library (the same content the New Game dialog offers as checkboxes): ```bash dotnet new install Stride.Templates.AssetPacks cd MyGame/MyGame.Game dotnet new stride-pack-buildingblocks # merges the pack's Assets/ + Resources/ into the current folder ``` `dotnet new` writes to the current folder whatever the project lists in its `AssetFolders`. A project with other folders (the samples list `../Assets/Shared`) does not see the pack then. The `stride` CLI needs neither install: it resolves the template packages and downloads the asset packs the first time they are needed. `stride new stride-pack-buildingblocks` also finds where the pack has to go, from the solution folder or from a package folder: - **The package:** the one around the current folder, else the game library. From a platform project, the library next to it. If it can't choose, it gives an error and writes nothing. - **The folders:** the pack's `Assets/*` goes into the first folder of the package's `AssetFolders`, and its `Resources/*` into the first folder of its `ResourceFolders`. The assets keep their URLs. The `.sdpkg` is not edited, and no folder is added to it: a pack with resources gives an error and writes nothing if the package lists no resource folder. - **The paths:** if the relative path between the two folders is not `../Resources`, the paths in the pack's assets that lead to one of its resources are rewritten: the values tagged `!file` and the keys of `~SourceHashes`. Nothing else in a file changes. A folder that no relative path reaches gives an error and writes nothing. - **The version:** the packs before Stride 4.4.2 have paths with no `!file` tag, so rewriting them gives an error that asks to upgrade the project and writes nothing. They still work when no rewrite is needed. A pack written by hand or saved by an old tool needs the tag too. To add it, run `Stride.AssetCompiler upgrade --resave-all` on the pack. `-o ` skips this: `/Assets` and `/Resources` are written, with a warning if no package sees them. The pack comes from the version of that project (or from `--version`), and the project stays on its version. `dotnet new -l` after the installs lists every available stride-* short name. Common parameters (template-dependent): | Parameter | Values | Meaning | |---|---|---| | `-n` / `--name` | string | Project name; substitutes `MyTemplate` literal throughout | | `--platforms` | `host` / `windows` / `linux` / `macos` / `ios` / `android` (pipe-joined for multiple) | Per-platform exec projects to include. `host` auto-detects current OS. | | `--HDR` | `true` / `false` | HDR rendering pipeline (requires `graphicsProfile >= 10.0`) | | `--graphicsProfile` | `9.0` / `10.0` / `11.0` | Shader feature level | | `--orientation` | `Default` / `LandscapeLeft` / `LandscapeRight` / `Portrait` | Mobile display orientation | `dotnet new