Comments (5)
Yeah, I don't see how an example for the wrong tool can help.
You first need to read the documentation for that tool. Then you want to understand if it's a good fit for your problem. Finally, an example will tell you more about the API and the correct usage.
My gut feeling is that you don't know what a group is for. I can write thousands example but they won't help here. For example:
this doesn't work and I don't know how to delare cameras as a group of camera components
Why do you think a group is the way to go? Perhaps because the name group sounds quite close to what you would call the class you need? I strongly suspect EnTT groups are not what you're looking for because they do a different thing (carefully describred in the documentation).
Let's try a different approach. What problem are you facing? Can you describe it in details?
Once we know what you want to solve and understand what the right tool is, writing an example will be easier and faster than writing an example for a tool that isn't what you're looking for.
from entt.
I mean, you can find how groups work and what their purpose is in the documentation. Have you already checked it? What you're trying to do tells me that you didn't probably.
In this case, I don't know how an example could help. You would never find an example regarding groups to do what you want and you would still open an issue saying that the examples are not clear.
The documentation is there for a reason. That's the first thing to read. Later, when we know what the tools are for, then an example can be useful. My two cents. 🤷♂️
from entt.
Sorry, but documentation without examples is hard to read. For me, could be personal. I must see some examples before understanding the documentations. If you have time, please add some examples for each api you have. that will help a lot.
from entt.
First, your code snippet is wrong. entt::basic_group
is a template class and I'm not sure that you can construct a group from a view.
Second, I believe your approach with shared pointers is not viable at least for EnTT. Entities are simple numbers with no other payload attached to them (unless you define your own entity type). If you need to store entities, just store them.
Third, what do you mean by "if you have entities that you use often, you wouldn't choose to mix them with thousands of other entities"? If you need to filter entities by trait, attach a tag-like component to them and use views for accessing them (or groups if you find out that the added performance worth it considering the "price" of using groups). If you have "few" entities that you use and you don't want to use components for filtering them, then, again, just store them in a struct or any container.
As for examples, read Micheles blog regarding EnTT and ECS, look through unit tests, look at the projects that are linked in README as using EnTT.
from entt.
Adding examples is on the roadmap, no need to keep another issue around for that.
On the other side, I assume that the original problem was solved somehow since the issue is starving.
I'll close this issue as invalid but feel free to comment further if you have still problems. Thanks. 👍
from entt.
Related Issues (20)
- Working with multiple storages for the same type and preparing a view for each of the storages HOT 3
- entt build error: unused type alias 'common_type' HOT 9
- assert on destroy (inside of release function) non-orphan entity HOT 8
- Handling large tilemap HOT 7
- Acecss components of an entity, without giving full registry access HOT 14
- bazel version and compatibility number out of sync HOT 5
- storage<entt::entity>("id"_hs) should be asserted against HOT 2
- Get a view of components with a certain trait HOT 2
- Groups not functioning without sigh_mixin HOT 1
- Reliability across a network?
- Can't emplace component derived from std::vector HOT 4
- Iterating over all entities HOT 2
- Documentation references the deprecated registry-based `entt::to_entity` API HOT 2
- Is basic_collector::update supposed to support a list of component types? HOT 2
- entt.wiki has filenames with : in them, which probably causes problems with Git on Windows HOT 3
- ENTT WIKI: The Game Engine Series's Big Brother HOT 1
- registry.valid() causing an exception instead of returning false HOT 5
- Include assertion message in underlying `assert` call HOT 2
- Proposal: Automatic signal registration for components HOT 2
- meta: data function fails if setter is noexcept HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from entt.