Skip to content

Initial draft of update for Flecs 4.1.0. #99

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spacechase0
Copy link

The diffs are messed up because I messed up line endings trying to get the generated files to not go crazy with git replacing them just for line endings.

Looks like I just made things worse (every included file has the entire thing as the diff, ugh), so this will stay as a draft PR unless I can figure out how to fix that.
(I'd like to suggest having the generated files not included in the repository and just making it generate as part of the build process (maybe with source generators if the current implementation is hard to fit in correctly).


New features are untested (though some, like the script builder functions functionality, might see testing by me soon).

What I didn't do:

  • Docs for things I added
  • New tests/examples (such as with the new function stuff for the script builder)
  • Unsure if relevant, breaking change to match a C++-specific change (entity::get returns ref, new try_get): Breaking API changes SanderMertens/flecs#466 (comment)
  • Unsure if relevant, breaking change to match a C++-specific change (entity::get_constant added to make up for get having changed(?)): Breaking API changes SanderMertens/flecs#466 (comment)
  • Unsure if relevant, new API function to match a C++-specific one (entity::assign)
  • A bunch of safety checks in the script function/method/constant stuff (and a not-janky implementation of them in general)
  • Anything that is new in the full changelog, but not in the release announcement's highlights

Breaking change made by me, specifically to the C# binding:

  • When registering a prefab associated with a C# type (such as world.Prefab<SomeStruct>()), the prefab can no longer have any fields.
    • This was causing problems in native flecs: fatal: sparse_storage.c: 124: assert: tgt != 0 INTERNAL_ERROR
    • Something to do with relationships being sparse/nonfragmenting now I think? (There's a good chance I'm wrong on that though)
    • This behavior could probably be restored, maybe by making the C# type correspond to a component, but the Prefab<>(...) call makes a prefab with a separate id that always includes the component (using the World.SetWith functionality, possibly)? But I didn't feel like doing the refactoring for that.

New features are untested (though some, like the script builder functions, might see testing by me soon).

What I didn't do:
* Docs for things I added
* New tests/examples (such as with the new function stuff for the script builder)
* Unsure if relevant, breaking change to match a C++-specific change (entity::get returns ref, new try_get): SanderMertens/flecs#466 (comment)
* Unsure if relevant, breaking change to match a C++-specific change (entity::get_constant added to make up for get having changed(?)): SanderMertens/flecs#466 (comment)
* Unsure if relevant, new API function to match a C++-specific one (entity::assign)
* A bunch of safety checks in the script function/method/constant stuff (and a not-janky implementation of them in general)
* Anything that is new in the full changelog, but not in the release announcement's highlights

Breaking change made by me specifically to the C# binding:
* When registering a prefab associated with a C# type (such as `world.Prefab<SomeStruct>()`), the prefab can no longer have any fields.
 * This was causing problems in native flecs: `fatal: sparse_storage.c: 124: assert: tgt != 0 INTERNAL_ERROR`
 * Something to do with relationships being sparse/nonfragmenting now I think? (There's a good chance I'm wrong on that though)
 * This behavior could probably be restored, maybe by making the C# type correspond to a component, but the Prefab<>(...) call makes a prefab with a separate id that always includes the component (using the World.SetWith functionality, possibly)? But I didn't feel like doing the refactoring for that.

I was having some issues with committing line endings for the generated files.
Hopefully I only included the ones that actually got functional changes? I'd like to suggest having the generated files not included in the repository and just making it generate as part of the build process (maybe with source generators if the current implementation is hard to fit in correctly).
@spacechase0 spacechase0 mentioned this pull request Aug 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant