lightyear icon indicating copy to clipboard operation
lightyear copied to clipboard

Make the examples simple

Open simbleau opened this issue 8 months ago • 4 comments

Something that really hurts my understand of lightyear is just how many hoops I have to jump through with tons of layers of configurations and boilerplate for what really should be a straightforward example.

Instead of having a lobby example that uses any configuration of transports, tons of CLI args, etc. It would be beneficial to simply use WebTransport in all cases by default, since that works on all platforms.

Secondly, I'm not really sure why the standard with a settings.ron file was chosen. It would be nice if this was code by default instead, with a separate "file_settings" example if you want to show how to do that.

Most people don't want to start serializing/deserializing the settings.ron file just to try out the examples, they want to jump around the code in their IDE, Ctrl+Click from struct to struct and read documentation. Having an opaque .ron file disables someone from understanding the settings.

This will also dramatically reduce the amount of refactoring if you change 1 piece of the config in a PR - and likely stop someone from wanting to contribute to such pieces, since it requires updating that config and boilerplate 20x across all the examples.

TLDR:

  • Make a separate example for reading the settings.ron file, since it's not intuitive for all examples. Examples should use code.
  • Remove all CLI and configuration from examples, sticking to a standard that is cross platform (WebTransport).
    • Add separate examples for steam, udp, conditioner, and config that was removed to compensate.

simbleau avatar May 27 '24 17:05 simbleau