#ecs #multi-threading #performance #game-engine #library

ABC-ECS

A simple, fast, and flexible Entity-Component-System library for Rust

5 releases

0.2.1 Jul 25, 2024
0.2.0 Apr 16, 2024
0.1.5 Apr 7, 2024
0.1.4 Feb 10, 2024
0.1.3 Dec 25, 2023

#304 in Game dev

Download history 159/week @ 2024-07-25 16/week @ 2024-08-01 4/week @ 2024-08-08 6/week @ 2024-08-15 3/week @ 2024-08-22 12/week @ 2024-08-29 1/week @ 2024-09-05 7/week @ 2024-09-12 21/week @ 2024-09-19 25/week @ 2024-09-26 4/week @ 2024-10-03 6/week @ 2024-10-10 6/week @ 2024-10-17 1/week @ 2024-10-24 11/week @ 2024-10-31 7/week @ 2024-11-07

456 downloads per month
Used in 3 crates (via abc_game_engine)

MIT/Apache

100KB
2K SLoC

Performance

This ECS was built with usability in mind. That being said it is only a pseudo-ECS. As needed you can use either the run or single_entity_step and pre-step to utilize the multithreading we offer. As needed you can switch between these two methods. This ECS can be really performant if you need it to be.

ABC Game Engine - Simple ECS Framework

This Rust project provides a basic framework for managing game entities, components, and systems in the ABC Game Engine using an Entity Component System (ECS) approach.

Quick Example

Create a World:

use ABC_ECS::World;

struct Position {
    x: f32,
    y: f32,
}

struct Velocity {
    x: f32,
    y: f32,
}

fn main(){
    let mut world = World::new();

    let entities_and_components = &mut world.entities_and_components;
    // Add an Entity and Components:
    let entity = entities_and_components.add_entity();

    // Add components like Position and Velocity
    entities_and_components.add_component_to(entity, Position { x: 0.0, y: 0.0 });
    entities_and_components.add_component_to(entity, Velocity { x: 1.0, y: 1.0 });

    // or you can do it in one step:
    let entity = entities_and_components
        .add_entity_with((Position { x: 0.0, y: 0.0 }, Velocity { x: 1.0, y: 1.0 }));
}

Documentation

Visit the docs here.

Contributing

Contributions are welcome! Start by filing an issue and we can work forward from there! If you're not sure what to work on but you want to help Join the discord and ping me, I'm happy to help!

Dependencies

~1.5MB
~30K SLoC