You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After consideration and pondering how to enable interoperability between crates for RNG usage, it becomes clear that there might be difficulty in achieving the necessary tools for querying resources/components in a robust manner.
Generic Types
The problem here is not needing to introduce more dependencies, doing things like trait queries. However, the ability to define a custom RNG algorithm might be important for particular use-cases where higher quality/secure entropy must be used, limited within app code or non-interoperable plugin code. In these cases, cross-plugin determinism is likely not going to be the priority, instead only being local determinism (for testing purposes).
Concrete Types
In most cases, devs are likely not going to care about the algorithms, just that either the RNG is fast or secure. Concrete types remove the need for trait queries and simplify the process for a plugin to determine whether a global resource or a component is available. It becomes much easier to write code to make use of a global source or fallback to a non-deterministic default.
Both types could live in the crate, but their use-cases will be separate. Documentation should provide the cases for each and what bevy plugin authors should rely on for interoperability.
The text was updated successfully, but these errors were encountered:
Due to bevyengine/bevy#7184, the resolution of this question is basically to force bevy_rand towards more concrete types instead of generics. TypePath requirements would basically require folks to manually newtype and implement TypePath on said newtype in order to get it to plug in to the generic component successfully, whereas a concrete type will avoid that pain altogether.
With reflection issues resolved and I feel the current API is stable enough to not warrant further exploration, I'm going to mark this question as closed/solved. In the end, the Generic Type approach works nicely enough, and does not warrant changing to something else.
After consideration and pondering how to enable interoperability between crates for RNG usage, it becomes clear that there might be difficulty in achieving the necessary tools for querying resources/components in a robust manner.
Generic Types
The problem here is not needing to introduce more dependencies, doing things like trait queries. However, the ability to define a custom RNG algorithm might be important for particular use-cases where higher quality/secure entropy must be used, limited within app code or non-interoperable plugin code. In these cases, cross-plugin determinism is likely not going to be the priority, instead only being local determinism (for testing purposes).
Concrete Types
In most cases, devs are likely not going to care about the algorithms, just that either the RNG is fast or secure. Concrete types remove the need for trait queries and simplify the process for a plugin to determine whether a global resource or a component is available. It becomes much easier to write code to make use of a global source or fallback to a non-deterministic default.
Both types could live in the crate, but their use-cases will be separate. Documentation should provide the cases for each and what bevy plugin authors should rely on for interoperability.
The text was updated successfully, but these errors were encountered: