kinsi55 / CS_BeatSaber_Camera2

Adds a lot of options / tools for creating more advanced desktop viewing experiences with multiple camera angles and much more in Beat Saber
MIT License
123 stars 17 forks source link

Support of YAML files #86

Closed blackorbit1 closed 2 years ago

blackorbit1 commented 2 years ago

Json is great for its wide support and its simplicity but is not the most scalable and human friendly configuration language. I've really started to suffer from the json simplicity when I tried to make a video with lots of camera movements.

I think being able to use yaml with it's much simpler syntax and the ability to write comments would help in creating camera scripts. Here's a quick comparison : image

I know it is possible to write comments in fake attributes but it doesn't stand out like real comments.

It shouldn't require having 2 parallels methods of config reading for retro compatibility because json is a subset of yaml (you can mix json and yaml syntax together).

I've also seen there are CS library to easly parse YAML. On the reading side, with a little bit of chance the only required modification could be to change the library used to parse the config but I don't know what would be the implication on the writing side. Maybe the mod could read yaml and json but only write yaml (so any json file could be changed to a yaml file if needed), or maybe it could only consider files with the json or yaml extension and parse them as yaml.

Also I don't know what would happen with the comments if the file is modified.

kinsi55 commented 2 years ago

Not happening, most people already barely know how to properly edit JSON, I'm not gonna throw a format at people that requires correct indentation (Especially with not a singular other mod using this format) - And adding it optionally would imo be feature creep.

That being said, are you aware B2C2 exists?

blackorbit1 commented 2 years ago

Oh no I never heard about it :o thanks for the link ^^ Maybe it could be interesting to add a link somewhere here https://github.com/kinsi55/CS_BeatSaber_Camera2/wiki/Movement-Scripts like

Movement Scripts (Camera2/MovementScripts/*.json)

The "known" format for movement scripts was changed from Camera Plus, it is no longer a list of movements, but of keyframes. If you try to load a Camera Plus movement script with Camera2 it will be converted to the new format automatically. For advanced movement scripting, you can check Blender2Camera2. It is a separate project made by KandyWrong to help for creating movement scripts through Blender.

tbh I was thinking about trying to do it as a first contribution but yeah the benefits would be really small even if the implementation is super simple and don't have any side effect on json users.

kinsi55 commented 2 years ago

It is mentioned in the FAQ, but yeah maybe I should add it to the Movement Scripts page too