These are the setup instructions for compiling Thrive.
Important Note: If you run into any trouble with the setup scripts, please bring them up on the development discord or open a github issue.
This tutorial is also in video form for: Windows and Linux (Fedora and Ubuntu)
If you are a team member you can ask help on the forums: Private Developer Forums
Otherwise you can ask on our community discord
Thank you!
10 GiB of disk space and about 60 minutes of compile time on a good CPU.
Follow the Leviathan Engine Prequisites installation instructions here.
Important: you should read the whole document before starting as many common pitfalls and issues have fixes given later in the document. Also DO NOT SKIP ANY STEPS otherwise you will initially fail and have to clear the caches which is the easiest to do by just deleting the entire folder and starting again. When you are done with the prerequisites page return here instead of continuing to the building Leviathan page which is irrelevant for Thrive.
Thrive uses automatic formatting of source code to keep style as consistent as possible. For this reason you need to install some additional tools:
- Clang. You need at least version 6.0.0. On Linux you can use your OS's package manager if it has a new enough version.
- nodejs. If you are on Linux you should use your OS's package manager to install nodejs.
- eslint (with eslint-plugin-html) and stylelint. Install with npm
once you have nodejs installed. On Windows:
npm install -g eslint stylelint eslint-plugin-html
. On Linux (you probably need to usesudo
):sudo npm install -g eslint stylelint eslint-plugin-html
When you are getting ready to commit you should run ruby RunCodeFormatting.rb
in order to automatically run all of the
formatting tools. Make sure that that script doesn't report any errors
before committing.
Additionally for local testing you might want to install npm install -g http-server
. You can then run a test web server with http-server -c-1
when ran in the thrive base folder.
Open a terminal on linux or a command prompt (or powershell) on windows to a folder where you want to place the Thrive folder.
Note: a path with spaces in it WILL NOT WORK, so to avoid issues you
should choose a folder like ~/projects
or C:/projects
. Also long
paths don't work on Windows as the setup needs the path in which it is
ran to be less than 90 characters, so choose run git clone in
C:\projects
so that you end up the thrive folder being
C:\projects\Thrive
. One additional potential problem is non-English
characters in the path name, for example if your path includes
"työpöytä", the setup will fail.
Windows tip: shift right-click in a folder and select "Open command prompt here" or "Open powershell here" to open a cmd window to the folder
And now run
git clone https://github.com/Revolutionary-Games/Thrive.git
cd Thrive
To get the Thrive repository cloned.
For devs working on new features: switch to a feature branch or create
one. For example git checkout fix_everything
. This keeps the main
branch clean as other branches can be merged through pull requests on
github which is the recommended way to get your code into Thrive.
If you aren't on the team (have push access on github) create a fork on github and use the url of that instead of the one above.
Now you can run the setup script with (make sure you have setup prerequisites):
ruby SetupThrive.rb thrive
The last part of the command (thrive) is the svn username. If you have an svn assets username (ask on slack) use it instead of "thrive" here.
When asked to login to svn type in your svn password. Or if you are using "thrive" as username type in "thrive" as the password as well.
Note: if you have a small amount of ram you may want to limit the
setup script to only use a few CPU cores for building or don't want to
dedicate all of your CPU. To do this add -j 2
to the end of the
setup command with the number being the number of cores you want to
use, the default is to use all. Note: this may not work for the
dependencies (and that needs fixing)
If you are trying to compile on an unsupported Linux OS you should run the setup like this:
ruby SetupThrive.rb --no-packagemanager --pretend-linux fedora
Note: you will have to manually install all the required packages.
If the setup script succeeds then congratulations you have just successfully built Thrive and can start working.
If it didn't work you can try these:
- Leviathan Troubleshoothing tips
- Thrive forums
- Thrive discord
- Thrive developer chat on slack
to get help
Here are some quick tips for working on thrive:
- Scripting documentation
- On Windows: when building Thrive in visual studio select
RelWithDebInfo
configuration (instead of Debug). Otherwise the build may fail. And make sure "Thrive" is the startup project to run it in the debugger. - Whenever you change the assets or scripts you need to run cmake. See this for more info
If you are just starting out and you don't have write access to the Thrive repository yet you will need to create a fork. Use the fork button on Github on the main repository page. This will give you a fork (for example my fork is https://github.com/hhyyrylainen/Thrive).
Then you can add that to your git config in the thrive folder with this command:
git remote add fork https://github.com/YOURUSERNAMEHERE/Thrive.git
Then after committing your changes (git-cola is recommended or another graphical tool for reviewing the exact lines you have changed, but you can also commit on the command line) you can publish them to your fork with (assuming you used the master branch, when working with the main thrive repository you MUST create a different branch but when working with a fork that isn't required, but still strongly recommended as making multiple pull requests with one branch is messy):
git push fork master
Now you can open a pull request by visiting the Github page for your fork.