Tweaking 3rd Party Plugins #1547
alice-i-cecile
started this conversation in
Ideas
Replies: 1 comment
-
They did, #1576. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
3rd-party plugins are great. But what happens if you need to change how they work?
There are two extremes here:
Both have their merits. The black-box approach:
The white-box approach:
As raised by @cart in #1512, these questions parallel those of public APIs in general, and the
pub
andmodule
framework in Rust itself. Rather than aiming for either extreme, we should be encouraging plugin authors (including Bevy itself) to define and expose thoughtful public APIs to hook into.Types of conflict
Why might we want to interfere with a plugins internals? Here's my best attempt at the important use cases:
What can be changed?
Systems are by far the largest part of every plugin, and the most contentious.
Resources and entities that a plugin might use, under the current design, can usually be queried for and then overridden or removed. This is impossible if the underlying types are not made
pub
however.There are a number of ways we can configure systems, all of which we might want to be able to tweak for plugin systems:
a. relative to other systems in the same plugin
b. relative to other systems in other plugins
c. relative to user systems
Each of these items is worth considering on its own merits.
How can we change system behavior?
Ultimately, there seems to be consensus that many-to-many labels, as discussed in #1375, are the ideal solution for system configuration of this sort in general.
They should allow for intuitive modification of the system properties discussed above, without requiring repetitive, easy-to-omit boilerplate on every system.
Stop-gap solutions for 0.5
Unfortunately, many-to-many labels aren't going to make it into 0.5. In the meantime, we need to provide users the ability to avoid some of the worst of these difficulties. Easy solutions:
DefaultPlugins
. This may or may not include generated systems like those used for event-cleanup.DefaultPlugins
in a stage of its own. This removes much of the benefit of the fancy new scheduler from System sets and parallel executor v2 #1144, but it is certainly safe.If neither of these are adequate (say, if adding run criteria to plugin systems is deemed critical), we may need to either implement multiple labels for 0.5 or some more complex stop-gap.
How can the desired solution be enforced?
pub
from the current scope.pub
. Eventually, this could be enforced in Bevy's library discovery tools.Beta Was this translation helpful? Give feedback.
All reactions