Terasology: Getting Started
This is a comprehensive guide for getting started with your first contribution to the Terasology project. If you’ve stumbled here and don’t know what Terasology is, check out the github repository.
The Quick Start guide on the github wiki of the repository is pretty complete, but it can get a little confusing if this is your first time. If not and you want to get cracking as soon as possible, do head over there.
Without any further ado, let’s get started.
Run from source
This is probably the first and most important step you need to do before you can do anything else. Also, the first question you’ll be asked on IRC when you’re in doubt, is whether you’re able to “run from source”.
1. Get Java
Java 8 SDK is a requirement for the game to run. You can download this from here by choosing your OS.
2. Get Git
If you don’t have git setup, you need to do so before going any further. You’ll need git to collaborate and contribute to this project.
Git allows the users working on a project to mirror and save all changes they make on the central server as well as keep a copy in their own system.
For Linux:
If you’re on Fedora, you can use yum:
If you’re on a Debian-based distribution like Ubuntu, try apt-get:
For Windows:
Download git for windows here.
Configuration:
Once you have git installed, open bash (terminal) in Linux or git bash (from Programs) in Windows and get it configured. git config –global user.name “Your Name” git config –global user.email “your_email@whatever.com”
3. Fork
Click here to fork the Terasology github repository. Doing so will create a repository named “Terasology” under your github account and take you to it. From now you can access your copy of the repository here: www.github.com/your_github_username/Terasology
4. Clone
Open up bash (Linux) or git-bash (Windows), go to the directory where you want to clone the repository:
5. Run the game
You now have the repository cloned and can run the game using gradlew.
Open bash or git-bash, cd in to the Terasology directory and type in:
This should show a build log, and launch the game. If this worked you’re able to run from source. If it didn’t you should get back to IRC and ask for help in debugging. However, any problem encountered at this point is usually from Java not being configured right, such as having an older version as your default Java. See Common Issues for more.
Ask in the Support Forum if issues remain, or come join us on #terasology on Freenode IRC. See Using IRC and please be patient! IRC isn’t necessarily instant communication and it may take a while to get a reply.
6. Use an IDE
With this large a project, you could easily get lost and ‘grep’ing would be inefficient. We have a series of customizations that prepare run configurations, Git integration, and so on for the project, specifically for IntelliJ. Eclipse has fewer of these but is still entirely usable, as is NetBeans, but you’ll need to figure out some details there yourself. I personally recommend the use of Intelij IDEA.
Install Intellij IDEA on Linux:
Install Intellij IDEA on Windows:
Download and install the setup from here.
Open bash or git-bash and type:
This would prepare project files for Intellij. Open the resulting Terasology.ipr as an existing project in IntelliJ - do not create a new project or attempt to import the project via Gradle.
7. Find a Bug
Once you are able to run from source and preferably have an IDE set up, you should get started with working on your first bug. The complete list of issues can be found here. However, you should look for issus with the tag Bite-size
. All bite-sized issues can be found here.
8. Code, code and code
By default you would be on the develop branch. Before you start making changes to the code, remember to create a new branch. This can be skipped, however it is the best practice, especially when working on multiple issues. Also, if you don’t create a new branch, a Pull Request for your second bug fix will also contain a fix for the first bug, if the first PR isn’t merged till then.
Creating a new branch
Open bash or git-bash and type:
Get cracking on a solution. Ask on IRC when in doubt.
9. Make your first contribution
Once you’ve come up with a fix, it’s time to commit those changes and create a pull request.
Commit your changes
Open bash or git-bash and type:
Once you’ve pushed successfully, open up your fork (www.github.com/your_github_username/Terasology). This should show something like:
Clicking on “Compare & pull request” opens a page for you to describe your bug and solution. The pull request compares (head) your_github_username/Terasology/new_branch_name with (base) MovingBlocks/Terasology/develop. Fill in everything and hit “Create Pull Request”.
Once done, let the mentors have a look at your PR. If they want changes, you should make the required changes, test locally and then, create a new commit in the same branch and finally push.
10. Goto 7
Don’t stop now. Go find another bug to fix! :D