alecthomas / alecthomas/entityx

Are memory requirements O(entities * component types)?

オープン
#201 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
2.3k
フォーク
301
PR マージ指標
30日以内にマージされた PR はありません

説明

Reading the code, it seems to me like components share the index of their Entity, e.g. the Position Component for Entity #1,000,000 will the 1,000,000th Position Component in the Position Component Pool.

Am I understanding this correctly? If I have 1,000,000 entities, and there is one instance of the Foobar component, but it happens to be on entity 999,999, then we'll have to eat the memory of unused 999,998 unused components in the Foobar pool?

Am I reading the code correctly? If I'm wrong, can you help me understand how?

I'm mainly looking at EntityManager::assign to make this determination, specifically in the placement new:

::new(pool->get(id.index())) C(std::forward(args) ...);

where `pool` is the component pool, and `id` is the entity id.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。