All Projects → amethyst → Specs

amethyst / Specs

Licence: other
Specs - Parallel ECS

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to Specs

Aws Workflows On Github
Workflows for automation of AWS services setup from Github CI/CD
Stars: ✭ 95 (-95.23%)
Mutual labels:  ecs
Gdk For Unity Fps Starter Project
SpatialOS GDK for Unity FPS Starter Project
Stars: ✭ 119 (-94.03%)
Mutual labels:  ecs
Terraform Aws Airship Ecs Service
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible
Stars: ✭ 139 (-93.02%)
Mutual labels:  ecs
Geotic
Entity Component System library for javascript
Stars: ✭ 97 (-95.13%)
Mutual labels:  ecs
Edyn
Edyn is a real-time physics engine organized as an ECS.
Stars: ✭ 113 (-94.33%)
Mutual labels:  ecs
Ecs Exporter
Export AWS ECS cluster metrics to Prometheus
Stars: ✭ 127 (-93.62%)
Mutual labels:  ecs
Ecs Nginx Proxy
Reverse proxy for AWS ECS. Lets you address your docker containers by sub domain.
Stars: ✭ 93 (-95.33%)
Mutual labels:  ecs
Littlebee
关于帧同步和ECS的实现
Stars: ✭ 145 (-92.72%)
Mutual labels:  ecs
Ecs Formation
Tool to build Docker cluster composition for Amazon EC2 Container Service(ECS)
Stars: ✭ 114 (-94.28%)
Mutual labels:  ecs
Sequentity
A single-file, immediate-mode sequencer widget for C++17, Dear ImGui and EnTT
Stars: ✭ 134 (-93.27%)
Mutual labels:  ecs
Rhusics
A cgmath physics library that can be used with Specs
Stars: ✭ 105 (-94.73%)
Mutual labels:  ecs
Aws Ecs Airflow
Run Airflow in AWS ECS(Elastic Container Service) using Fargate tasks
Stars: ✭ 107 (-94.63%)
Mutual labels:  ecs
Flecs
A fast entity component system (ECS) for C & C++
Stars: ✭ 2,201 (+10.49%)
Mutual labels:  ecs
Entitas Sync Framework
Networking framework for Entitas ECS. Targeted at turnbased games or other slow-paced genres.
Stars: ✭ 98 (-95.08%)
Mutual labels:  ecs
Ape Ecs
Entity-Component-System library for JavaScript.
Stars: ✭ 137 (-93.12%)
Mutual labels:  ecs
Specs Physics
nphysics integration for the Specs entity component system
Stars: ✭ 94 (-95.28%)
Mutual labels:  ecs
Pyro
A linear Entity Component System
Stars: ✭ 125 (-93.72%)
Mutual labels:  ecs
Ecs
ECS for Unity with full game state automatic rollbacks
Stars: ✭ 151 (-92.42%)
Mutual labels:  ecs
Ladder
A general purpose extensible autoscaler for the cloud
Stars: ✭ 143 (-92.82%)
Mutual labels:  ecs
Designing Cloud Native Microservices On Aws
Introduce a fluent way to design cloud native microservices via EventStorming workshop, this is a hands-on workshop. Contains such topics: DDD, Event storming, Specification by example. Including the AWS product : Serverless Lambda , DynamoDB, Fargate, CloudWatch.
Stars: ✭ 131 (-93.42%)
Mutual labels:  ecs

Specs

Specs Parallel ECS

Build Status Crates.io Gitter MIT/Apache Docs.rs Code coverage LoC

Specs is an Entity-Component System written in Rust. Unlike most other ECS libraries out there, it provides

  • easy parallelism
  • high flexibility
    • contains 5 different storages for components, which can be extended by the user
    • its types are mostly not coupled, so you can easily write some part yourself and still use Specs
    • Systems may read from and write to components and resources, can depend on each other and you can use barriers to force several stages in system execution
  • high performance for real-world applications

Minimum Rust version: 1.40

Link to the book

Example

use specs::prelude::*;

// A component contains data
// which is associated with an entity.
#[derive(Debug)]
struct Vel(f32);

impl Component for Vel {
    type Storage = VecStorage<Self>;
}

#[derive(Debug)]
struct Pos(f32);

impl Component for Pos {
    type Storage = VecStorage<Self>;
}

struct SysA;

impl<'a> System<'a> for SysA {
    // These are the resources required for execution.
    // You can also define a struct and `#[derive(SystemData)]`,
    // see the `full` example.
    type SystemData = (WriteStorage<'a, Pos>, ReadStorage<'a, Vel>);

    fn run(&mut self, (mut pos, vel): Self::SystemData) {
        // The `.join()` combines multiple component storages,
        // so we get access to all entities which have
        // both a position and a velocity.
        for (pos, vel) in (&mut pos, &vel).join() {
            pos.0 += vel.0;
        }
    }
}

fn main() {
    // The `World` is our
    // container for components
    // and other resources.
    let mut world = World::new();
    world.register::<Pos>();
    world.register::<Vel>();

    // An entity may or may not contain some component.

    world.create_entity().with(Vel(2.0)).with(Pos(0.0)).build();
    world.create_entity().with(Vel(4.0)).with(Pos(1.6)).build();
    world.create_entity().with(Vel(1.5)).with(Pos(5.4)).build();

    // This entity does not have `Vel`, so it won't be dispatched.
    world.create_entity().with(Pos(2.0)).build();

    // This builds a dispatcher.
    // The third parameter of `with` specifies
    // logical dependencies on other systems.
    // Since we only have one, we don't depend on anything.
    // See the `full` example for dependencies.
    let mut dispatcher = DispatcherBuilder::new().with(SysA, "sys_a", &[]).build();
    // This will call the `setup` function of every system.
    // In this example this has no effect since we already registered our components.
    dispatcher.setup(&mut world);

    // This dispatches all the systems in parallel (but blocking).
    dispatcher.dispatch(&mut world);
}

Please look into the examples directory for more.

Public dependencies

crate version
hibitset hibitset
rayon rayon
shred shred
shrev shrev

Contribution

Contribution is very welcome! If you didn't contribute before, just filter for issues with "easy" or "good first issue" label. Please note that your contributions are assumed to be dual-licensed under Apache-2.0/MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].