Setup for PC
This is the setup guide for PC. If you’re using a Mac, go to here instead!
System Requirements
In general, any PC made within the last five years will be perfectly fine for this course. None of the games are particularly hardware-intensive, so you do not need a computer designed specifically for gaming.
Installing Visual Studio
Install Visual Studio Community 2022, from: https://www.visualstudio.com/downloads/. Note that this is NOT the same as Visual Studio Code.
In the installer, make sure to select both the “Game development with C++” and the “Desktop development with C++” workloads:
Additionally, for clang-format and clang-tidy support, click on the “Individual components” tab and search for “clang.” Make sure you check both options that appear:
You can also select any other workflows, if you want. If you’ve previously installed Visual Studio 2022 without both workflows (or you’re not sure), you can run the Visual Studio Installer from the start menu, select “modify” and add any additional workflows.
Installing “Format on Save” Extension
Once you install Visual Studio, you should also install the following extension: https://marketplace.visualstudio.com/items?itemName=mynkow.FormatdocumentonSave. To install, download and then double-click on the file. This extension will make it so that when you save a source file, it will automatically format it according to the .clang-format
file in your repository.
Using Alternate IDEs
In general, we do not support any other IDEs on Windows. Visual Studio is the gold standard in the video game industry used by professional developers for most platforms including PC, Xbox, PlayStation, and Nintendo Switch. Although it may be possible to get other IDEs to work with the course, no one will be able to help if you have any issues.
(Supplemental) Git/GitHub Basics
Most students have used Git and GitHub prior to this course. If you are familiar enough with GitHub, you can skip this video. However, if you’ve never used Git and GitHub before, this video covers the basics:
Git and GitHub
We use Git and GitHub for all the labs. The TAs will only grade lab submissions on GitHub!
Here are the steps to getting setup on GitHub:
- If you do not have a GitHub account, first you should create one (https://github.com/)
- Next, you need to accept the GitHub classroom assignment: https://classroom.github.com/a/mGIbcJnm
- Select your USC email from the list. If you do not see your email address listed, that’s okay, just “skip” this step for now.
- Once you accept the assignment, GitHub will create a repository for you with a URL like this: https://github.com/itp380-20243/labs-YourUsername. It should automatically redirect you to your repository page once created.
- Now you will need a Git client that will allow you to clone the code to your local computer, and then later push your changes to the GitHub server. Here are some choices (you only need to pick one):
- If you’re new to Git, and you want a simple UI, you can use GitHub Desktop: https://desktop.github.com/
- If you like command line interfaces, you can download Git Bash: https://gitforwindows.org/.
- You can also clone, commit, and push from inside Visual Studio, if you prefer.
Cloning Your Repo
The “clone” of a repo is the local copy of the code that’s on GitHub. You generally work in the clone and then can upload any changes to GitHub.
-
Now on the webpage for your GitHub repo, click the green “Clone or download” button:
-
If you’ve installed GitHub Desktop, you can click the “Open in Desktop” button and it should automatically open the program and ask where you want to clone your repository.
-
If you’re using the command line, this should just be:
git clone https://github.com/itp380-20243/labs-YourUserName.git
-
Otherwise, you need to copy the URL in this dropdown and use it to clone in your preferred program.
-
-
Now you should have your starting repository files on your local computer.
Working in Visual Studio
If you’ve previously worked with Visual Studio, you may have used a solution .sln
file. However, in this course we use a different cross-platform build system called CMake. This means the workflow in Visual Studio is slightly different.
-
In Explorer, browse to where your “labs-username” folder is. Right click on the labs folder and select “Open in Visual Studio”. This will automatically open the project in Visual Studio and run a CMake configuration which should succeed after a few seconds.
-
In Visual Studio, the solution explorer (View>Solution Explorer), will list all the different labs and their folders (Lab01, Lab02, …). So, for example, all the Lab 1 files would show up under Lab01:
-
Since it has all the labs listed, you have to tell Visual Studio which game you want to build and run. On the toolbar, next to the green play button, click “Select Startup Item” which will bring up a dropdown of all the choices. Since we want to work on Lab 1, pick the
Lab01.exe
option:(This means that if you want to instead work on Lab 2, you’d have to change to
Lab02.exe
.) -
Your play button should now look like this:
-
Clicking the play button should compile Lab 1’s code successfully, and then start running Lab 1. You’ll just see an empty console window and the program ends, but this means your Visual Studio is setup properly!
Using GitHub
From here, you will want to test pushing and viewing your build results on GitHub, which is outlined on the page here.