JavaECS/README.md

29 lines
1.9 KiB
Markdown
Raw Normal View History

2021-05-22 14:32:59 +12:00
# JavaECS
2021-06-15 18:28:27 +12:00
An implementation of an Entity-Component-System written in Java.
2021-06-13 14:21:09 +12:00
## Introduction to ECS
The primary goal of an ECS is to provide fast access to many entities; especially where those entities share many of the same properties. It also solves issues regarding adaptability in an inheritance-based engine.
ECS is more of a conceptual idea rather than an actual engine structure. There exists many variations of the concept, each adding in different features and models as required.
2021-06-15 18:28:27 +12:00
The primary example of an ECS is [EnTT](https://github.com/skypjack/entt), which is used in Mojang's Minecraft.
2021-06-13 14:21:09 +12:00
There are four key elements to an ECS:
1. The **entity**, which is a simple ID, usually an index.
2. The **component**, which is a struct or class that stores data
3. The **system**, which is a functionality that is executed regularly by the engine.
4. The **engine** (*sometimes split into parts called 'managers'*), which controls the interaction between these components, and provides access to the external program.
## About JavaECS
The focus of JavaECS is more about the structure rather than raw performance. It remains performant, but there may be multiple areas where improvements can be made.
2021-06-15 18:26:43 +12:00
In a quick port of Alex Beimler's [ECS Benchmark](https://github.com/abeimler/ecs_benchmark), JavaECS performs at about the same speed as [ECS](https://github.com/redxdev/ECS) (~90 ms). The results aren't normalised between test environments, so take them with a grain of salt; but it tends to suggest that the project has decent performance.
2021-06-13 14:21:09 +12:00
2021-06-15 18:26:43 +12:00
This project is inspired by:
* [C++ implementation](https://austinmorlan.com/posts/entity_component_system/) by Austin Morlan.
* [Nomad Game Engine](https://medium.com/@savas/nomad-game-engine-part-2-ecs-9132829188e5) by Niko Savas
* [EntityX](https://github.com/alecthomas/entityx) by Alec Thomas.
2021-06-13 14:21:09 +12:00
## Implementation
2022-01-10 13:39:43 +13:00
See the [documentation](https://git.software.kauripeak.co.nz/BrychanD/JavaECS-Docs/wiki) for implementation details