GCI Student Bootstrap

From Bitfighter

Welcome

Welcome GCI students!

This page is to help you get set-up with Bitfighter. If you have any questions, please come by our IRC channel: #bitfighter

Preparation

You need the following software to build bitfighter:

  1. Mercurial
  2. CMake
  3. Compiling/editing environment
    • Windows: Visual Studio 2013/2010 are known to work
    • OSX: We only have an old Xcode 3 project, so you might want to use a different OS
    • Linux: Anything you want! you'll be using 'make' and GCC to compile
  4. Create server-side clone
  5. Check-out the code. See the 'Checkout' option in your server-side clone
    • Command-line command: hg clone <SOME_URL>
    • Using TortoisHG. Click 'clone'
    • To push to your server-side clone in Google Code, you will need to use a password located in google code website in your Profile, settings.

Building

Steps to build Bitfighter. For more detailed information, see Building Bitfighter

Linux users, you will have to install dependecies found here: http://bitfighter.org/wiki/index.php/Building_Bitfighter#Detailed_Instructions

  1. Create project files for compiling
    1. Open a terminal and go into the 'build' sub-directory
    2. Run the appropriate 'cmake' command for your platform:
      • Linux command: cmake -DCMAKE_BUILD_TYPE=Debug ..
      • Windows command: cmake -G "Visual Studio 2010" ..
        • You can use "Visual Studio 2013" as well
      • OSX command: nothing to be done, use the Xcode 3 projects or run on a different OS.
  2. Compile!
    • Windows:
      1. Open the solution file created by the cmake command in Visual Studio (found in the 'build' directory)
      2. Select 'Debug' build
      3. Once open, right-click on the 'bitfighter' project and click 'build'
    • Linux:
      1. In the 'build' directory, type 'make'
      2. Change to the '../exe' directory
      3. Run this command to make resources available: for file in `ls -1 ../resource` ; do ln -s ../resource/$file ; done
    • OSX: Build the application target in the Xcode 3 project (or use another OS)
  3. Run the game! It is found in the 'exe' directory, as 'bitfighter' or 'bitfighter.exe'

Coding Standards

These standards are intentionally brief. Please try to make your code match the surrounding code. These are guidelines, and all are violated from time to time, but you should only do so if it would improve the clarity of your code. We value clarity and understandably above all else.

  • Whitespace: Indent 3 spaces (no tabs), two blank lines between functions.
  • Whitespace: No spaces around parens (e.g. if(x == 3), not if ( x == 3)).
  • Braces: Opening braces go on a new line.
  • Line endings: Use Unix standard line endings (i.e. \n).
  • Comments: Prefer C++ comments (//) to C style (/* */).
  • Loop variables: For outer loops use i, for inner loops use j (then k).
  • Do not use increment operators embedded inside an expression (e.g. x = ++y).
  • If you must use new, add a comment indicating how it is cleaned up.
  • Add a comment demarcating constructors and destructors to make searching easier (see code for examples).
  • Member variables in classes should start with "m" and should be private or protected. Use getters/setters for external access.
  • Direct access to members of structs is allowed, and the "m" prefix should not be used.
  • Avoid global variables.
  • Use parens to clarify complex expressions, even if not strictly required. (e.g. x = (y / z) + a)
  • Above all, make your code clear!