Doprez.Stride.Arch 1.0.0.1

dotnet add package Doprez.Stride.Arch --version 1.0.0.1                
NuGet\Install-Package Doprez.Stride.Arch -Version 1.0.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Doprez.Stride.Arch" Version="1.0.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Doprez.Stride.Arch --version 1.0.0.1                
#r "nuget: Doprez.Stride.Arch, 1.0.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Doprez.Stride.Arch as a Cake Addin
#addin nuget:?package=Doprez.Stride.Arch&version=1.0.0.1

// Install Doprez.Stride.Arch as a Cake Tool
#tool nuget:?package=Doprez.Stride.Arch&version=1.0.0.1                

stride-arch-ecs

An example in Stride using Arch ECS.

Features

Ease of use

Systems can be added through the GameSettings class in the Stride editor for easy management. image

all that you need to do is inherit from the SystemBase class and add it to the list.

Add Arch components in Strides Editor!

image

each component attached will create an Entity in the Arch world, with the correct components to be able to be queried later in any systems. Example:

  • System:
namespace ArchECSStride.Code.Systems;
[DataContract(nameof(TestSystem))]
public class TestSystem : SystemBase
{
	private DebugTextSystem _debugText;
	private QueryDescription _queryDescription;

	public override void Start()
	{
		_debugText = Services.GetService<DebugTextSystem>();

		_queryDescription = new QueryDescription().
			WithAny<Vector3>();
	}

	public override void Update(in GameTime state)
	{
		var result = World.CountEntities(in _queryDescription);

		_debugText.Print($"TestSystem: {result}", new Int2(50, 50));
	}
}
  • Components:
[DataContract(nameof(ArchPosition))]
[ComponentCategory("Arch Components")]
public class ArchPosition : ArchComponent
{
	public bool UseStridePosition { get; set; } = true;
	public Vector3 StartPosition { get; set; }

	[DataMemberIgnore]
	public override object ComponentValue { get; set; } = new Vector3();

	public override void SetData()
	{
		if (UseStridePosition)
		{
			ComponentValue = Entity.Transform.Position;
		}
		else
		{
			ComponentValue = StartPosition;
		}
	}
}
[DataContract(nameof(ArchTest))]
[ComponentCategory("Arch Components")]
public class ArchTest : ArchComponent
{
	[DataMemberIgnore]
	public override object ComponentValue { get; set; } = new TestComponent();
}
public struct TestComponent
{
	public int Number;
	public string Text;
}

Easy access

When inheriting from SystemBase and registered in settings each System has access to both the Arch World and Strides Service registry.

Future goals

  • ~Allow EntityComponents to create Arch Entities with Arch Components (Partially done. I would like to have editable values in editor as well)~ Done!
  • Have an easy way to modify Stride entities with a quick access array reference.(Mostly done. I need a way to verify removing entities wont cause issues.)
  • Multithreading
  • create a basic game/demo example

Example

Below is an example of 50,000 entities randomly changing positions at a capped 144FPS. image

The only Stride performance improvement used are instanced meshes since meshes are my current big limitation.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0.1 208 12/27/2023
1.0.0 130 12/27/2023