Skip to content

Conversation

@ourabigdev
Copy link
Contributor

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)
  • 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.
  • I have built and run the editor to try this change out.

Copy link
Member

@Kryptos-FR Kryptos-FR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial review. I'll have a second look at it later. I'm busy this weekend.

@ourabigdev ourabigdev closed this May 26, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Avalonia Editor Rewrite May 26, 2025
@ourabigdev ourabigdev reopened this May 26, 2025
@ourabigdev
Copy link
Contributor Author

i reopened this one sorry for the other one I don't work with github a lot so I forget sometimes

<AvaloniaBehaviorVersion>11.2.7.3</AvaloniaBehaviorVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be removed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did that i keeped this one now and the other has been removed in past commit but it's still there idk why

</DrawingImage>

<DrawingImage x:Key="ImageStart">
<DrawingImage.Drawing>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 spaces instead of tabs for indentation in XAML files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to still be a mix of spaces and tabs.

If you are using Visual Studio, you can use Ctrl+E,D to format the current document. Or In Visual Studio code Ctrl+Shift+i.

@Kryptos-FR Kryptos-FR moved this from Done to Review in Avalonia Editor Rewrite May 26, 2025
@ourabigdev
Copy link
Contributor Author

@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

@ourabigdev
Copy link
Contributor Author

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.

@w0wca7a
Copy link

w0wca7a commented Oct 29, 2025

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

AvalonLaunch_log.txt

@ourabigdev
Copy link
Contributor Author

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

AvalonLaunch_log.txt

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

@w0wca7a
Copy link

w0wca7a commented Oct 29, 2025

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

@ourabigdev
Copy link
Contributor Author

@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.

@Kryptos-FR
Copy link
Member

@ourabigdev the .axaml file in your branch have tabs instead of 2 spaces for indentation which is causing conflicts.

@Kryptos-FR
Copy link
Member

@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
Copy link
Contributor Author

@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.

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

@Kryptos-FR
Copy link
Member

Kryptos-FR commented Nov 2, 2025

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.

@ourabigdev
Copy link
Contributor Author

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.

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

@ourabigdev
Copy link
Contributor Author

@Kryptos-FR i think i am done here any changes needed just let me know i thinks it's ready

@Kryptos-FR
Copy link
Member

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 PATH environment 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.

@ourabigdev
Copy link
Contributor Author

ourabigdev commented Nov 8, 2025

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 PATH environment 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:

@ourabigdev
Copy link
Contributor Author

2025-11-08.19-31-09.mp4

it's working for me can you tell me wich error you get or is it just not working

@Kryptos-FR
Copy link
Member

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.

@Kryptos-FR Kryptos-FR marked this pull request as ready for review November 9, 2025 15:47
@ourabigdev
Copy link
Contributor Author

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.

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

@ourabigdev
Copy link
Contributor Author

@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

@Kryptos-FR
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-GameStudio work-estimate-L 2-7 Days of work. Should try to break down into smaller issues

Projects

Development

Successfully merging this pull request may close these issues.

❗🟡𝐌 Build or run from the editor

3 participants