Wip: Initial work on running game from the new editor
PR Details
This PR adds the ability to build the game project from within the new Avalonia-based editor. While the editor UI doesn't yet include a button for this feature, the F5 shortcut can be used to trigger the build.
Currently, this functionality only works on Windows due to the limitations of the Stride AssetCompiler, which is platform-specific. I have started laying the groundwork for supporting other platforms in the future, but I am currently unable to test this feature on my Linux machine.
Related Issue
Fixes or relates to issue: #2742
Types of changes
- [ ] Docs change / refactoring / dependency upgrade
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [ ] My change requires a change to the documentation.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [x] I have built and run the editor to try this change out.
i reopened this one sorry for the other one I don't work with github a lot so I forget sometimes
@ourabigdev I have fixed the conflicts and pushed a little cleanup. I also changed the PR to a draft since it might not be complete yet. I will do some testing and I might push new commits later.
Thanks for the contribution in any case.
@ourabigdev I have fixed the conflicts and pushed a little cleanup. I also changed the PR to a draft since it might not be complete yet. I will do some testing and I might push new commits later.
Thanks for the contribution in any case.
Thanks for that yeah it's better for it to become a draft since I will not be able to work on it this month so I will be back at the start of July, I did make the run in editor on windows work with shortcut key and the run button but the run button is just put there randomly I still need to learn about the new editor layout and also more about avalonia so that I can make a similar design and positioning like the wpf editor, when I come back to coding in July I will try my best to finish the pr if I find the time
Is there anyone who can test this PR? It works fine for me — just open the project and press F5 or click the Run button. My local version still has some conflicts, so it’s about three commits behind the latest xplat-editor changes. I’ll look into that in the meantime. Running the game from the editor works fine for now.
Is there anyone who can test this PR? It works fine for me — just open the project and press F5 or click the Run button. My local version still has some conflicts, so it’s about three commits behind the latest xplat-editor changes. I’ll look into that in the meantime. Running the game from the editor works fine for now.
I have created project in 4.2.0.2293 and then open in GameStudio.Avalonia.Desktop and got this log in avalonia console
Is there anyone who can test this PR? It works fine for me — just open the project and press F5 or click the Run button. My local version still has some conflicts, so it’s about three commits behind the latest xplat-editor changes. I’ll look into that in the meantime. Running the game from the editor works fine for now.
I have created project in 4.2.0.2293 and then open in
GameStudio.Avalonia.Desktopand got this log in avalonia console
I think it's because the actually source project is version 4.2.0.1 for some reason build and run from source the Stride.GameStudio csproj and create a project then build and run the Stride.GameStudio.Avalonia.Desktop and open the project created from the stride version from source since it's a different version I had the same problem before
So, have a problem on my side with AssemblyProcessor, can't fix it right now
I think it's because the actually source project is version 4.2.0.1 for some reason build and run from source the Stride.GameStudio csproj and create a project then build and run the Stride.GameStudio.Avalonia.Desktop and open the project created from the stride version from source since it's a different version I had the same problem before
@Kryptos-FR Sorry for the mention — I think I’m done with these changes, but there are still some conflicts I couldn’t fix. Probably because the latest changes also touched the same files I modified. If you’ve got some time, a bit of guidance would really help.
@ourabigdev the .axaml file in your branch have tabs instead of 2 spaces for indentation which is causing conflicts.
@ourabigdev I'll take care of the reformatting of the .axaml files. You couldn't have the correct rules since it was missing from the .editorconfig file.
@ourabigdev I'll take care of the reformatting of the
.axamlfiles. You couldn't have the correct rules since it was missing from the.editorconfigfile.
oh ok thanks i tried too i still need to learn a lot thanks for the help though i couldn't figured out that. this kind of situation helps me learn more
Done. I resolved the conflict by merging the latest xplat-editor into your branch. Merging the target branch is usually the preferred way to fix a conflict.
Done. I resolved the conflict by merging the latest
xplat-editorinto your branch. Merging the target branch is usually the preferred way to fix a conflict.
oh thanks for resolving it, i didn't think about that, also did you try the latest changes i made did it work for you did project build and run
@Kryptos-FR i think i am done here any changes needed just let me know i thinks it's ready
I couldn't make it work on my side. Can you give me some details of your own setup:
- which versions of .NET SDK are installed (
dotnet --info) - wether you have Visual Studio, MSBuild installed or both (and/or several versions of them)
- if those installs are explicitly in the
PATHenvironment variable.
In the old game studio, we use a different library to parse the csproj, figure out the path to a compatible MSBuild and then use that API to do the build. We don't call the command line directly.
Now with that said, I think it is good to experiment calling the command line because the other API is hard to work with. But at the moment it doesn't seem to work with a simple project created from the new game template.
I couldn't make it work on my side. Can you give me some details of your own setup:
- which versions of .NET SDK are installed (
dotnet --info)- wether you have Visual Studio, MSBuild installed or both (and/or several versions of them)
- if those installs are explicitly in the
PATHenvironment variable.In the old game studio, we use a different library to parse the csproj, figure out the path to a compatible MSBuild and then use that API to do the build. We don't call the command line directly.
Now with that said, I think it is good to experiment calling the command line because the other API is hard to work with. But at the moment it doesn't seem to work with a simple project created from the new game template.
i have .net 8 and for visual studio i have the setup from the stride github readme, for the stride project i am using i specifically told him to use dotnet 8 in a global.json file since i have both .net 8 and 9 installed.
.NET SDK:
Version: 9.0.306
Commit: cc9947ca66
Workload version: 9.0.300-manifests.abe91478
MSBuild version: 17.14.28+09c1be848
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.306\
.NET workloads installed:
[maui-windows]
Installation Source: VS 17.14.36623.8
Manifest Version: 9.0.111/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.111\WorkloadManifest.json
Install Type: Msi
[maccatalyst]
Installation Source: VS 17.14.36623.8
Manifest Version: 26.0.9752/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\26.0.9752\WorkloadManifest.json
Install Type: Msi
[ios]
Installation Source: VS 17.14.36623.8
Manifest Version: 26.0.9752/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\26.0.9752\WorkloadManifest.json
Install Type: Msi
[android]
Installation Source: VS 17.14.36623.8
Manifest Version: 35.0.78/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.78\WorkloadManifest.json
Install Type: Msi
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.10
Architecture: x64
Commit: e1f19886fe
.NET SDKs installed:
8.0.415 [C:\Program Files\dotnet\sdk]
9.0.306 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://github.com/user-attachments/assets/b54c3dcd-112b-495a-bd73-fde083ee8b05
it's working for me can you tell me wich error you get or is it just not working
It seems it doesn't work if there is no global.json on the project. But this shouldn't be necessary. Building a Stride project with a newer SDK should work.
This issue is outside the scope of the current PR. So I'm going to accept it as-is and we will investigate later how to fix it.
It seems it doesn't work if there is no
global.jsonon the project. But this shouldn't be necessary. Building a Stride project with a newer SDK should work.This issue is outside the scope of the current PR. So I'm going to accept it as-is and we will investigate later how to fix it.
yeah that is the problem i had too the project i created inside stride mix dotnet 8 and 9 that i have in my device so unless i add global.json to the stride test project telling it to use dotnet 8 it doesnt work wich is weird
@Kryptos-FR sorry for the bother but since i will be having exams next month i wanted to know if there is something that will need to be added to this pr before being merged or no
@ourabigdev I think I'll probably merge it as-is. Or push some more commits myself before doing so. Since the target branch xplat-editor is experimental, it's ok to have features that are not fully functional yet.
So don't worry and focus on your exams. That's more important.