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
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.
- To fork, follow this GitHub tutorial, but use OpenRCT2 instead of the
octocat/Spoon-Kniferepository mentioned there. - Want to know more about forking? Wikipedia's got you covered!
Cloning OpenRCT2
Now you need to clone, which is essentially downloading the repository to your computer. You can do that in two ways:
- Using GitHub Desktop
- After you have set-up the git command line, running
git clone https://github.com/OpenRCT2/OpenRCT2.git
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:
- Building OpenRCT2 on Linux
- Building OpenRCT2 on macOS using CMake
- Building OpenRCT2 on Windows
- Building OpenRCT2 on Windows Subsystem for Linux
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:
- OpenRCT2/Localisation: To translate the game into other languages.
- OpenRCT2/OpenGraphics: Create new graphics for the game to use.
- OpenRCT2/OpenMusic: Create new music for the game to use.
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_branchwhich 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
gitdoesn'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.
- Home
- FAQ & Common Issues
- Roadmap
- Installation
- Building
- Features
- Development
- Benchmarking & stress testing OpenRCT2
- Coding Style
- Commit Messages
- Overall program structure
- Data Structures
- CSS1.DAT
- Custom Music and Ride Music Objects
- Game Actions
- G1 Elements Layout
- game.cfg structure
- Maps
- Music Cleanup
- Objects
- Official extended scenery set
- Peep AI
- Peep Sprite Type
- RCT1 ride and vehicle types and their RCT2 equivalents
- RCT12_MAX_SOMETHING versus MAX_SOMETHING
- Ride rating calculation
- SV6 Ride Structure
- Settings in config.ini
- Sizes and angles in the game world
- Sprite List csg1.dat
- Sprite List g1.dat
- Strings used in RCT1
- Strings used in the game
- TD6 format
- Terminology
- Track Data
- Track Designs
- Track drawers, RTDs and vehicle types
- Track types
- Vehicle Sprite Layout
- Widget colours
- Debugging OpenRCT2 on macOS
- OpenGL renderer
- Rebase and Sync fork with OpenRCT2
- Release Checklist
- Replay System
- Using minidumps from crash reports
- Using Track Block Get Previous
- History
- Testing