Unity's Licensing Changes: Discovering Stride, a Community-Driven Open Source Engine

author
Vaclav Elias

Explore the key differences between Unity and Stride, a C#-based, open-source game engine powered by .NET 6 (soon .NET 8). Learn how Stride's flexibility and native .NET support offer a unique development experience.

Table of Contents:

Introduction to Stride πŸ”—

Stride is not just another game engine; it's written entirely in C# and serves as a powerful platform in the .NET ecosystem. This unique focus on C# offers developers the native .NET tooling and functionalities they are already comfortable with. What sets Stride apart is its project structure; Stride projects are standard csproj files, allowing them to integrate effortlessly into your existing .NET solutions.

Difference Between Unity and Stride πŸ”—

Unity is developed by a large team and offers a feature-rich experience. On the other hand, Stride is open-source and built by community contributors.

This means that Stride might not have all the features that Unity has, simply because there aren't as many people working on it. However, the open-source nature of Stride allows you to customize it according to your needs and provides a solid foundation for any rendering project.

Additionally, Stride allows you to utilize any NuGet package and even provides access to the Main function of your game. You can also find useful resources such as documentation, community toolkits, and guides for migrating from Unity to Stride.

Licensing πŸ”—

Stride is released under the MIT license, which is important because it grants you significant freedoms to use, modify, and distribute the engine.

What games were made using Stride? πŸ”—

For examples of games developed using Stride, check out Made with Stride section.

Operating System Support πŸ”—

  • Editor: Windows
  • Runtime: Windows, Linux, macOS, Android, iOS

IDE Support πŸ”—

Stride games are "standard" C# projects, meaning you can use a variety of IDEs:

  • VS Code
  • Visual Studio 2022
  • Rider
  • Blocknote + MsBuild
  • VVVV

Note: There's a Visual Studio extension for syntax highlighting, shader build keys and error checking.

Note: Another extension offers syntax highlighting only.

.NET Hot Reload Support πŸ”—

Stride has the capability of using .NET Hot Reload for C# scripts, allowing real-time code modifications as your game runs. Importantly, this feature is also available when editing the engine side, giving you even more flexibility. Standard .NET hot reload rules are in effect.

This feature streamlines development by minimizing the delay between coding and observing results, enhancing both efficiency and ease of use. If you're familiar with .NET and C#, you'll find that Hot Reload in Stride feels intuitively familiar.

Multiplayer Support πŸ”—

Stride does not offer built-in multiplayer or Server/Client architecture. However, you can easily integrate any .NET networking library to implement these features. You have the freedom to choose from a variety of libraries and resources. For a curated list, you can check out Awesome-Stride's Networking section.

Unity Assets πŸ”—

You can import some 3D models from the Unity store into Stride. However, scripts will need modification since the two engines differ.

These are the basic Scripting Differences:

  • StartupScript is a MonoBehaviour without the Update method
  • SyncScript is a MonoBehaviour with an Update method that runs every frame
  • AsyncScript is unique and runs asynchronously

Screen Capture πŸ”—

To capture a frame, you can use the following code snippet:

var commandList = GraphicsContext.CommandList;

commandList.RenderTarget.Save(commandList, stream, ImageFileType.Png);

Shaders Available πŸ”—

SDSL is a shader language written on top of HLSL.

Build Automation πŸ”—

Yes, since Stride uses .NET, automating the build process works out-of-the-box.

Add-ons and Extensions πŸ”—

You cannot extend the editor in the same way as Unity, but you can create custom code extensions as seen in the following:

Transformations πŸ”—

The TransformComponent class in Stride is a fundamental component for representing an entity's position, rotation, and scale within a 3D scene.

Important Features:

  • LocalMatrix and WorldMatrix: These matrices manage the transformations of the entity.
  • Position, Rotation, and Scale: These properties represent the entity's position, rotation, and scale in the local coordinate system. The Position property is a Vector3, defining the entity's position. The Rotation property uses a Quaternion to represent the entity's rotation, and the Scale property is a Vector3 that sets the scale. You can modify these properties to transform the entity.
  • UpdateLocalMatrix() and UpdateWorldMatrix(): These methods update the local and world matrices, respectively.
  • Parent and Children: These properties allow you to establish parent-child relationships between entities, affecting their transformations accordingly.

Rendering πŸ”—

Stride primarily uses clustered forward rendering, with some additional features. Read more in the docs.

Gamepads πŸ”—

Other Q&A πŸ”—

What is the Equivalent of a Coroutine in Stride? πŸ”—

Unlike Unity, which uses IEnumerator for asynchronous code execution, Stride leverages C#'s built-in await and async features. This can be accomplished using AsyncScript, which essentially acts as a SyncScript (the Stride equivalent of Unity's MonoBehaviour) but with asynchronous methods. You can use async methods within sync scripts, the same as standard C#.

What is a StartupScript? πŸ”—

A StartupScript in Stride includes a Start method that is invoked when it's added to the scene tree. This is similar to Unity's Start or Awake methods. However, StartupScript does not contain Update methods and therefore doesn't execute code every frame.

Using Other Assemblies/Projects in Stride πŸ”—

In Unity, the packaging system is built on top of a csproj file, which allows Unity to protect its proprietary source code. Stride, however, grants you full access to your csproj and sln (Solution) files. This enables you to include any NuGet packages or other C# projects in the usual way, by adding project references. If you add a new subproject to your main project through the Stride editor, it will be correctly configured by default, including folder location and references to the Stride engine.

Is There an Asset Store for Stride? πŸ”—

No, Stride does not have a dedicated Asset Store. However, most additional libraries specially designed for Stride can be found on GitHub or NuGet. For easier discovery, a summary has been made available at Awesome-Stride.

Null Checking in Stride vs Unity πŸ”—

Does is null and == null work? Unlike Unity, which has overridden the Equals operator to be compatible with its C++ engine, Stride allows you to use is null and == null to compare the existence of an Entity or Component directly.

Where to Start πŸ”—

Getting started with Stride is easy, thanks to a wealth of resources available. Here are some you shouldn't miss:

  • Stride's Manual: A comprehensive guide that covers everything from basic setup to advanced features.
  • Stride's Tutorials: Step-by-step tutorials to help you get your first project off the ground.
  • Discord: Join the community on Discord for real-time discussions and the latest updates.

How to Find Answers πŸ”—

Consider checking these platforms where your query may have already been addressed or where you can gain more context:

  • Discord: Use the search functionality in our Discord channel to see if your topic has been discussed before.
  • GitHub Issues: Navigate to Stride's GitHub Issues to see if your question is related to a known issue or feature request.
  • GitHub Discussion: Participate in Stride's GitHub Discussions to engage with the community and explore various topics.

This proactive approach not only helps you get immediate answers but also makes it easier for the community to focus on unresolved or unique queries.

🀝 Join Us: Stride Bug Bounties and Feature Funding πŸ› οΈ πŸ”—

We invite talented developers to collaborate with us through our Bug and Feature Bounties. With tasks ranging from Vulkan support to decals and morph targets, there's something for everyone! Reach out via the specific GitHub Bounty tickets to get involved.

πŸ“¬ For suggestions on new bounties, don't hesitate to connect with us on our Discord server or directly through GitHub.

Participating in our bug bounties is a win-win! Not only will you be able to hone your skills, but you'll also contribute to the expansion and enrichment of the Stride communityβ€”and get compensated for your efforts! πŸ’°

Stride's Open Collective Projects

Flappy Bird - Stride Engine Demo πŸ”—

Ned Reid, a new member of the Stride community, has created a Flappy Bird demo, while exploring Stride as an alternative to Unity. He shared the following thoughts on his experience:

I decided a couple of days ago that I would explore engines outside of Unity (for obvious reasons), and wanted to start with something simple. Over a fairly relaxed weekend, I've managed to put together a neat little Flappy Bird clone!

Flappy Bird Stride Demo

A screenshot of the Flappy Bird demo created by Ned Reid

Closing Thoughts πŸ™‚ πŸ”—

If you've made it this far, congratulations πŸŽ‰! You now have a comprehensive understanding of Stride, its capabilities, and how it compares to Unity. The world of game development is vast and ever-changing 🌍, but the emergence of community-driven, open-source engines like Stride showcases the exciting directions the industry is taking. With its C# focus 🎯, extensive .NET support πŸ’», and flexible licensing πŸ“œ, Stride is a formidable option for both new and experienced developers.

As the saying goes, the best way to learn is by doing πŸ› οΈ. So dive in 🏊, start a project πŸš€, and don't hesitate to participate in the community discussions on Discord or GitHub πŸ‘¨β€πŸ’»πŸ‘©β€πŸ’». Your journey with Stride is what you make of it, and the resources and community are here to support you every step of the way πŸ€—.

Thank you for reading πŸ“–, and happy coding πŸ’»πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»!


.NET

Any comments? You can start πŸ—¨ at GitHub Discussions or Discord.

Edit this page on .