Code Monkey home page Code Monkey logo

arch's Introduction

Arch

Discord Maintenance Nuget License C#

A high-performance C# based Archetype & Chunks Entity Component System (ECS) for game development and data-oriented programming.

  • ๐ŸŽ๏ธ FAST > Best cache efficiency, iteration, and allocation speed. Plays in the same league as C++/Rust ECS Libs!
  • ๐Ÿš€ FASTER > Arch is on average quite faster than other ECS implemented in C#. Check out this Benchmark!
  • ๐Ÿค BARE MINIMUM > Not bloated, it's small and only provides the essentials for you!
  • โ˜•๏ธ SIMPLE > Promotes a clean, minimal, and self-explanatory API that is simple by design. Check out the Wiki!
  • ๐Ÿ’ช MAINTAINED > It's actively being worked on, maintained, and comes along several Extensions!
  • ๐Ÿšข SUPPORT > Supports .NetStandard 2.1, .Net Core 6 and 7, and therefore you may use it with Unity or Godot!

Download the package, get started today and join the Discord!

dotnet add PROJECT package Arch --version 1.3.0-alpha

โฉ Quickstart

Arch is bare minimum, easy to use, and efficient. Let's say you want to create some game entities and make them move based on their velocity... sounds complicated? It's not! Arch does everything for you, you only need to define the entities and the logic.

I bet you don't want to read tons of documentation, theory, and other boring stuff right?
Let's just ignore all that deep knowledge and jump in directly to get something done.

// Components ( ignore the formatting, this saves space )
public struct Position{ float X, Y };
public struct Velocity{ float Dx, Dy };

public sealed class Game 
{
    public static void Main(string[] args) 
    {     
        // Create a world and entities with position and velocity.
        var world = World.Create();
        for (var index = 0; index < 1000; index++) 
            world.Create(new Position{ X = 0, Y = 0}, new Velocity{ Dx = 1, Dy = 1});
        
        // Enumerate entities with Position AND Velocity to modify them
        var query = new QueryDescription().WithAll<Position,Velocity>();
        world.Query(in query, (Entity entity, ref Position pos, ref Velocity vel) => {
            pos.X += vel.Dx;
            pos.Y += vel.Dy;
            Console.WriteLine($"Moved: {entity.Id}"); 
        }); 
    }
}

Note

The example is very simple. There more features including queries without lambda or an API without generics and much more. Checkout the Documentation!

๐Ÿ’ก Highlights

This is all you need to know, with this little knowledge you are already able to bring your worlds to life.
However, if you want to take a closer look at Arch's features and performance techniques, check out the Wiki! There's more to explore, for example...

๐Ÿค Our promise

  • Bare minimum - No overengineering, no abstracted hidden costs
  • Incredibly fast and efficient
  • Is actively maintained and developed
  • Grateful for every contribution

๐Ÿš€ Features

  • Archetypes with 64KB large chunks for your massive worlds
  • Incredibly small Entity size
  • Optional Pure-ECS for maximum performance and efficiency
  • Bulk/Batch Entity operations
  • High-performance Queries
  • Multithreaded Queries
  • Enumerators
  • CommandBuffers
  • Events
  • Generic and Non-Generic API
  • AOT friendly
  • Several extensions with systems, tools, source generators and more
  • Monogame, Unity, Godot Integration guides
  • And much more...

๐Ÿงฉ Extensions

Arch has some extensions that add more features and tools. Among them for example :

  • ๐Ÿ› ๏ธ Arch.Extended > Adds a set of tools and features to save boilerplate code!
  • ๐Ÿ”Ž Godot Entity Debugger > An Arch Entity debugger for the Godot engine!
  • ๐Ÿ”Ž Stride Entity Debugger > An example of Arch in the Stride engine, with additional entity and system inspector!
  • ๐Ÿ”Ž Arch.Unity > A library that makes the integration of Arch in Unity much easier, with many cool new features!
  • โ“ Your Tool-Library? > If you develop more tools and features for Arch, let us know and we'll list them here!

๐Ÿš€ Performance

Arch is already one of the fastest ECS and uses the best techniques under the hood to achieve maximum performance and efficiency. Care is always taken to find a healthy balance between CPU performance and ram utilization.

If you are more interested, have a look at the benchmark!

๐Ÿ“– Documentation

Were we able to convince you? If so, let's get started. We have prepared a whole wiki to explain all the important aspects and provide examples. Click here for the documentation!

๐Ÿ’ป Projects using Arch

Arch is already used in some projects, for a more detailed look, take a look at the wiki!

Space Station 14 is inspired by the cult classic Space Station 13 and tells the extraordinary story of everything that can go wrong on a shift at a space station. You take on a role and complete your tasks so that the space station doesn't go to the dogs... or do the exact opposite. Prepare yourself for chaos and the finest roleplay. Best of all, SS14 is open-source and anyone can play!

An action-packed c# clone of the hit "vampire survivor" based on monogame and arch! Fight your way through hordes of different enemies, level up your character, collect permanent items and explore various maps! Try it out!

Equilibrium Engine is a data-oriented C# game engine that takes advantage of ECS pattern followed by Hot-Reloading of your libraries which allows you to quickly iterate on different aspects of your projects.

arch's People

Contributors

genaray avatar drsmugleaf avatar pheubel avatar martindevans avatar andreakarasho avatar royconskylands avatar richdog avatar reeseschultz avatar metalgearsloth avatar labbbirder avatar nathanrw avatar mindswipe avatar epicguru avatar clibequilibrium avatar beancheeseburrito avatar emelrad12 avatar hertzole avatar lilithsilver avatar mikhail-dcl avatar donaut avatar arhinzi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.