Skip to content
Cory Andreasen edited this page Mar 21, 2023 · 10 revisions

Introduction

This page is a step-by-step explanation on how to contribute to the OpenRCT2 project, whether you're just getting started with programming or if you're already seasoned and just want to understand some details.

Table of Contents

  1. Introduction
    1. Get Original Game
    2. Make GitHub Account
    3. Fork & Clone Project
    4. Building/Installation
  2. Contributing
    1. Finding something to work on
    2. Developing
    3. Testing
    4. Submitting / Updating contribution

Get Original Game

OpenRCT2 requires original files of RollerCoaster Tycoon 2 to play. It can be bought at either Steam or GOG.com. If you have the original RollerCoaster Tycoon and its expansion packs, you can point OpenRCT2 to these in order to play the original scenarios.

GitHub Account

If you ever need to report a bug, request a feature or you just want to contribute to the project, you will need a GitHub account. Luckily, you're already at it, so just head here and create yours.

Fork & Clone Project

OpenRCT2 sort of uses the gitflow workflow. If you are new to git and collaborative coding it's a recommended read to get a grasp of some concepts and terminology.

Forking OpenRCT2

Because only team members can make changes to the main OpenRCT2 repository, you will need to create a fork, which is a copy of it to call your own and modify it as you wish.

Cloning OpenRCT2

Now you need to clone, which is essentially downloading the repository to your computer. You can do that in two ways:

Building / Installing

OpenRCT2 supports different platforms and the instructions will vary depending on what you have and want to use. Pick the appropriate tutorial from the list below and have fun:

Contributing

If you've completed all the steps above successfully, you're now ready to start contributing with the project, so let's explain how it works.

Finding something to work on

There are multiple things to helps us with, but for a newcomer, you might not know where to start. This tutorial assumes you want to contribute to the main game.

We use OpenRCT2's issue tracker to list all of the tasks that need to be done, They will vary wildly in scope, some of them will be to fix a bug, others to implement a feature or refactor a code for improved legibility.

To make sure the goal of each task is clear we use labels, you can browse ours to read about what each of them mean. If you're a newcomer look for the open issues with the good first issue label (or hacktoberfest if it's october), this means that the task was well defined and considered simple enough to be picked up by someone that never contributed to our code base.

Found one? Good! Now please:

  • Do read the issue page to make sure no one is working on it. You can see that if someone has commented or if there are links there referencing someone else's commit. Note: in some cases those references or comment might be very old and the task might be up for grabs again.
  • Comment that you're taking that task!

If you're unsure whether someone else is working on it, or if you want to do something that is not tracked, ask us on Discord first! This makes sure you don't waste precious time doing something that is already being done or that was ruled out.

Other contributions

The OpenRCT2 has plenty of other repositories. If you want to contribute with something else, go to each of them and check out. Here is a list with some of them and a brief explanation of what they entail:

Developing

Now that you've already built the game and picked up the task, it is time to start developing!

Create a branch

The first thing you'll want to do is to create a branch and leave the develop one clean. A branch contains a series of correlated commits and will be used to track your changes, you can have as many branches as you want and you should have different branches for different tasks.

To create a branch you can either:

  • Use GitHub Desktop
  • git checkout -b name_of_your_branch which will create and go to the branch.

Now you're ready to start changing the code!

Coding Guidelines

When changing the code, make sure you follow our coding style and guidelines. If you follow the chances of your code being reviewed and merged by us faster increases considerably, as we won't have to spend time pointing out improvements.

Commit Messages and guidelines

When you're ready to commit your first changes, make sure you follow our commit messages guideline. Note that using the keywords Fix, Close, Part of followed by the issue number #XXXXX are specially important to link back to the task you picked up and make sure others see that there's work ongoing there, along with helping us maintain the project :)

Testing

There are plenty of ways to test your changes, the most common one is actually running the game and seeing that nothing broke. Please make sure to test things before submitting it for review, so you can catch silly errors. Running the game is covered on the Building/Installing section above.

Submitting or updating contribution

So it works, yay! Now you have to create a Pull Request (also known as PR) to let us review and at some point incorporate our changes to the code base. You can create it as a draft pull request if you don't feel like it is ready yet, but you want some input from the team members.

There are some things that you need to understand when making a PR:

  • What is CI and what does it do?
  • Sync and rebase branch
  • Contributors file

What is CI and what does it do?

CI stands for continuous integration and basically is a bunch of scripts and jobs that we run to make sure that the new changes being introduced are not breaking the game in anyway. If any of these checks fail, you know there is potentially something wrong with your changes, so do click on details for that check and investigate. Some of the jobs we run are:

  • Linter for the commit messages: Makes sure they follow our guidelines.
  • Clang Format: A tool that ensures that we have a consistent formatting on our code base.
  • Builds on multiple operational systems: To ensure it continues to work on all of our supported platforms.

Sync and rebase branch

When you forked the repository, you created a copy of your own and it is now a snapshot of the past. There will be times you want to make sure it is up-to-date with the original one, be it:

  • To have the latest changes.
  • Because your PR now has "merge conflicts". This means that git doesn't know how to integrate your changes and someone else's and you have to solve it yourself. OpenRCT2 will kindly ask you to "please rebase" your PR.

This guide has got you covered for both of these operations.

Contributors file

If it's the first time you're contributing with the project, make sure to update the contributors.md file by appending your name at the end of the respective list.

Clone this wiki locally