You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regarding asset compilation in code-only development: it’s actually not as complex as it might seem—the Stride developers have already done most of the heavy lifting. However, if you are pursuing a code-only workflow, you might run into some hurdles. You may have seen related discussions in the Stride Community Toolkit repository, but the information there can be a bit scattered. I’d like to provide a concise explanation of how it works.
The Underlying Principle
As long as your project references Stride.Core.Assets.CompilerApp, your MSBuild process will automatically include a call to the Asset Compiler. This target relies on a few prerequisites; if these aren't met, you'll run into compilation issues.
Key Requirements
The .sdpkg File: You need a YAML-based <ProjectName>.sdpkg file. It must reside in the same directory as your .csproj and share the exact same name. If your solution has multiple projects, place the .sdpkg in your main executable/app project, not the class libraries. Folder Structure: I recommend sticking to the default paths: !dir Assets, !dir Effects, and !dir Resources. While it might be possible to customize these, I’ve found that keeping the defaults ensures the MSBuild targets work seamlessly without extra configuration. GameSettings: You must have a GameSettings.sdgamesettings file (YAML) inside your Assets/ folder. If the MSBuild target can’t find this file, it will fall back to default game settings, which often makes your .sdpkg edits appear as if they are being ignored. Tip: You can easily get boilerplate templates for these files by creating a dummy project in the Stride Editor (ironically, even for a code-only approach, having the Editor handy for generating templates is highly recommended).
Troubleshooting and Validation
Ensure your YAML syntax is perfect—which can be tricky if you're editing in a plain text editor like Notepad. Once these files are correctly set up, your project will compile assets just like an Editor-based project would. Simply drop your YAMLs in Assets/ and raw files in Resources/.
If you mess up the YAML syntax, you’ll likely get two errors during build. Double-clicking them will lead you to the MSBuild target that invokes the Asset Compiler. Don't modify the target file; just go back and fix your YAML.
One Final Detail: RootAssets
The definitions under RootAssets must match the actual physical path of the corresponding YAML files in the Assets/ folder. Even if the GUID is correct, the compilation will fail if the path is mismatched. You cannot move a YAML file to a different subdirectory while trying to maintain a shorter URL in the configuration.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Regarding asset compilation in code-only development: it’s actually not as complex as it might seem—the Stride developers have already done most of the heavy lifting. However, if you are pursuing a code-only workflow, you might run into some hurdles. You may have seen related discussions in the Stride Community Toolkit repository, but the information there can be a bit scattered. I’d like to provide a concise explanation of how it works.
The Underlying Principle
As long as your project references
Stride.Core.Assets.CompilerApp, your MSBuild process will automatically include a call to the Asset Compiler. This target relies on a few prerequisites; if these aren't met, you'll run into compilation issues.Key Requirements
The
.sdpkgFile: You need a YAML-based<ProjectName>.sdpkgfile. It must reside in the same directory as your.csprojand share the exact same name. If your solution has multiple projects, place the.sdpkgin your main executable/app project, not the class libraries.Folder Structure: I recommend sticking to the default paths:
!dir Assets,!dir Effects, and!dir Resources. While it might be possible to customize these, I’ve found that keeping the defaults ensures the MSBuild targets work seamlessly without extra configuration.GameSettings: You must have a
GameSettings.sdgamesettingsfile (YAML) inside yourAssets/folder. If the MSBuild target can’t find this file, it will fall back to default game settings, which often makes your.sdpkgedits appear as if they are being ignored.Tip: You can easily get boilerplate templates for these files by creating a dummy project in the Stride Editor (ironically, even for a code-only approach, having the Editor handy for generating templates is highly recommended).
Troubleshooting and Validation
Ensure your YAML syntax is perfect—which can be tricky if you're editing in a plain text editor like Notepad. Once these files are correctly set up, your project will compile assets just like an Editor-based project would. Simply drop your YAMLs in
Assets/and raw files inResources/.If you mess up the YAML syntax, you’ll likely get two errors during build. Double-clicking them will lead you to the MSBuild target that invokes the Asset Compiler. Don't modify the target file; just go back and fix your YAML.
One Final Detail: RootAssets
The definitions under
RootAssetsmust match the actual physical path of the corresponding YAML files in theAssets/folder. Even if the GUID is correct, the compilation will fail if the path is mismatched. You cannot move a YAML file to a different subdirectory while trying to maintain a shorter URL in the configuration.Beta Was this translation helpful? Give feedback.
All reactions