Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
75f1515
initial PoC
Doprez May 8, 2025
2372862
reorganizing code to work with GameStudio
Doprez May 9, 2025
2f7f213
clean up
Doprez May 9, 2025
5e82aa1
fixing input issues
Doprez May 10, 2025
7136214
Separated input
Doprez May 12, 2025
aa3c9fe
clean up and docs
Doprez May 12, 2025
257c458
Kryptos feedback
Doprez May 28, 2025
e83810a
missed some duplicate packages
Doprez May 28, 2025
18397c5
add option for DI in GameFontSystem
Doprez May 29, 2025
2588b5f
Fix error caused by StreamingManager DI.
Doprez May 29, 2025
f1f7b49
renaming to favour ServiceCollection
Doprez May 29, 2025
938a50c
typo
Doprez May 29, 2025
c2de7f4
docs
Doprez May 29, 2025
3b26a45
docs
Doprez May 29, 2025
384dd48
clean up and build logging
Doprez May 29, 2025
ceaec04
remove some hardcoded Game references
Doprez May 30, 2025
2003364
feat: Setup concurrency for CI workflows (#2807)
Kryptos-FR Jun 2, 2025
d64fedd
fix: concurrency group names can collide when running from the CI (ma…
Kryptos-FR Jun 2, 2025
27f87bf
chore: Increment PublicVersion Build number following the breaking ch…
Eideren Jun 21, 2025
8723abe
initial PoC
Doprez May 8, 2025
7590a43
reorganizing code to work with GameStudio
Doprez May 9, 2025
6f02a8b
clean up
Doprez May 9, 2025
9f7bd52
fixing input issues
Doprez May 10, 2025
848bd10
Separated input
Doprez May 12, 2025
731610d
clean up and docs
Doprez May 12, 2025
8c7eaea
Kryptos feedback
Doprez May 28, 2025
415cd6f
missed some duplicate packages
Doprez May 28, 2025
08dc3ce
add option for DI in GameFontSystem
Doprez May 29, 2025
a51d8cf
Fix error caused by StreamingManager DI.
Doprez May 29, 2025
1bcc2e5
renaming to favour ServiceCollection
Doprez May 29, 2025
c5d1c3d
typo
Doprez May 29, 2025
1f8eba6
docs
Doprez May 29, 2025
a315d2b
docs
Doprez May 29, 2025
0ed0012
clean up and build logging
Doprez May 29, 2025
4718339
remove some hardcoded Game references
Doprez May 30, 2025
5d34b28
GameWindowTest
Doprez Jul 20, 2025
c252f6e
rebase
Doprez Jul 20, 2025
850659d
writable ConentManager
Doprez Jul 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ on:
default: Debug
type: string

concurrency:
group: build-android-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
cancel-in-progress: true

jobs:
#
# Build Stride Runtime for Android
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-assembly-processor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ on:
default: Debug
type: string

concurrency:
group: build-assembly-processor-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
cancel-in-progress: true

jobs:
#
# Build Assembly Processor
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ on:
default: Debug
type: string

concurrency:
group: build-ios-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
cancel-in-progress: true

jobs:
#
# Build Stride Runtime for iOS
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-launcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
default: Debug
type: string

concurrency:
group: build-launcher-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
cancel-in-progress: true

jobs:
#
# Build Stride Runtime for Windows
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-linux-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ on:
default: OpenGL
type: string

concurrency:
group: build-linux-runtime-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}-${{ github.event.inputs.graphics-api || inputs.graphics-api || 'OpenGL' }}
cancel-in-progress: true

jobs:
#
# Build Stride Runtime for Linux
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-vs-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ on:
default: Debug
type: string

concurrency:
group: build-vs-package-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
cancel-in-progress: true

jobs:
#
# Build Visual Studio Package
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-windows-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ on:
default: Debug
type: string

concurrency:
group: build-windows-full-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
cancel-in-progress: true

jobs:
#
# Build Stride for Windows
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-windows-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ on:
default: Direct3D11
type: string

concurrency:
group: build-windows-runtime-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}-${{ github.event.inputs.graphics-api || inputs.graphics-api || 'Direct3D11' }}
cancel-in-progress: true

jobs:
#
# Build Stride Runtime for Windows
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
- '!crowdin.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
### Misc. ###
Assembly-Processor:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ on:
default: Simple
type: string

concurrency:
group: test-linux-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}-${{ github.event.inputs.test-category || inputs.test-category || 'Simple' }}
cancel-in-progress: true

jobs:
#
# Test Stride on Linux
#
Linux-Tests:
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event.pull_request.draft == false }}
name: Test (${{ github.event.inputs.build-type || inputs.build-type }}, ${{ github.event.inputs.test-category || inputs.test-category }})
name: Test (${{ github.event.inputs.build-type || inputs.build-type }}, ${{ github.event.inputs.test-category || inputs.test-category || 'Simple' }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -43,14 +47,14 @@ jobs:
dotnet-version: '8.0.x'
- name: Build
run: |
dotnet build build\Stride.Tests.${{ github.event.inputs.test-category || inputs.test-category }}.slnf `
dotnet build build\Stride.Tests.${{ github.event.inputs.test-category || inputs.test-category || 'Simple' }}.slnf `
-restore -m:1 -nr:false `
-v:m -p:WarningLevel=0 `
-p:Configuration=${{ github.event.inputs.build-type || inputs.build-type }} `
-p:StridePlatforms=Linux `
-p:StrideGraphicsApis=OpenGL
- name: Test
run: |
dotnet test build\Stride.Tests.${{ github.event.inputs.test-category || inputs.test-category }}.slnf `
dotnet test build\Stride.Tests.${{ github.event.inputs.test-category || inputs.test-category || 'Simple' }}.slnf `
--no-build `
-p:Configuration=${{ github.event.inputs.build-type || inputs.build-type }}
4 changes: 4 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ on:
default: Simple
type: string

concurrency:
group: test-windows-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}-${{ github.event.inputs.test-category || inputs.test-category || 'Simple' }}
cancel-in-progress: true

jobs:
#
# Test Stride on Windows
Expand Down
1 change: 1 addition & 0 deletions sources/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<PackageVersion Include="DotRecast.Recast.Toolset" Version="2024.3.1" />
<PackageVersion Include="FFmpeg.AutoGen" Version="3.4.0.2" />
<PackageVersion Include="K4os.Compression.LZ4.Legacy" Version="1.3.6" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.5" />
<PackageVersion Include="Microsoft.Management.Infrastructure" Version="3.0.0-preview.4" />
<PackageVersion Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ private static DatabaseFileProvider CreateDatabase(BuildTransaction transaction)

private class MicroThreadLocalProviderService : IDatabaseFileProviderService
{
public DatabaseFileProvider FileProvider => MicroThreadLocalDatabaseFileProvider.Value;
public DatabaseFileProvider FileProvider
{
get => MicroThreadLocalDatabaseFileProvider.Value;
set => MicroThreadLocalDatabaseFileProvider.Value = value;
//throw new InvalidOperationException($"Can not change the value of a {nameof(MicroThreadLocalProviderService.FileProvider)}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ namespace Stride.Core.IO;

public interface IDatabaseFileProviderService
{
DatabaseFileProvider FileProvider { get; }
}
DatabaseFileProvider FileProvider { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ public interface IContentManager
/// <returns>A stream to the raw asset.</returns>
Stream OpenAsStream(string url, StreamFlags streamFlags = StreamFlags.None);

/// <summary>
/// Saves an asset at a specific URL.
/// </summary>
/// <param name="url">The URL.</param>
/// <param name="asset">The asset.</param>
/// <param name="storageType">The custom storage type to use. Use null as default.</param>
/// <exception cref="System.ArgumentNullException">
/// url
/// or
/// asset
/// </exception>
void Save(string url, object asset, Type? storageType);

/// <summary>
/// Loads content from the specified URL.
/// </summary>
Expand Down
9 changes: 9 additions & 0 deletions sources/core/Stride.Core/IServiceRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public interface IServiceRegistry
/// <exception cref="ArgumentException">Thrown when a service of the same type is already registered.</exception>
void AddService<T>(T service) where T : class;

/// <summary>
/// Adds a service to this <see cref="ServiceRegistry"/>.
/// </summary>
/// <param name="service">The service to add.</param>
/// <param name="type">The type to register as.</param>
/// <exception cref="ArgumentNullException">Thrown when the provided service is null.</exception>
/// <exception cref="ArgumentException">Thrown when a service of the same type is already registered.</exception>
void AddService(object service, Type type);

/// <summary>
/// Gets the service object of the specified type.
/// </summary>
Expand Down
16 changes: 16 additions & 0 deletions sources/core/Stride.Core/ServiceRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ public void AddService<T>(T service)
OnServiceAdded(new ServiceEventArgs(type, service));
}

/// <inheritdoc />
/// <remarks>
/// This implementation triggers the <see cref="ServiceAdded"/> event after a service is successfully added.
/// </remarks>
public void AddService(object service, Type type)
{
ArgumentNullException.ThrowIfNull(service);

lock (registeredService)
{
if (!registeredService.TryAdd(type, service))
throw new ArgumentException("Service is already registered with this type", nameof(type));
}
OnServiceAdded(new ServiceEventArgs(type, service));
}

/// <inheritdoc />
/// <remarks>
/// This implementation triggers the <see cref="ServiceRemoved"/> event after a service is successfully removed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public abstract class EntityHierarchyEditorGame : EditorServiceGame
private Material fallbackColorMaterial;
private Material fallbackTextureMaterial;

protected EntityHierarchyEditorGame(TaskCompletionSource<bool> gameContentLoadedTaskSource, IEffectCompiler effectCompiler, string effectLogPath)
protected EntityHierarchyEditorGame(TaskCompletionSource<bool> gameContentLoadedTaskSource, IEffectCompiler effectCompiler, string effectLogPath, GameContext context = null)
: base(context)
{
this.gameContentLoadedTaskSource = gameContentLoadedTaskSource;
this.effectCompiler = effectCompiler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ public bool IsEditorHidden

public event EventHandler<ExceptionThrownEventArgs> ExceptionThrown;

public EditorServiceGame(GameContext context) : base(context)
{

}

/// <summary>
/// Calculates and returns the position of the mouse in the scene.
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion sources/editor/Stride.Editor/Engine/EmbeddedGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Stride.Core.Diagnostics;
using Stride.Engine;
using Stride.Games;
using Stride.Graphics;

namespace Stride.Editor.Engine
Expand All @@ -17,7 +18,7 @@ public class EmbeddedGame : Game
/// </summary>
public static bool DebugMode { get; set; }

public EmbeddedGame()
public EmbeddedGame(GameContext context) : base(context)
{
GraphicsDeviceManager.PreferredGraphicsProfile = new [] { GraphicsProfile.Level_11_0, GraphicsProfile.Level_10_1, GraphicsProfile.Level_10_0 };
GraphicsDeviceManager.PreferredBackBufferWidth = 64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ private void StrideUIThread()

initializationSignal.Set();

PreviewGame = new PreviewGame(AssetBuilderService.EffectCompiler);
var context = new GameContextWinforms(gameForm) { InitializeDatabase = false };
PreviewGame = new PreviewGame(AssetBuilderService.EffectCompiler, context);

// Wait for shaders to be loaded
AssetBuilderService.WaitForShaders();
Expand Down
11 changes: 6 additions & 5 deletions sources/editor/Stride.Editor/Preview/PreviewGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
using System;
using System.Threading.Tasks;
using Stride.Core.BuildEngine;
using Stride.Core;
using Stride.Core.Diagnostics;
using Stride.Core.Mathematics;
using Stride.Assets;
using Stride.Assets.SpriteFont;
using Stride.Assets.SpriteFont.Compiler;
using Stride.Core;
using Stride.Core.BuildEngine;
using Stride.Core.Diagnostics;
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Engine.Design;
using Stride.Games;
using Stride.Graphics;
using Stride.Rendering.Compositing;
using Stride.Shaders.Compiler;
Expand Down Expand Up @@ -43,7 +44,7 @@ public class PreviewGame : EditorGame.Game.EditorServiceGame

private Scene previewScene;

public PreviewGame(IEffectCompiler effectCompiler)
public PreviewGame(IEffectCompiler effectCompiler, GameContext context) : base(context)
{
this.effectCompiler = effectCompiler;
}
Expand Down
11 changes: 6 additions & 5 deletions sources/engine/Stride.Debugger/Debugger/LiveAssemblyReloader.cs
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Stride.Core;
using Stride.Core.Reflection;
using Stride.Core.Serialization;
using Stride.Core.Yaml;
using Stride.Core.Yaml.Events;
using Stride.Core.Yaml.Serialization;
using Stride.Debugger.Target;
using Stride.Engine;
using Stride.Games;

namespace Stride.Debugger
{
public static class LiveAssemblyReloader
{
public static void Reload(Game game, AssemblyContainer assemblyContainer, List<Assembly> assembliesToUnregister, List<Assembly> assembliesToRegister)
public static void Reload(GameBase game, AssemblyContainer assemblyContainer, List<Assembly> assembliesToUnregister, List<Assembly> assembliesToRegister)
{
List<Entity> entities = new List<Entity>();

var sceneSystem = game.Services.GetSafeServiceAs<SceneSystem>();

if (game != null)
entities.AddRange(game.SceneSystem.SceneInstance);
entities.AddRange(sceneSystem.SceneInstance);

CloneReferenceSerializer.References = new List<object>();

Expand Down
Loading