wiki:SmokinGuns/Building/windows

Version 1 (modified by barto, 11 years ago) (diff)

--

Introduction

In this small tutorial, we will compile the game from sources. We will use Windows7 32bit Home Edition for this tutorial. This tutorial initially comes from this forum post.

Content

  • Why
  • Git bash
  • MinGW and MINSYS
  • Getting the code
  • Compilation
  • Update
  • Troubles

Why

Here is a list of the possible reasons that may require anyone to compile the game code:

  • Testing the last development revision helps to find bugs and fix them simply by simply saying: "It's still there" or "It's now fixed".
  • Being on the bleeding edge of the game by discovering the last new implemented features like the second renderer recently added by ioquake3.
  • You have a Windows server and you want to have the latest server-side code because Baller-bude is awesome and you want the same possibilities.
  • Or, I don't really hope this from you, but you have some troubles with the actual .exe and you think it is a good solution to try to create your own set of binaries.

Git bash

We will need this program to gather the sources from GitHub. Go to git-scm.com, download and install git. You will have afterwards a new icon named "Git bash" on your desktop.

MinGW and MINSYS

This program is our compiler. Download and install the latest .exe from sourceforge.net. Take care to install it to the recommended path (C:\MinGW) and to add the component named "MSYS Basic System" to the installation.

Getting the code

Now we will get the source code, for this tutorial, we will work directly from the documents folder namely C:\User\YourName\. So open Git Bash and a black command prompt will open. Just type:

 git clone https://github.com/smokin-guns/SmokinGuns.git

and a folder named SmokinGuns with the whole source code will be created. You can now close git bash, we'll use it later when we will want to update the source code.

Compilation

So you have installed MinGW and MINSYS, you'll need to launch "MinGW Shell" from the application list and surprise: another command prompt! We will firstly need to move to the folder where your code is, just type: (you can use the autocompletion with the tabulation button to move faster in the folders)

 cd C:
 cd Users\YourName\SmokinGuns

Time to compile! Just type in the same console:

 make

It will take some time and cpu percent for the compilation, but afterwards you will have the compiled files into SmokinGuns\build\release-mingw32-x86\. The only useful files are the *.dll (if there is/are one/some) and the *.exe that goes to your root game folder (usually C:\Program Files\Smokin' Guns\). There is also an important folder in SmokinGuns\build\release-mingw32-x86\smokinguns, just compress the vm folder as vm.zip, rename it to vm.pk3 and put it into C:\Program Files\Smokin' Guns\smokinguns with all other pk3s. Your vm.pk3 file should look like that:

 vm/
 vm/cgame.qvm
 vm/qagame.qvm
 vm/ui.qvm

You can now play with the new .exe, I have had no problems to connect to servers since the pk3 are not touched during this process.

Update

When a change in the code is made, it is always nice to be able to recompile the code to test the changes. Just open git bash and type:

 cd SmokinGuns
 git pull

to update the code. You also need to redo the compilation process, it will thus be smaller since it only compile the changes.

Troubles

  • If it doesn't compile for some reason when you just updated the code, try to remove the build folder and try to compile again. If it doesn't make the trick, contact the developers via the forum.
  • If you spot any bug while testing, just contact the developers via the forum or make a bug report (you will still need a forum account to log in here, in small caps).
  • If you want to play with the sources, I suggest you to learn git (especially the checkout command), there are plenty of tutorials around.
  • For some other problems, you can contact the devs via IRC (#smokinguns on freenode), me via PM, with a forum post, via a homing pigeon, etc.