{"id":29116539,"url":"https://github.com/mlange-42/ark","last_synced_at":"2025-12-30T09:26:18.880Z","repository":{"id":278238845,"uuid":"934973326","full_name":"mlange-42/ark","owner":"mlange-42","description":"Ark -- Archetype-based Entity Component System (ECS) for Go.","archived":false,"fork":false,"pushed_at":"2025-05-15T14:28:21.000Z","size":812,"stargazers_count":73,"open_issues_count":9,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-15T15:32:54.342Z","etag":null,"topics":["ecs","entity-component-system","go","golang"],"latest_commit_sha":null,"homepage":"https://mlange-42.github.io/ark/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlange-42.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null}},"created_at":"2025-02-18T17:43:07.000Z","updated_at":"2025-05-15T15:07:34.000Z","dependencies_parsed_at":"2025-03-04T20:19:24.782Z","dependency_job_id":"dac62acc-3e4f-4d1a-8006-40b92a9f1cf0","html_url":"https://github.com/mlange-42/ark","commit_stats":null,"previous_names":["mlange-42/ark"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mlange-42/ark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlange-42%2Fark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlange-42%2Fark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlange-42%2Fark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlange-42%2Fark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlange-42","download_url":"https://codeload.github.com/mlange-42/ark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlange-42%2Fark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262581513,"owners_count":23331925,"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","entity-component-system","go","golang"],"created_at":"2025-06-29T11:13:40.326Z","updated_at":"2025-12-30T09:26:18.874Z","avatar_url":"https://github.com/mlange-42.png","language":"Go","funding_links":[],"categories":["Game Development","[ECS Libraries](#contents)","游戏开发"],"sub_categories":["Search and Analytic Databases","检索及分析资料库"],"readme":"\u003cdiv align=\"center\" width=\"100%\"\u003e\n\u003ca href=\"https://github.com/mlange-42/ark\"\u003e\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/mlange-42/ark/refs/heads/main/docs/static/images/ark-logo-text-dark.svg\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/mlange-42/ark/refs/heads/main/docs/static/images/ark-logo-text-light.svg\"\u003e\n  \u003cimg alt=\"Ark Logo\" src=\"https://raw.githubusercontent.com/mlange-42/ark/refs/heads/main/docs/static/images/ark-logo-text-light.svg\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\n[![Test status](https://img.shields.io/github/actions/workflow/status/mlange-42/ark/tests.yml?branch=main\u0026label=Tests\u0026logo=github)](https://github.com/mlange-42/ark/actions/workflows/tests.yml)\n[![codecov](https://codecov.io/github/mlange-42/ark/graph/badge.svg?token=YMYMFN2ESZ)](https://codecov.io/github/mlange-42/ark)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mlange-42/ark)](https://goreportcard.com/report/github.com/mlange-42/ark)\n[![User Guide](https://img.shields.io/badge/user_guide-%23007D9C?logo=go\u0026logoColor=white\u0026labelColor=gray)](https://mlange-42.github.io/ark/)\n[![Go Reference](https://img.shields.io/badge/reference-%23007D9C?logo=go\u0026logoColor=white\u0026labelColor=gray)](https://pkg.go.dev/github.com/mlange-42/ark)\n[![GitHub](https://img.shields.io/badge/github-repo-blue?logo=github)](https://github.com/mlange-42/ark)\n[![DOI:10.5281/zenodo.14994239](https://img.shields.io/badge/10.5281%2Fzenodo.14994239-blue?label=doi)](https://doi.org/10.5281/zenodo.14994239)\n[![MIT license](https://img.shields.io/badge/MIT-brightgreen?label=license)](https://github.com/mlange-42/ark/blob/main/LICENSE-MIT)\n[![Apache 2.0 license](https://img.shields.io/badge/Apache%202.0-brightgreen?label=license)](https://github.com/mlange-42/ark/blob/main/LICENSE-APACHE)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\nArk is an archetype-based [Entity Component System](https://en.wikipedia.org/wiki/Entity_component_system) (ECS) for [Go](https://go.dev/).\n\n\u0026mdash;\u0026mdash;\n\n[Features](#features) \u0026nbsp; \u0026bull; \u0026nbsp; [Installation](#installation) \u0026nbsp; \u0026bull; \u0026nbsp; [Usage](#usage) \u0026nbsp; \u0026bull; \u0026nbsp; [Tools](#tools)\n\u003c/div\u003e\n\n## Features\n\n- Designed for performance and highly optimized. See the [Benchmarks](https://mlange-42.github.io/ark/benchmarks/).\n- Well-documented, type-safe [API](https://pkg.go.dev/github.com/mlange-42/ark), and a comprehensive [User guide](https://mlange-42.github.io/ark/).\n- [Entity relationships](https://mlange-42.github.io/ark/relations/) as a first-class feature.\n- Extensible [event system](https://mlange-42.github.io/ark/events/) with filtering and custom event types.\n- Fast [batch operations](https://mlange-42.github.io/ark/batch/) for mass manipulation.\n- No systems. Just queries. Use your own structure (or the [Tools](https://github.com/mlange-42/ark#tools)).\n- World serialization and deserialization with [ark-serde](https://github.com/mlange-42/ark-serde).\n- Zero [dependencies](https://github.com/mlange-42/ark/blob/main/go.mod), 100% [test coverage](https://app.codecov.io/github/mlange-42/ark).\n\n## Installation\n\nTo use Ark in a Go project, run:\n\n```shell\ngo get github.com/mlange-42/ark\n```\n\n## Usage\n\nBelow is the classical Position/Velocity example that every ECS shows in the docs.\n\nSee the [User Guide](https://mlange-42.github.io/ark/), [API docs](https://pkg.go.dev/github.com/mlange-42/ark) and [examples](https://github.com/mlange-42/ark/tree/main/examples) for details.\n\n```go\npackage main\n\nimport (\n\t\"math/rand/v2\"\n\t\"github.com/mlange-42/ark/ecs\"\n)\n\n// Position component\ntype Position struct {\n\tX, Y float64\n}\n\n// Velocity component\ntype Velocity struct {\n\tDX, DY float64\n}\n\nfunc main() {\n\t// Create a new World\n\tworld := ecs.NewWorld()\n\n\t// Create a component mapper\n\t// Save mappers permanently and re-use them for best performance\n\tmapper := ecs.NewMap2[Position, Velocity](world)\n\n\t// Create entities with components\n\tfor range 1000 {\n\t\t_ = mapper.NewEntity(\n\t\t\t\u0026Position{X: rand.Float64() * 100, Y: rand.Float64() * 100},\n\t\t\t\u0026Velocity{DX: rand.NormFloat64(), DY: rand.NormFloat64()},\n\t\t)\n\t}\n\n\t// Create a filter\n\t// Save filters permanently and re-use them for best performance\n\tfilter := ecs.NewFilter2[Position, Velocity](world)\n\n\t// Time loop\n\tfor range 5000 {\n\t\t// Get a fresh query and iterate it\n\t\tquery := filter.Query()\n\t\tfor query.Next() {\n\t\t\t// Component access through the Query\n\t\t\tpos, vel := query.Get()\n\t\t\t// Update component fields\n\t\t\tpos.X += vel.DX\n\t\t\tpos.Y += vel.DY\n\t\t}\n\t}\n}\n```\n\n## Tools\n\n- [ark-serde](https://github.com/mlange-42/ark-serde) provides JSON serialization and deserialization for Ark's World.\n- [ark-tools](https://github.com/mlange-42/ark-tools) provides systems, a scheduler, and other useful stuff for Ark.\n- [ark-pixel](https://github.com/mlange-42/ark-pixel) provides OpenGL graphics and live plots via the [Pixel](https://github.com/gopxl/pixel) game engine.\n\n## Cite as\n\nLange, M. \u0026 contributors (2025): Ark \u0026ndash; An archetype-based Entity Component System for Go. DOI: [10.5281/zenodo.14994239](https://doi.org/10.5281/zenodo.14994239),  GitHub repository: https://github.com/mlange-42/ark\n\n## License\n\nArk and all its sources and documentation are distributed under the [MIT license](./LICENSE-MIT) and the [Apache 2.0 license](./LICENSE-APACHE), as your options.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlange-42%2Fark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlange-42%2Fark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlange-42%2Fark/lists"}