百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

arche

> 编程语言
开源

Arche -- 基于原型的 Go 实体组件系统 (ECS)。

194 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Arche -- 基于原型的 Go 实体组件系统 (ECS)。

Arche is an archetype-based Entity Component System for Go.

Features

  • Designed for performance and highly optimized. See the Benchmarks.
  • Well-documented API and comprehensive User Guide.
  • No systems. Just queries. Use your own structure (or the Tools).
  • No dependencies. Except for unit tests (100% test coverage).
  • World serialization and deserialization with arche-serde.

[!IMPORTANT] Arche has a successor: Ark.

  • If you are new here, use Ark.
  • If you use Arche's generic API, consider migrating to Ark. It will be easy.
  • If you use Arche's ID-based API, stay with Arche.

Arche will still be maintained further.

Installation

To use Arche in a Go project, run:

bash
go get github.com/mlange-42/arche

Usage

Here is the classical Position/Velocity example that every ECS shows in the docs. It uses the type-safe generic API.

See the User Guide, API docs and examples for details. For more complex examples, see arche-demo.

…

Tools

Several tools for Arche are provided in separate modules:

  • arche-serde provides JSON serialization and deserialization for Arche's World.
  • arche-model provides a wrapper around Arche, and some common systems and resources. its purpose is to get started with prototyping and developing simulation models immediately, focussing on the model logic.
  • arche-pixel provides OpenGL graphics and live plots for Arche using the Pixel game engine.
  • arche-demo provides examples of Arche models, which can be viewed in a live demo.

Design

Unlike most other ECS implementations, Arche is designed for the development of scientific, individual-based models rather than for game development. This motivates some design decisions, with an emphasis on simplicity, safety and performance. Nevertheless, Arche can also be used for game development.

Simple core API

The ecs.World object is a pure and simple ECS implementation in the sense of a data store for entities and components, with query and iteration capabilities. More advanced features like batch operations or entity relations are provided through separate objects.

There is neither an update loop nor systems. These should be implemented by the user. For a batteries-included implementation, see module arche-model.

The type-safe generic API and advanced logic filters are provided in the packages generic and filter, respectively. Both packages are built on top of the core ecs package, so they could also be implemented by a user.

Determinism

Iteration order in Arche is deterministic and reproducible. This does not mean that entities are iterated in their order of insertion, nor in the same order in successive iterations. However, given the same operations on the ecs.World, iteration order will always be the same.

Strict and panic

Arche puts an emphasis on safety and on avoiding undefined behavior. It panics on unexpected operations, like removing a dead entity, adding a component that is already present, or attempting to change a locked world. This may not seem idiomatic for Go. However, explicit error handling in performance hot spots is not an option. Neither is silent failure, given the scientific background.

Limitations

  • The number of component types per World is limited to 256. This is mainly a performance decision.
  • The number of entities alive at any one time is limited to just under 5 billion (uint32 ID).

Benchmarks

A tabular overview of the runtime cost of typical Arche ECS operations is provided under benchmarks in the Arche's User Guide.

For a benchmark comparison with other ECS implementations, see the go-ecs-benchmarks repository.

Cite as

Lange, M. (2023): Arche – An archetype-based Entity Component System for Go. DOI 10.5281/zenodo.7656484, GitHub repository: https://github.com/mlange-42/arche

License

This project is distributed under the MIT license.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goecsentity-component-systemgogolang

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言