Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity Queries #3

Open
13 tasks
doonv opened this issue Dec 26, 2023 · 10 comments
Open
13 tasks

Entity Queries #3

doonv opened this issue Dec 26, 2023 · 10 comments
Labels
A-Builtin-Parser This is related to the Built-in Parser C-Enhancement New feature or request

Comments

@doonv
Copy link
Owner

doonv commented Dec 26, 2023

Currently, you cannot access entities properties. In order to access entities properties we will need entity queries. Entity queries will be a built-in parser feature that will allow you to query the entities you choose and modify them.

Design

Todo list for the design of the entity queries.

  • Design the syntax.
    • Id queries
      • This should probably be just the entity id, very simple.
    • Single queries
      • Queries for a single entity and provides access to all of their components.
    • For-each queries
      • Queries for a group of entities based on their components and executes a command on each of them.
  • Figure out how to create dynamic reflection-based queries at runtime.

Implementation

After the design has been finished, we can start the implementation.

  • Parsing
    • Id Queries
    • Single queries
    • For-each queries
  • Execution
    • Id Queries
    • Single queries
    • For-each queries
@doonv doonv added C-Enhancement New feature or request A-Builtin-Parser This is related to the Built-in Parser labels Dec 26, 2023
@nicopap
Copy link

nicopap commented Jan 5, 2024

I've designed a DSL for querying here https://github.com/nicopap/bevy_mod_dynamic_query/tree/main/examples/query_interpreter#query-grammar if you need some inspiration. You can always re-use the bevy type DSL though.

@doonv
Copy link
Owner Author

doonv commented Jan 5, 2024

That looks cool, How will I go from the regular built-in parser to the DSL though?

@nicopap
Copy link

nicopap commented Jan 5, 2024

I mean, you write a grammar that supports the rust syntax. The full parser for both syntax is defined here https://github.com/nicopap/bevy_mod_dynamic_query/blob/149b5d4a5a3611373b99b83bc9075cbd7d03b01e/examples/query_interpreter/src/query_parser.rs. Similarly to video game FX, no need to support all the intricacies of the rust syntax, it just need to look like it :P

@doonv
Copy link
Owner Author

doonv commented Jan 5, 2024

I meant something like $( insert query here ).MyProperty = 5.4. The $( ... ) transitions from the built-in parser's language to the Querying DSL. I kinda like the $( ... ) syntax what do you think?

@nicopap
Copy link

nicopap commented Jan 5, 2024

Always can use a keyword that it a rust keyword, so that you are sure to avoid overlapping with pre-existing field names. For example for ( bindings ) in <query> { … }. Or terser yet: for(<query>).… (yield?). I also like the functional style, swapping for with map.

@doonv
Copy link
Owner Author

doonv commented Jan 8, 2024

@nicopap I'd like to use your bevy_mod_dynamic_query library for this, and I have a few issues with it. but it looks like issues are disabled. Can you re-enable them?

@nicopap
Copy link

nicopap commented Jan 8, 2024

Issues are now re-enabled on bevy_mod_dynamic_query.

@doonv
Copy link
Owner Author

doonv commented Jan 8, 2024

Thanks!

@doonv
Copy link
Owner Author

doonv commented Jan 8, 2024

Ah turns out my issue is actually not a problem.

@doonv
Copy link
Owner Author

doonv commented Jan 19, 2024

This is currently blocked by either of the following:

  • bevy_mod_dynamic_query isnt updated for Bevy 0.12.
  • Bevy 0.13 has dynamic querying, but it isn't released yet.

@doonv doonv added Upstream S-Blocked This cannot more forward until something else changes labels Jan 19, 2024
@doonv doonv removed the Upstream label Feb 19, 2024
doonv added a commit that referenced this issue Feb 24, 2024
# Objective

Update to Bevy 0.13

Fixes #1.
Unblocks #3.

## Solution

Update `bevy` to `0.13`, `bevy_egui` to `0.25`, and `logos` to `0.14`.

Also fixed some bugs.
@doonv doonv removed the S-Blocked This cannot more forward until something else changes label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Builtin-Parser This is related to the Built-in Parser C-Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants