{"id":21564618,"url":"https://github.com/ecsx-framework/ecsx","last_synced_at":"2025-05-15T20:02:52.894Z","repository":{"id":46097796,"uuid":"503874915","full_name":"ecsx-framework/ECSx","owner":"ecsx-framework","description":"An Entity-Component-System framework for Elixir","archived":false,"fork":false,"pushed_at":"2025-01-25T22:56:19.000Z","size":241,"stargazers_count":234,"open_issues_count":13,"forks_count":11,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-08T04:11:23.300Z","etag":null,"topics":["ecs","elixir","entity-component-system","game-development","game-server-framework","realtime","simulation"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ecsx-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-15T18:11:08.000Z","updated_at":"2025-04-03T14:50:41.000Z","dependencies_parsed_at":"2023-02-10T18:15:17.039Z","dependency_job_id":"c5600d81-3d3c-4e6f-8f39-8394eb3c1258","html_url":"https://github.com/ecsx-framework/ECSx","commit_stats":null,"previous_names":["ecsx-framework/ecsx","apb9785/ecsx"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecsx-framework%2FECSx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecsx-framework%2FECSx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecsx-framework%2FECSx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecsx-framework%2FECSx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecsx-framework","download_url":"https://codeload.github.com/ecsx-framework/ECSx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773719,"owners_count":20993639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecs","elixir","entity-component-system","game-development","game-server-framework","realtime","simulation"],"created_at":"2024-11-24T10:16:34.889Z","updated_at":"2025-04-08T04:11:28.323Z","avatar_url":"https://github.com/ecsx-framework.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ECSx\n\n[![Hex Version](https://img.shields.io/hexpm/v/ecsx.svg)](https://hex.pm/packages/ecsx)\n[![License](https://img.shields.io/hexpm/l/ecsx.svg)](https://github.com/ecsx-framework/ECSx/blob/master/LICENSE)\n[![Documentation](https://img.shields.io/badge/documentation-gray)](https://hexdocs.pm/ecsx)\n\nECSx is an Entity-Component-System (ECS) framework for Elixir. ECS is an architecture for building real-time games and simulations, wherein data about Entities is stored in small fragments called Components, which are then read and updated by Systems.\n\n## Setup\n\n- Add `:ecsx` to the list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ecsx, \"~\u003e 0.5\"}\n  ]\nend\n```\n\n- Run `mix deps.get`\n- Run `mix ecsx.setup`\n\n## Upgrading\n\nWhile ECSx is pre-v1.0, minor version updates will contain breaking changes.  If you are upgrading an application from ECSx 0.4.x or earlier, please refer to our [upgrade guide](https://hexdocs.pm/ecsx/upgrade_guide.html).\n\n## Tutorial Project\n\n[Building a ship combat engine with ECSx in a Phoenix app](https://hexdocs.pm/ecsx/initial_setup.html)  \nNote: This tutorial project is a work-in-progress\n\n## Usage\n\n### Entities and Components\n\nEverything in your application is an Entity, but in ECS you won't work with these Entities directly - instead you will work with the individual attributes that an Entity might have. These attributes are given to an Entity by creating a Component, which holds, at minimum, the Entity's unique ID, but also can store a value. For example:\n\n- You're running a 2-dimensional simulation of cars on a highway\n- Each car gets its own `entity_id` e.g. `123`\n- If the car with ID `123` is blue, we give it a `Color` Component with value `\"blue\"`\n- If the same car is moving west at 60mph, we might model this with a `Direction` Component with value `\"west\"` and a `Speed` Component with value `60`\n- The car would also have Components such as `XCoordinate` and `YCoordinate` to locate it on the map\n\n### Systems\n\nOnce your Entities are modeled using Components, you'll create Systems to operate on them. For example:\n\n- Entities with `Speed` Components should have their locations regularly updated according to the speed and direction\n- We can create a `Move` System which reads the `Speed` and `Direction` Components, calculates how far the car has moved since the last server tick, and updates the Entity's `XCoordinate` and/or `YCoordinate` Component accordingly.\n- The System will run every tick, only considering Entities which have a `Speed` Component\n\n### Generators\n\nECSx comes with generators to quickly create new Components or Systems:\n\n- `mix ecsx.gen.component`\n- `mix ecsx.gen.system`\n\n### Manager\n\nEvery ECSx application requires a Manager module, where valid Component types and Systems are declared, as well as the setup to spawn world objects before any players join. This module is created for you during `mix ecsx.setup` and will be automatically updated by the other generators.\n\nIt is especially important to consider the order of your Systems list. The manager will run each System one at a time, in order.\n\n### Persistence\n\nComponents are not persisted by default. To persist an entity, use the `persist: true` option when adding the component. The default adapter for persistence is the [ECSx.Persistence.FileAdapter](lib/ecsx/persistence/file_adapter.ex), which stores the components in a binary file. The adapter can be changed using the `persistence_adapter` application variable:\n\n```elixir\nconfig :ecsx,\n  ...\n  persistence_adapter: ...\n```\n\nCurrently available Persistence Adapters (see links for installation/configuration instructions):\n\n- [ECSx.Persistence.Ecto](https://github.com/ecsx-framework/ecsx_persistence_ecto)\n\n## License\n\nCopyright (C) 2022 Andrew P Berrien\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU General Public License](https://www.gnu.org/licenses/gpl.html) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecsx-framework%2Fecsx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecsx-framework%2Fecsx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecsx-framework%2Fecsx/lists"}