steam-multiplayer-peer icon indicating copy to clipboard operation
steam-multiplayer-peer copied to clipboard

Add contribution and build instructions for collaboration efforts

Open BatteryAcid opened this issue 1 year ago • 2 comments
trafficstars

In order to help out with the progression of this project, consider allowing other collaborators to push updates. Please document the process for building the plugin for development.

BatteryAcid avatar Jun 12 '24 18:06 BatteryAcid

Perfect, I'll start riding this Saturday

scriptsengineer avatar Jun 13 '24 00:06 scriptsengineer

is there any upate on this matter? it is still quite difficult to build theproject locally or to understand which package to copy over between the different branches. For instance, the bin folder in the main branch is empty.

dev-bre avatar Aug 15 '24 16:08 dev-bre

Here's my attempt to document the build process for this extension. Please let me know if you have any feedback. I'd like to maybe open a PR to get this into the wiki. @garbagemule


Resources

The following can be used to track how the project is built in Github. This information can be helpful to identify which Steamworks version and libraries were used, build commands, or to track down changes in the build process, etc:

  • https://github.com/expressobits/steam-multiplayer-peer/blob/main/.github/workflows/builds.yml
  • https://github.com/expressobits/steam-multiplayer-peer/actions

Understanding the gdextension file:

  • https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_file.html

Prerequisites

Open up the associated "Compiling for XYZ" Godot docs page where XYZ represents which operating system you work on. Most of what you need is listed there

  • macOS: https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_for_macos.html
  • Windows: https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_for_windows.html
  • Linux: https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_for_linuxbsd.html

MacOS Summary:

  • Python 3.8+
    • This should come standard on your mac
  • SCons 4.0+
    • Use Homebrew (or however you install apps) to install this:
    • brew install scons
  • Xcode (macOS)
    • You can download this from the App Store. This wasn't used directly, but it may come with some "developer tools" that the build process requires.
  • Vulkan
    • The "Compiling" instructions above want you to use a script to install this, however, it was not pulled down as part of the godot-cpp submodule. To access this script, download godotengine either through a clone or with these instructions:
      • https://docs.godotengine.org/en/stable/contributing/development/compiling/getting_source.html#downloading-the-godot-source-code
    • Once you have it downloaded/cloned, from the top level of the godotengine folder, run the following script:
      • misc/scripts/install_vulkan_sdk_macos.sh

Shared prereqs:

  • Steamworks SDK
    • Download the SDK, can stick with the latest or the one used in the Github build. This will be used below.
    • https://partner.steamgames.com/downloads/list
  • Clone steam-multiplayer-peer
    • Make sure the submodule godot-cpp was pulled down as part of the clone. If this folder is empty, you need to figure out how to pull down the linked submodule, or it will not build correctly.

Build Instructions

  • Copy steamworks/public and steamworks/redistributable_bin to <extension_top_level>/steam-multiplayer-peer/sdk

    • Just copy/paste those two folders into the sdk folder. They are used during compilation.
    • Yes, there's a nested steam-multiplayer-peer folder inside this extension, that's where the sdk folder is.
  • Build the extension. In a terminal window, go to the top level of the project and run:

    • scons target=template_debug platform=macos arch=universal precision=single
  • Build Notes:

    • The built artifact will be placed in the bin directory under its respective operating system.
    • There are various targets/platforms/arch that can be set based on what you're trying to build for.
    • For local testing on a mac, the above command works fine.
    • On macOS, this will generate a "library" artifact like this:
      • libsteam-multiplayer-peer.macos.template_debug.universal.dylib
    • Windows and Linux will have their respective artifacts: .dll and .so

The build process generates the extension's "library". This is what you download from the AssetLib directory when you install the plugin through the Godot Editor. Here we build it ourselves.

Usage

Make sure you have the extension already installed in your project, you can do this from the AssetLib directory. Once you have built the extension's "library" above, to test your changes in a Godot project, copy the build artifact over to the plugin's respective OS folder. Consider creating a back up of the library you are testing, to make it easier when you want to revert back.

Put the artifact here: <TOP_LEVEL_PROJECT>/addons/steam-multiplayer-peer/<respective_os_folder>

These changes seem to take effect immediately the next time you run the project.

BatteryAcid avatar Jun 22 '25 18:06 BatteryAcid

Thanks @BatteryAcid for the update, everything is ok! Can we introduce this in the README or in some wiki?

scriptsengineer avatar Jun 23 '25 02:06 scriptsengineer

Thanks @BatteryAcid for the update, everything is ok! Can we introduce this in the README or in some wiki?

I would be happy to add this to a wiki page, and update the Readme to point to it. I can create a PR for the Readme, but I'm not sure how to edit the wiki. I'm guessing I need some permission. Let me know and I'll get started! Thank you!

BatteryAcid avatar Jun 23 '25 13:06 BatteryAcid

@BatteryAcid I left the wiki free for editing, test it and tell me if you can edit it correctly.

scriptsengineer avatar Jun 23 '25 21:06 scriptsengineer

I'm able to edit, thank you! I'll try to update this in the next day or so! thanks!

BatteryAcid avatar Jun 23 '25 23:06 BatteryAcid

@scriptsengineer I would like to push out changes to the Readme. Can you add me as a contributor or should I just make a PR from my own repo clone?

I created a new build page in the wiki and also moved the "contributing" page to the "Home" page:

  • https://github.com/expressobits/steam-multiplayer-peer/wiki
  • https://github.com/expressobits/steam-multiplayer-peer/wiki/Building-Steam-Multiplayer-Peer

BatteryAcid avatar Jun 27 '25 15:06 BatteryAcid

HIi @BatteryAcid

Sorry for the delay, I've added you as a contributor to the repository, this makes it easier for you to contribute if necessary.

I really appreciate your contribution, I just don't have time for this extremely useful work for the community.

scriptsengineer avatar Jul 05 '25 15:07 scriptsengineer

Great, thank you! @scriptsengineer I just created a pull request that updates just the README with links to the Wiki (along with some minor formatting changes), please merge, or mark approved and I'll take care of it.

https://github.com/expressobits/steam-multiplayer-peer/pull/45 Thanks

BatteryAcid avatar Jul 11 '25 01:07 BatteryAcid

Wiki has been updated with build instructions:

  • https://github.com/expressobits/steam-multiplayer-peer/wiki

BatteryAcid avatar Jul 18 '25 17:07 BatteryAcid