Table of Contents
This Guide covers the general method of building the latest, publicly-available code from GitHub for Momentum for Windows, Linux and macOS.
NOTE
This guide is only for the 0.8.7
public preview build since the game is now closed-source.
If you just want to try out the most recent publicly available version, you can grab a ready-to-use, already compiled build from the Releases page. You only need to follow this guide for debugging and development purposes.
To make use of this page, you should:
- Be using the Administrator account of the machine you're using
- Have a pot of coffee (optional)
NOTE
You'll need Momentum activated on your Steam account in order to test online features or mount assets from other games automatically! New Steam keys are currently reserved for users that are making contributions to the game.
- Download GitHub Desktop, it will require a bit of setup, and may require an account.
- Go to the Main Page and click Clone or Download > Open in Desktop:
You should have cloned the
develop
branch.
If not, switch to it from the top (if you're using GitHub Desktop).
It may also be calledorigin/develop
:
NOTE
Your installation of GitHub Desktop may look different, but should otherwise function the same.
-
Download Momentum Mod on Steam or grab the
MomentumDev
folder from Google Drive. -
Download Visual Studio 2019.
Your installation only requires the "Desktop development with C++" workload:
-
If you downloaded Momentum Mod from Steam, create an extra folder somewhere called
MomentumDev
, and copy everything from yoursteamapps/common/Momentum Mod
folder to it. Then delete themomentum
folder fromMomentumDev
.- Otherwise if you downloaded the
MomentumDev
folder from Google Drive, extract it somewhere.
- Otherwise if you downloaded the
-
Edit the
creategameprojects.ps1
file to point the$path
variable to the full path of theMomentumDev
folder.
NOTE
If you can't run it as administrator, start cmd.exe
as Administrator, then change directory to the Git clone, and run it from cmd.exe
.
-
Open
momentum.sln
, go start the pot of coffee, come back a minute later, and click Build......then go finish the pot of coffee and pour yourself some.
NOTE
You can launch with no debugger attached by pressing CTRL+F5
instead...
...but if a crash occurs no useful information can be gathered!
- Install the following dependencies:
sudo apt-get install build-essential gcc-multilib g++-multilib
- Git clone the Steam Runtime repository.
- Go into its directory and run:
./setup_chroot.sh --i386
- Download Momentum Mod on Steam (see the important note at the top of this page) or from Google Drive.
- Clone this repository wherever you'd like.
- Create an extra folder somewhere called
MomentumDev
, and copy all of the files from your Steam'ssteamapps/common/Momentum Mod
directory into this folder.- So for example, to get at the game's binaries, it should look like
MomentumDev/momentum/bin
.
- So for example, to get at the game's binaries, it should look like
- Now, delete the
momentum
folder insideMomentumDev
. - Symlink the
mp/game/momentum/
folder from your Git clone over to thisMomentumDev
folder, so that the binaries you end up compiling automatically copy over. - To compile the game, run the following commands in the
mp/src/
directory of your clone:
./creategameprojects
sudo schroot --chroot steamrt_scout_i386 -- make -f games.mak
- Make sure Steam is open, and you should be able to run
./hl2.sh -game momentum
in theMomentumDev
folder to launch the game.
Unfortunate Note
Developing on Linux is going to be a chore, and is best reserved for Windows.
If we ever convert the project to CMake, this unfortunate note will go away, but blame VPC for not generating any good Linux development files for the time being.
This section outlines compiling the game on Linux using the NetBeans IDE.
With sudo
If project already has been previously compiled with sudo
:
cd
togame/mp/
- run
sudo chown -R $(whoami):$(whoami) .
where$(whoami)
should be your local user (notroot
)
NOTE
These steps can also be combined into a single command like so:
sudo chown -R $(whoami):$(whoami) game/mp/
Without sudo
- Replace
groups=sudo
withgroups=<username>
in/etc/schroot/chroot.d/steamrt_scout_i386.conf
where<username>
is your local user (notroot
) cd
togame/mp/src/
- Execute
./creategameprojects
(chmod +x
if it cannot be run for some reason) - Run
schroot --chroot steamrt_scout_i386 -- make -f games.mak
to compile
NOTE
Step 1 can also be completed with something like:
sed -i "s/groups=sudo/groups=$(whoami)/g" /etc/schroot/chroot.d/steamrt_scout_i386.conf
NOTE
The following steps require the configuration steps from above (Initial Setup) except for compiling
- Install NetBeans (netbeans package)
- Navigate to
Tools
->Plugins
- Navigate to
Settings
->Check NetBeans 8.2 Plugin Portal
- Select
Available Plugins
->Install C/C++
- Navigate to
- Navigate to
Tools
->Options
- Navigate to
Editor
->Formatting
Language
:All Languages
Category
:Tabs and Indents
Expand Tabs to Spaces
:Check
Number of Spaces per Indent
:4
Tab Size
:4
Right Margin
:120
- Navigate to
Editor
->On Save
Language
:All Languages
Reformat
:None
Remove Trailing Whitespace From
:Modified Lines Only
- Navigate to
- Navigate to
File
->Open Project
- Select
game/mp/src
- Select
- Navigate to
File
-> SelectProject Properties
- Under
General
-> SelectAdd Source Folder
-> Selectgame/mp/src
- Under
Run
-> ConfigureRun Directory
:<path to MomentumDev>
(Server and Client configuration) - Under
Run
-> ConfigureRun Command
:<change run parameters to liking>
(Server and Client configuration)
- Under
- Select
Run
->Build Project (F11)
- Select
Debug
->Debug Project (F5)
(Run
->Run Project (F6)
does not work for some reason)
NOTE
macOS support has been dropped indefinitely due to the operating system no longer supporting 32 bit applications.