stride
Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
Top Related Projects
Godot Engine – Multi-platform 2D and 3D game engine
Unity C# reference source code.
One framework for creating powerful cross-platform games.
Flax Engine – multi-platform 3D game engine
Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
Quick Overview
Stride is an open-source C# game engine for realistic rendering and VR. It supports both 2D and 3D graphics, and provides a powerful set of tools for game development. Stride aims to be a versatile and user-friendly engine for indie developers and small studios.
Pros
- Cross-platform support (Windows, macOS, Linux, iOS, Android)
- Modern graphics API support (Vulkan, DirectX 12)
- Built-in visual scripting system
- Extensive documentation and community support
Cons
- Smaller community compared to more established engines like Unity or Unreal
- Limited asset marketplace
- Steeper learning curve for beginners compared to some other engines
- Less frequent updates compared to larger, more commercially-backed engines
Code Examples
- Creating a simple 3D scene:
public class MyGame : Game
{
protected override void BeginRun()
{
Scene.Entities.Add(new Entity
{
new ModelComponent
{
Model = Content.Load<Model>("MyModel")
},
new TransformComponent()
});
Scene.Entities.Add(new Entity
{
new CameraComponent(),
new TransformComponent
{
Position = new Vector3(0, 2, -5)
}
});
}
}
- Adding a simple script to an entity:
public class RotateScript : SyncScript
{
public override void Update()
{
Entity.Transform.Rotation *= Quaternion.RotationY(0.01f);
}
}
// In your game class:
var entity = new Entity();
entity.Add(new RotateScript());
Scene.Entities.Add(entity);
- Creating a basic 2D sprite:
public class MyGame : Game
{
protected override void BeginRun()
{
var spriteEntity = new Entity();
var spriteComponent = new SpriteComponent
{
Sprite = Content.Load<SpriteSheet>("MySprite").Sprites[0]
};
spriteEntity.Add(spriteComponent);
Scene.Entities.Add(spriteEntity);
}
}
Getting Started
- Install Visual Studio 2019 or later with .NET desktop development workload
- Install Stride from the official website or via NuGet
- Create a new Stride project in Visual Studio
- Add the following code to your Game class:
public class MyGame : Game
{
protected override void BeginRun()
{
// Add a camera
var cameraEntity = new Entity { new CameraComponent() };
cameraEntity.Transform.Position = new Vector3(0, 0, -5);
Scene.Entities.Add(cameraEntity);
// Add a cube
var cubeEntity = new Entity();
cubeEntity.Add(new ModelComponent
{
Model = GeometricPrimitive.Cube.New(GraphicsDevice)
});
Scene.Entities.Add(cubeEntity);
}
}
- Build and run the project to see a basic 3D scene with a cube
Competitor Comparisons
Godot Engine – Multi-platform 2D and 3D game engine
Pros of Godot
- Larger community and ecosystem, with more resources and third-party assets
- More mature and feature-rich, with a longer development history
- Built-in visual scripting system for non-programmers
Cons of Godot
- Steeper learning curve for beginners, especially those new to game development
- Less optimized for high-end graphics and large-scale projects
- Limited support for certain platforms (e.g., consoles) compared to some commercial engines
Code Comparison
Godot (GDScript):
extends Sprite
func _ready():
position = Vector2(100, 100)
scale = Vector2(2, 2)
Stride (C#):
public class MyEntity : SyncScript
{
public override void Start()
{
Entity.Transform.Position = new Vector3(1, 1, 1);
Entity.Transform.Scale = new Vector3(2, 2, 2);
}
}
Both engines offer intuitive ways to manipulate game objects, but Godot uses its custom GDScript language, while Stride leverages C# for scripting. Godot's syntax is more concise, while Stride's approach may be more familiar to developers with C# experience.
Unity C# reference source code.
Pros of UnityCsReference
- More extensive documentation and community support
- Larger ecosystem of assets and plugins
- Wider industry adoption and job market
Cons of UnityCsReference
- Closed-source core engine
- Less flexible licensing options
- Steeper learning curve for advanced features
Code Comparison
Stride:
public class MyScript : SyncScript
{
public override void Update()
{
// Game logic here
}
}
UnityCsReference:
public class MyScript : MonoBehaviour
{
void Update()
{
// Game logic here
}
}
Both engines use C# for scripting, but Stride uses SyncScript
as a base class, while Unity uses MonoBehaviour
. Stride's Update
method is marked as override
, indicating a different inheritance structure.
Stride offers a more open-source approach, allowing developers to modify the engine's core. UnityCsReference provides access to C# reference source code but doesn't allow direct modifications to the engine.
Unity's larger user base and market presence provide more resources and job opportunities. However, Stride's open-source nature offers greater flexibility and potential for customization.
Both engines have their strengths, and the choice between them depends on project requirements, team expertise, and long-term goals.
One framework for creating powerful cross-platform games.
Pros of MonoGame
- Mature and stable framework with a large community and extensive documentation
- Cross-platform support for multiple desktop, mobile, and console platforms
- Familiar XNA-like API, making it easier for developers with XNA experience
Cons of MonoGame
- Limited built-in editor support, requiring more manual setup and configuration
- Less advanced graphics features compared to modern game engines
- Slower development cycle for complex projects due to lack of visual tools
Code Comparison
MonoGame:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
spriteBatch.Draw(texture, position, Color.White);
spriteBatch.End();
base.Draw(gameTime);
}
Stride:
public override void Draw(CommandList commandList)
{
commandList.Clear(GraphicsDevice.Presenter.BackBuffer, Color.CornflowerBlue);
spriteBatch.Begin(commandList);
spriteBatch.Draw(texture, position, Color.White);
spriteBatch.End();
}
Both frameworks use similar drawing concepts, but Stride's API is more modern and flexible, utilizing command lists for rendering.
Flax Engine – multi-platform 3D game engine
Pros of FlaxEngine
- More active development with frequent updates and commits
- Larger community and user base, leading to better support and resources
- More comprehensive documentation and tutorials
Cons of FlaxEngine
- Steeper learning curve for beginners
- Less flexible licensing options compared to Stride
- Heavier resource requirements for development
Code Comparison
Stride:
public class MyScript : SyncScript
{
public override void Start()
{
// Initialization code
}
public override void Update()
{
// Update logic
}
}
FlaxEngine:
public class MyScript : Script
{
public override void OnStart()
{
// Initialization code
}
public override void OnUpdate()
{
// Update logic
}
}
Both engines use C# for scripting, with similar structure for game object components. The main differences lie in method names and inheritance hierarchy. Stride uses SyncScript
as the base class, while FlaxEngine uses Script
. The lifecycle methods are named slightly differently, with Stride using Start
and Update
, and FlaxEngine using OnStart
and OnUpdate
.
Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
Pros of Cocos2d-x
- More mature and established framework with a larger community
- Supports multiple programming languages (C++, Lua, JavaScript)
- Extensive documentation and learning resources available
Cons of Cocos2d-x
- Steeper learning curve, especially for beginners
- Less modern architecture compared to Stride
- Limited built-in 3D capabilities
Code Comparison
Cocos2d-x (C++):
auto sprite = Sprite::create("sprite.png");
sprite->setPosition(Vec2(100, 100));
this->addChild(sprite);
Stride (C#):
var sprite = new SpriteComponent
{
SpriteSheet = Content.Load<SpriteSheet>("sprite"),
};
Entity.Add(sprite);
Key Differences
- Stride focuses on C# and .NET, while Cocos2d-x supports multiple languages
- Stride has a more modern, component-based architecture
- Cocos2d-x has a larger ecosystem of extensions and plugins
- Stride offers better 3D capabilities out of the box
- Cocos2d-x has a longer history and more widespread adoption in the industry
Both engines have their strengths, with Cocos2d-x being more established and versatile, while Stride offers a more modern approach with stronger 3D support.
Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
Pros of Babylon.js
- Larger community and ecosystem, with more resources and third-party plugins
- Better documentation and learning materials
- More mature and feature-rich, especially for web-based 3D applications
Cons of Babylon.js
- Steeper learning curve for beginners
- Potentially higher performance overhead for complex scenes
- Less integrated with game development workflows compared to Stride
Code Comparison
Babylon.js (JavaScript):
const scene = new BABYLON.Scene(engine);
const camera = new BABYLON.FreeCamera("camera", new BABYLON.Vector3(0, 5, -10), scene);
const light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
const sphere = BABYLON.MeshBuilder.CreateSphere("sphere", {diameter: 2}, scene);
Stride (C#):
public override void Start()
{
var sphere = new Entity("Sphere");
sphere.Transform.Position = new Vector3(0, 0, 0);
sphere.Add(new SphereColliderShape());
sphere.Add(new ModelComponent(Content.Load<Model>("Models/Sphere")));
Entities.Add(sphere);
}
Both engines offer powerful 3D rendering capabilities, but Babylon.js is more focused on web-based applications, while Stride is geared towards game development with a more traditional engine structure. Babylon.js has a larger community and more resources, but Stride offers tighter integration with game development workflows and potentially better performance for complex games.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Welcome to the Stride Game Engine
Stride is an open-source C# game engine designed for realistic rendering and VR. Highly modular, it aims to give game makers more flexibility in their development. Stride comes with an editor, Game Studio, which allows you to create and manage the content of your games or applications visually and intuitively. To learn more about Stride, visit stride3d.net.
This README is intended for users who want to build the Stride engine from source or contribute to its development. If your goal is to create games using Stride, we recommend visiting the Get started with Stride guide. There, you'll find detailed instructions on downloading, installing, and getting started with game development in Stride.
ð¤ Contributing
For questions and general discussions, please join our Discord server or participate in GitHub Discussions.
To report bugs or propose features, please use the Issues section on GitHub.
We welcome code contributions via pull requests. Issues tagged with good first issue
are great starting points for code contributions.
You can help us translate Stride; check out our Localization Guide.
Earn Money by Contributing
If you are a developer with solid experience in C#, rendering techniques, or game development, we want to hire you! We have allocated funds from supporters on Open Collective and can pay for work on certain projects. More information is available here.
ðºï¸ Roadmap
Our Roadmap communicates upcoming changes to the Stride engine.
ð ï¸ Building from Source
Prerequisites
- Latest Git with Large File Support selected during setup. For convenience, you might also use a Git UI client like GitExtensions.
- .NET 8.0 SDK
- Run
dotnet --info
in a console or PowerShell window to see which versions you have installed.
- Run
- Visual Studio 2022 (the Community edition is free) with the following workloads:
- .NET desktop development with .NET Framework 4.7.2 targeting pack (should be enabled by default)
- Desktop development with C++ with:
- Windows 11 SDK (10.0.22621.0) or a later version (should be enabled by default)
- MSVC v143 - VS2022 C++ x64/x86 build tools (Latest) (should be enabled by default)
- C++/CLI support for v143 build tools (Latest) (not enabled by default)
- Optional (to target iOS/Android): .NET Multi-platform App UI development and the Android SDK setup individual component (enabled by default). Then, in Visual Studio, go to
Tools > Android > Android SDK Manager
and install NDK (version 20.1+) from theTools
tab. - Optional (to build the VSIX package): Visual Studio extension development
[!NOTE] The installation of Visual Studio with the required components may require up to 14 GB of disk space, depending on your system and selected components.
[!WARNING] If this is your first time installing the .NET SDK, you might need to restart your system after the installation so that the system can recognize the new environment variables.
Build Stride
- Clone the repository using a Git UI client or from the command line:
git lfs clone https://github.com/stride3d/stride.git
- Open the solution:
- Open
<StrideDir>\build\Stride.sln
with Visual Studio 2022. - Build the
Stride.GameStudio
project in the60-Editor
solution folder (it should be the default startup project) or run it directly from Visual Studio's toolbar. - Optionally, open and build
Stride.Android.sln
,Stride.iOS.sln
, etc.
- Open
[!WARNING] Do NOT use GitHub -> Code -> Download ZIP option, as this won't include the LFS files.
Build Stride without Visual Studio
- Install Visual Studio Build Tools with the same prerequisites listed above.
- Add MSBuild to your system's PATH:
- Add MSBuild's directory to your
PATH
environment variable (e.g.,C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
).
- Add MSBuild's directory to your
- Clone the repository:
git lfs clone https://github.com/stride3d/stride.git
- Build using the command line:
- Navigate to the
/build
directory in the command prompt and run:
msbuild /t:Restore Stride.sln
- Then run:
compile.bat
- Navigate to the
If Building Fails
- Some errors for test projects are normal, GameStudio will start anyway.
- The Visual Studio extension might fail to build if you are missing the Visual Studio SDK, but Game Studio will start anyway.
- If you skipped any of the Prerequisites thinking you already have the latest version, please update to the latest to be sure.
- Visual Studio might have issues building properly if an older version is present alongside 2022. If you want to keep those versions, ensure they are up to date and that you are building Stride using Visual Studio 2022.
- Your system's
PATH
should not contain older versions of MSBuild (e.g.,...\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
should be removed). - Some changes might require a system reboot. Try that if you haven't yet, for example, if you see these errors:
Could not find a compatible version of MSBuild.
Path to dotnet executable is not set.
- Ensure that Git, Git LFS, and Visual Studio can access the internet.
- Close Visual Studio, clear the NuGet cache (
dotnet nuget locals all --clear
), delete the hidden.vs
folder inside\build
and the files insidebin\packages
, kill anymsbuild
and other Visual Studio processes, then build the whole solution and run GameStudio.
[!WARNING] Test solutions might fail, but this should not prevent you from building
Stride.GameStudio
.
Contribution Guidelines
Please check our Contributing Guidelines.
ð¬ Build Status
Branch | master |
---|---|
Windows D3D11 | |
Windows D3D12 | |
Windows Vulkan | |
Windows OpenGL | |
Windows OpenGL ES | |
iOS | |
Android | |
Linux Vulkan | |
Linux OpenGL | |
Tests Windows Simple | |
Tests Windows D3D11 |
ð Stride Documentation Landscape
The Stride documentation is organized across different locations. Here's how it's structured:
- Stride Game Engine - The main repository for Stride.
- Contributing to Stride - A guide for developers interested in contributing to or developing the Stride engine.
- Stride Website - The official site showcasing Stride, featuring:
- Stride Docs - The official documentation, including:
- Manual
- Tutorials
- Release Notes
- Ways to contribute
- API Reference
- Community Resources - Demos, articles, shaders, physics examples, and more.
- Contributing to the Docs - Guide for contributing to the Stride documentation.
- Stride Community Toolkit - A set of C# helpers and extensions to enhance your experience with the Stride game engine.
- Contributing to Toolkit - Contribute to or explore the toolkit's source code.
ð .NET Foundation
This project is supported by the .NET Foundation.
ð¡ï¸ License
Stride is covered by the MIT License unless stated otherwise (i.e. for some files that are copied from other projects). You can find the list of third-party projects here. Contributors need to sign the following Contribution License Agreement.
⨠Contributors
Thanks to all these wonderful people who have contributed to Stride!
This project follows the all-contributors specification. Contributions of any kind welcome!
Top Related Projects
Godot Engine – Multi-platform 2D and 3D game engine
Unity C# reference source code.
One framework for creating powerful cross-platform games.
Flax Engine – multi-platform 3D game engine
Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot