Contributing - thomaswp/BeaverBuddies GitHub Wiki

The best way to help make BeaverBuddies awesome is to help tackle the backlog of issues! We'd appreciate your help, though you'll likely need to be a solid C# developer.

If you want to help

  1. Read over the How Does it Work page to familiarize yourself with how the mod works.
  2. If you're not already a Timberborn mod developer, consider learning the basics of modding through existing guides, e.g. here. This isn't strictly necessary, since BeaverBuddies doesn't use a typical modding workflow, but it certainly helps.
  3. For BeaverBuddies and set it up using the instructions on the (README)[https://github.com/thomaswp/BeaverBuddies/blob/master/README.md].
  4. Find an issue to fix like #71 that describes a desync. See the details below for the different kinds of desync issues.
  5. Fix it! Message me in the discord if you need help, or reply to the issue. Then create a pull request and I'll review it.

Some of the issues are desyncs due to unimplemented user interface events. One player clicks a button or checks a box, but we haven't yet captured that as a multiplayer event, so it only happens for that player. I discuss how to fix that sort of issue in this video. Note that this is me live developing, so there are mistakes and I'm figuring it out as I go. This is on purpose: it shows you the meandering path to fixing an issue. See many examples of this in the BeaverBuddies.Events namespace. Here are the main steps (which will make more sense after watching the video and reading the existing examples of ReplayEvents:

  1. Identify the code that responds to the user interaction (e.g. button press) - you will be overwriting this method.
  2. Create a ReplayEvent that captures the data needed to replay this action, and replays the event when needed.
    • If you need access to any singletons to replay the event, get them from the IReplayContext, and make sure that ReplayService requests them in its constructor and adds them with AddSingleton.
  3. Use Harmony to override this method and use ReplayEvent.DoPrefix to create your ReplayEvent with the appropriate parameters.
  4. Test!

Some of the issues are desyncs dues to thorny issues at the core of how Timberborn and BeaverBuddies work. These are more involved, and I'm working on an example video of fixing one.