There are two main drawbacks for using LdtkEntity and LdtkIntCell
For mildly complex cases, implementing these traits manually is super verbose (many method arguments)
For more complex cases, the parameters may not give you enough access to the world
Basically, these two traits are very opinionated about what the user might need when they are spawning bundles from the Entity and IntGrid layers. This can be mildly annoying. I think an ideal solution would be to use bevy systems for spawning. That way, users can define exactly what they need from the world, and can feel free to not ask for what they don't need, reducing boilerplate.
To be clear, I'm referring to users being able to write system-like functions/methods for the Entity and IntGrid registration, hooking into the spawning process. Not just normal systems that do spawning afterward. Users can do the latter now, but it does have some quirks, like their entities not spawning until the update AFTER the level spawns, or having to do some clone-fu to avoid overwriting the plugin's calculated transformation, or having to manually match for the entity identifier or intgrid value you are interested in.
Not sure how the exact implementation of this would work (probably using some dark, forbidden bevy traits like FunctionSystem). I'd like the derive traits to be at least as useful as they are now. I'm okay with the design of the macros changing somewhat as long as it's an improvement.
I don't have much of an opinion on whether LdtkEntity and LdtkIntCell should even remain traits with this change. I feel like it would probably be pushing rust's generic features to the limits to have generic trait-method parameters, but idk. I may slightly prefer that they remain traits just to make typing easier as they are passed around the plugin.
This change may result in the level-spawning system becoming exclusive. This is not ideal, but I can't really imagine an alternative. If somehow the level-spawning system can be generic over whatever the user defines in their spawning systems that they register to the app, that would probably be ideal, but it sounds impossible.
Also, not sure how exactly to pass the LDtk data to these systems (EntityInstance, LayerInstance, IntGridCell). Maybe an In parameter? A custom system param?
There are two main drawbacks for using
LdtkEntity
andLdtkIntCell
Basically, these two traits are very opinionated about what the user might need when they are spawning bundles from the Entity and IntGrid layers. This can be mildly annoying. I think an ideal solution would be to use bevy systems for spawning. That way, users can define exactly what they need from the world, and can feel free to not ask for what they don't need, reducing boilerplate.
To be clear, I'm referring to users being able to write system-like functions/methods for the Entity and IntGrid registration, hooking into the spawning process. Not just normal systems that do spawning afterward. Users can do the latter now, but it does have some quirks, like their entities not spawning until the update AFTER the level spawns, or having to do some clone-fu to avoid overwriting the plugin's calculated transformation, or having to manually match for the entity identifier or intgrid value you are interested in.
Not sure how the exact implementation of this would work (probably using some dark, forbidden bevy traits like
FunctionSystem
). I'd like the derive traits to be at least as useful as they are now. I'm okay with the design of the macros changing somewhat as long as it's an improvement.I don't have much of an opinion on whether
LdtkEntity
andLdtkIntCell
should even remain traits with this change. I feel like it would probably be pushing rust's generic features to the limits to have generic trait-method parameters, but idk. I may slightly prefer that they remain traits just to make typing easier as they are passed around the plugin.This change may result in the level-spawning system becoming exclusive. This is not ideal, but I can't really imagine an alternative. If somehow the level-spawning system can be generic over whatever the user defines in their spawning systems that they register to the app, that would probably be ideal, but it sounds impossible.
Also, not sure how exactly to pass the LDtk data to these systems (
EntityInstance
,LayerInstance
,IntGridCell
). Maybe anIn
parameter? A custom system param?