How to collaborate on Construct projects with GitHub

50

Index

Stats

18,161 visits, 55,516 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Set up GitHub

To set everything up on GitHub, follow these steps:

  1. If you don't have one already, create a GitHub account (you can do this for free)
  2. Sign in to your account on the GitHub.com website
  3. Also download and install GitHub Desktop. We'll need it later. You'll need to sign in to that as well once it's installed.

Create a repository

A repository, or repo for short, is like a project on GitHub. It's a set of files that you can push and pull to.

Create a new respository for the project you want to collaborate on. Be sure to set your repository to private if you don't want to share it with the whole world. Public repositories are generally used for open-source projects (which your Construct project can be too, if you want it to be). Note there may be limits on how many private repositories or collaborators you can have for free - for up-to-date information see GitHub's pricing page.

Once you've created the repository, some instructions appear for how to set up the repository. The easiest way is to use GitHub Desktop, which we downloaded and installed earlier. This provides a visual tool to handle pushing and pulling changes. There should be a button that says Set up in Desktop. Click that, and you should be prompted to open GitHub Desktop. Go ahead and open it. You'll be prompted to pick a folder on your computer for the repository; make sure you choose a new or empty folder, and then click Clone (GitHub's term for creating a working copy). You should now have your repository open in GitHub Desktop. Currently it's empty though, and GitHub Desktop should say No local changes since nothing has changed yet.

Ignore UI state files

Before we continue, let's make sure those UI state files we previously mentioned are ignored by GitHub. As noted these are specific to you only and you don't want to be submitting changes for them.

To ignore them, in GitHub Desktop choose the menu option RepositoryRepository settings..., then click Ignored files. Enter *.uistate.json and click Save. Now all files ending with .uistate.json will be completely ignored by GitHub, so they won't get in the way causing unwanted changes and conflicts.

First push

Currently there are no files in the repository. Let's add the first set of files.

In Construct, either open your existing project, or create a new empty project. Then choose MenuProjectSave asSave as project folder...

You'll be prompted to pick a folder to save your project to. Choose the local folder you chose in GitHub Desktop.

Switch back to GitHub Desktop. It should now have automatically updated. Instead of saying No local changes, there should be a list of all the files you just added on the left. (The picture below was taken after saving a new empty project, but if you used an existing project it will list everything in your project.)

Make sure no .uistate.json files are in the list. If you see any, revisit the section Ignore UI state files above.

Commit the files

Each change is called a commit. This change is to add our first set of files. Every commit must have a summary, so type something in the summary box like Add first files.

Then click Commit to master. (Master is the default branch, but that's a different topic.)

Your changes won't go to the server until you publish them. This way you can queue up several commits and submit them all in one go. However we only have one commit and we want to send it right away, so click Publish branch. It'll spend a moment uploading your files.

Once you're done, go and look at your GitHub repository on the web again, or reload the page if it's still open. You should see your files there! They are now on the server.

Now you're ready to start working with your team!

  • 18 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • I've been waiting for this. Thank you finally!!

  • As a solo dev hesitant to jump into source control, your tutorial was a game-changer! Now I'm excited to finally integrate it into my workflow and open the door to future collaboration. Thanks for making it so approachable!

  • Very useful and succinct tutorial on using source control via GitHub. thank you.

  • Very cool, when using this though, if I modify the position of an object or add new object etc, changes appear in my GIT commit list. However if I change a tilemap, adding or removing tiles, those changes do not appear in the commit list.

      • [-] [+]
      • 2
      • Ashley's avatar
      • Ashley
      • Construct Team Founder
      • 2 points
      • (3 children)

      All changes should appear in your commit list. If changes do not appear, then you have not saved the project, and the changes won't be there when you next open the project either.

      • I've tested a few times, certainly saving the project - if I move an object and save, it appears. If I modify a tilemap and save then nothing appears in the commit list.

        What's interesting is if I edit the tile map and then do something like move an objects position, when I commit the changes the tile map edits are saved. So that data is being captured, its just if I edit the tilemap and do nothing else, git thinks I've made no edits to the project and nothing appears in the commit list.

          • [-] [+]
          • 0
          • Ashley's avatar
          • Ashley
          • Construct Team Founder
          • 0 points
          • *
          • (0 children)

          Tilemap data is saved in the corresponding layout JSON file, so check for changes there. Maybe GitHub Desktop isn't checking there or something, or perhaps you forgot to add the files in the first place.

      • Recorded a quick video showing the issue: youtu.be/QRjykEozW-U

  • Scirra has since enforced updates upon any user.

    This breaks version control more often than not, and leads to losing time and resources.

    I tried reasoning with them on a thread to no use, even though any other user agreed a toggle in options or at the very least an advanced Chrome parameter was necessary.

    There is a workaround I discovered recently:

    1. Go to the editor version url (editor.construct.com/rXXX)

    2. Three dots Chrome menu -> More tools -> Create Shortcut (open as new window)

    3. Pin this window to your taskbar.

    This way, you can actually control when you want your team to upgrade.

    In case anyone at Scirra cares, the same issues I talked about in the thread you dismissed are still ongoing and affect Github workflows.

      • [-] [+]
      • 2
      • Ashley's avatar
      • Ashley
      • Construct Team Founder
      • 2 points
      • *
      • (3 children)

      You can choose which version of Construct you use on our releases page.

      Everyone on the team needs to be on the same version of Construct, because save files are not backwards compatible. So make sure if you upgrade, everyone does it at the same time. Even if something goes wrong, source control lets you roll back to a working version at any time.

      FWIW I'm using GitHub with my own game project and so far it's working out great.

      • For anyone reading this reply, my workaround fixes the known "Stuck in old version" bug which annoys a lot of people around the discord at the very least (PWA c3 gets stuck to the version you install it as, and inconsistently prompts you with an update on launch which leads to members sometimes doing commits in an older version) and also lets you actually stick to a version in case some custom functionality breaks without your consent.

        Additionally those using custom engine launchers or edits were in a disadvantage as it was impossible to choose when to upgrade your team to a new version. I still lost time because of the devs not implementing a basic software QOL option before finding this workaround. The original post has everything noted.

        Your work is awesome, Ashley, but you are ignoring a lot of paying customers by not even adding an advanced option like a Chrome parameter for disabling the enforced updates which have consistently broken workflows.

          • [-] [+]
          • 2
          • Ashley's avatar
          • Ashley
          • Construct Team Founder
          • 2 points
          • *
          • (1 child)

          Updates are not mandatory - you can choose whichever release you want to use on the releases page. If you work in a team, your whole team need to upgrade at the same time. That's a part of project management that your team will need to handle - software can't handle that for you.

          If you install the stable version, then the installed version will always update to the latest stable release, and if you install a beta version, then the installed version will always update to the latest beta release. That should always work consistently, and if it doesn't, please file an issue.

          • If anyone wants to work consistently and freely using Github, currently the PWA is not the way to go. Shortcutting an editor version works exactly as it was before you enforced updates, and has never given me any issues since. I just click c3 on my taskbar, and the correct version is displayed for everyone.

            If anyone wants extra steps and the risk of losing progress, that's cool. Tried reasoning on the forums a long time ago, to everyone's frustration on the dev's responses. I still respect his stance, and his work is absolutely incredible (has been my main professional engine for too long to remember).

  • Load more comments (5 replies)