trumank / uesave-rs

Rust library to read and write Unreal Engine save files
MIT License
282 stars 55 forks source link

[Feature request] Create a custom type for headerless GVAS ByteProperty #53

Open na-ji opened 1 month ago

na-ji commented 1 month ago

Hello,

When reading #22, I've seen that Palworld is saving headerless GVAS data into a ByteProperty array. The thing is, the game I'm working on, Coral Island, is doing the exact same thing. So instead of forking uesave-rs and always writing similar code, it would be great to have a custom type that we could use to overwrite ByteProperty. This type could be used with the --types flag, with something like this: --types .My.ByteProperty.Array=HeaderlessGVAS. And whenever we use this flag, it would overwrite and replace the ByteProperty Array with this type that would decode/encode it safely.

What do you think? I don't know how many games use this data type, but it might come in handy.

Thanks!

trumank commented 1 month ago

A way to handle things like post-processing/transformation of properties or handling of structs with custom serialization would be great, but I personally haven't needed such a feature so have not considered ways of implementing it. I'm open to ideas.

na-ji commented 1 month ago

That's an interesting idea! It would be useful for people like me using this project as a crate (here if you're curious)

In the case I mentioned, it would require making public the function handling the decoding of the body. Or have a way to decode even further. And in general, it should be usable for both encoding and decoding saves. I will try to think things through and propose a plan later.