https://github.com/overshifted/sent
Sparse set-based entity component system implementation written in a day
https://github.com/overshifted/sent
Last synced: 23 days ago
JSON representation
Sparse set-based entity component system implementation written in a day
- Host: GitHub
- URL: https://github.com/overshifted/sent
- Owner: OverShifted
- License: gpl-3.0
- Created: 2022-06-12T10:49:39.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-21T12:06:50.000Z (almost 2 years ago)
- Last Synced: 2025-02-22T08:24:45.919Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sent
This is an ECS (Entity Component System) implementation written in C++ in almost one day.
Sent was only a small experiment on sparse sets and ECS implementations heavily inspired
by [this post](https://skypjack.github.io/2020-08-02-ecs-baf-part-9/) from
[EnTT](https://github.com/skypjack/entt)'s creator and (probably) should not be
used in real-world projects. But it is simple and small enough to be understood by
enthusiasts without much effort, in a short time.
## Building
Along with the ECS itself (which is header-only), this repo contains a little benchmark
tool which can be build and executed. Since it doesn't depend on any libraries except
the C++ standard library, It can be built with most C++ toolchains out there.
On a Linux box (and generally any Unix-like box with `g++`) you can build it with
(this includes optimizations):
```sh
g++ main.cpp -o a.out -O3
```
On Windows, you should be able to build it with [MinGW](https://www.mingw-w64.org/)
or the Visual Studio compiler.
## Running
Just run the resulting executable (It will be `a.out` if you used the command above)
and give it the number of entities to be created for test on the standard input
(usually your terminal). On a Unix-like shell, you can also run:
```sh
echo N | ./a.out
```
Where `N` is the number of entities for the test.
Then, it will print the time spent on creating the entities and running some
near real-life queries on them. For more details, you can look inside `main.cpp`.
---
The "cover art" is created using [Rnote](https://rnote.flxzt.net) and inspired by
an image in [Skypjack](https://github.com/skypjack)'s blog post mentioned above
and thus is distributed under
[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/).