-
Notifications
You must be signed in to change notification settings - Fork 220
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
Allow saveload to serialize/deserialize more than 8 component types #414
Comments
415: Increase tuple size for SerializeComponents/DeserializeComponents r=Xaeroxe a=andreivasiliu The short-term solution for #414 I tried adding more, but it looks like 16 is the maximum. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/slide-rs/specs/415) <!-- Reviewable:end --> Co-authored-by: Andrei Vasiliu <whyte.vuhuni@gmail.com>
I'd add another custom derive ( |
Hi. Is this still an issue? |
I'm still using tuples, and have to modify 6 different places whenever adding a new component (declaration+parameter+tuple for both serialization+deserialization), since I couldn't figure out how to implement Documenting an example of My biggest issue (the limit of 8, as per the issue title) was fixed though, so feel free to close this; I assume the saveload module will eventually get better documentation/examples even without this issue. |
@andreivasiliu you can bring that down to 2 if you change it to type SystemData = (
Entities<'a>,
(
ReadStorage<'a, Position>,
...
),
ReadStorage<'a, U64Marker>,
);
fn run(&mut self, (entities, components, markers): Self::SystemData)
{
let mut serializer = ron::ser::Serializer::new(Some(Default::default()), true);
SerializeComponents::<Error, U64Marker>::serialize(
&components,
&entities,
&markers,
&mut serializer
).unwrap_or_else(|e| {
// FIXME: handle this
eprintln!("Error: {}", e);
}); or equivalent. |
I think this is a huge usability issue in saveload that should be addressed before stabilizing it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant. |
I've just run into this, except at 18 instead of 8 now. I understand I can manually implement |
Any progress on this? For whatever reason I seem to be hitting the limit at 16, rather than 18 as @abesto said. But I'm not sure how else to deal with this. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant. |
bump |
I've created draft of derivation macro as an exercise for learning Rust macros. Probably there's a lot of bugs, but feel free to copy and use it. |
I'm not sure if I'm doing something horribly wrong or commendably right, but I've hit the size limit of tuples that implement the
SerializeComponents
/DeserializeComponents
traits, which is currently 8 component types.This will not compile:
I think the proper solution here would be to implement
SerializeComponents
for any structure with#[derive(SystemData)]
, but I don't know enough Rust to figure out how to do it myself.Short-term I'd be happy with increasing the tuple size limit too.
The text was updated successfully, but these errors were encountered: