Skip to main content

The teeniest, tiniest ECS system

Project description

tinyecs - The teeniesst, tiniest ESC system

After reading part 2 and 3 of these articles:

https://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/

I decided to implement an ECS myself, well aware that esper is a solid and long existing implementation, but I wanted to see how to implement it myself.

The base premise is: No OO and entities have no data.

So an entity is only a unique identifier. Components can be anything that can hold data, e.g. dataclasses

Workflow:

1. entity = create_entity()
2. add_component(entity, cid, component}
   ...
3. add_system(fkt, *cids)
   ...
4. in game loop run_all_systems(dt)

alternatively run_system(fkt, *cids)

If a system needs to modify components of other entities, these entities e.g. the player, need special eids so they can be queried from the registry.

use comps_of_eid(eid, *comps) for that. This way, a bullet component can substract health from a player entity.

Basic components are in the tinyecs.components package.

As of now, please look into the demos folder and read the documentation in the module. A longer howto will be added soon.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinyecs-0.2.7.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinyecs-0.2.7-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file tinyecs-0.2.7.tar.gz.

File metadata

  • Download URL: tinyecs-0.2.7.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for tinyecs-0.2.7.tar.gz
Algorithm Hash digest
SHA256 63b585441d7604f8df1e10e97efe5eadeaf296647cd3b86b1d1edc571f8ec474
MD5 c75b3cc250d8c5f5a2f25845baccf520
BLAKE2b-256 1c7fd1b92c29dcf0ef75d6305d649e3398db2bd0746b05863d7fb65438897ec9

See more details on using hashes here.

File details

Details for the file tinyecs-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: tinyecs-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for tinyecs-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 85ecd1011ae92bfe0852510011f0c05da9adbdd8827a9a801a79b5fecd7ff3cd
MD5 24c45b312bf457343dcafcedda384c35
BLAKE2b-256 458361ba29bde5a7ba68cef18400e18fec19f0374e0b0b2d6396180a8a9a4cf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page