Computer Game Programming (Fall, 2022)
TR 10:10-11:30AM in Doherty Hall 1211.
Taught by Jim McCann (Office Hours by appointment — just e-mail!)
With TA help from Siheng Li and Mark Gillespie (Office Hours on Monday 5-6pm and Wednesday 4-5pm in the Smith Hall second floor common area ; e-mails here.)
In this class, we made a bunch of small games, as well as ten final games. These games were launch[ed] live and in person on Friday, December 9th at 6-8pm in the GHC 52xx corridor and environs.
- Aperture [also: presskit]
- Project Athena [also: presskit]
- Cricket Simulator 2K22 [also: presskit]
- Code Quest [also: presskit]
- Poly Defense [also: presskit]
- Hunan Havoc [also: presskit]
- Morphology Mania [also: presskit]
- Dungeon Beats [also: presskit]
- Self Battle [also: presskit]
- Melody of Hearts [also: presskit]
Computer Game Programming will help you build the programming skills needed to turn ideas into games. This means we'll be covering both runtime systems and the asset pipelines to fuel them, along with some game-design exercises (with an eye to thrifty code).
Previous years with similar content: Game Programming '21, Game Programming '20, Game Programming '19, Game Programming '18, Game Programming '17, Game Programming '09.
Students will be graded out of 20 + 3N + 6 points, divided as follows:
You will be reading lesson materials asynchronously, then discussing the material in class; your class participation score will be based on your contributions to these discussions (as well as the written answers in the lesson materials). Small games will be assigned roughly weekly to highlight basic game-related functions. The Final Game will be larger undertaking by groups of 3-4.
There are no late days; however, if your lowest small game score is less than 3, it will be replaced by a 3 when computing your grade.
Being sick isn't fun. University health services often has flu vaccine available starting in September (though this year things may work a little differently). Your standard anti-SARS-CoV-2 measures might also work well against influenza.
Mental health is an important aspect of physical health. CMU's CaPS services exist to help you manage your mental state.
If you have a disability and are registered with the Office of Disability Resources, I encourage you to use their online system to notify me of your accommodations and discuss your needs with me as early in the semester as possible. I will work with you to ensure that accommodations are provided as appropriate. If you suspect that you may have a disability and would benefit from accommodations but are not yet registered with the Office of Disability Resources, I encourage you to contact them at email@example.com.
Using other people's code or data without giving credit is a form of plagiarism. Plagiarism is an immoral activity that I take very seriously. If you plagiarize, you will fail the class, and I will do my best to make sure you are removed from CMU entirely.
All you need to do to avoid plagiarism is to make sure to give credit for the code and data you use in you project.
Something as simple as the comment "
//based on https://wiki.libsdl.org/SDL_CreateWindow" can save your academic career from ruin.
Additionally, most human-created works are covered by copyright and thus subject to some sort of license agreement. Make sure that code and data you use has a license agreement compatible with this course. For example, I am unwilling to pay for a license for a library so I can compile your code, or sign a non-disclosure agreement so I can read it.
Finally, there are two course rules which restrict your use of others' code beyond the basic requirements of ethics and legality:
- Avoid code from previous iterations of this course. There is a lot of it out there, but just don't look at it. You will learn less.
- Follow any game-specific rules. (E.g., some games require you to author all assets yourself so you understand the tools.)
This is a course that involves writing a lot of code. Please, by all means, work together!
- For all assignments, feel free to share code, as long as you understand the code you use, have permission to use the code, and give credit. (You still need to make different games than each-other.)
- For game4-game6, you can work in group (up to 3) and turn in a single game. I will expect more of a group than an individual (approximately, one "extra, fancy thing" in the game per extra person), and I will need to interview your group to ensure your contribution was equitable. Also, please don't work with the same people all the time.
The course does not have a textbook. However, there are several documents available on the internet that you may find useful:
- The OpenGL Specifications (of particular interest: OpenGL 3.3 and GLSL 3.30)
- docs.GL contains man pages for OpenGL functions.
- SDL Documentation
- cppreference.com the slightly-better documentation wiki for modern C++
- Advances In Real-Time Rendering SIGGRAPH course notes covering advanced rendering techniques being used in games
- Blender API Documentation, useful when writing or modifying export scripts.
There are also some great, cross-platform content-creation tools that we will use in our asset pipelines:
- GIMP is a 2D raster graphics editor
- Inkscape is a 2D vector graphics editor
- Blender is a 3D modelling, animation, and rendering suite
- Audacity is a decent free sound editor
- BeepBox is an easy-to-use music creation webapp
- JFXR is a sound-effects synthesizer in a web page
And some places to get free game assets:
- Kenney.nl has 2D and 3D assets, creative-commons licensed
- Poly Haven has a great collection of free HDR images (for image-based lighting), PBR textures (for fancy materials), and 3D models
- FreePD free, public domain music
- Incompetech royalty-free (but make sure you credit the author) music
- freesound various CC-licensed sound effects
- gameaudiogdc large pack of royalty-free game sound effects
- Google Fonts a trusted repository of fonts, many of which are licensed for general use (read the licenses, though!).
This schedule is subject to change in cases where my estimation of the time required to cover a topic does not match the reality.
All assignments are due before class unless otherwise noted.
- Course intro
- Timing + Main Loop
- Compile basecode, start game1
- Before Class: finish Asset Pipelines (pt 1)
- C++ warm-up (stupid code)
- PPU466 sprite pipeline
- Before Class: finish Asset Pipelines (pt 2)
- Before Class: finish Meshes
- From Blender to your game.
- Scene efficiency.
- Before Class: finish Scene Graphs and Materials
- Game1 Showcase
- Better material handling
- Before Class: finish Sound ("Sound" part)
- Design a sound API
- Before Class: finish Sound ("Music" part)
- Game2 Showcase
- Music Theory by and for beginners
- Before Class: finish Text + Fonts
- Font and text layout pipelines
- Linear logic (notes)
- Game3 Showcase
- Dialog and choice pipelines
- Before Class: finish Collision
- Build fast collision checks
- Note: Participate in the Ludum Dare #51 game jam over the weekend and get +1pt extra credit
- Before Class: finish WalkMesh
- Game4 Showcase
- WalkMesh code share
- Before Class: finish Networking
- sockets warm-up
- Game5 Showcase
- Theme selection
- Set up group infrastructure
- Write planning docs
- Game6 Showcase
- The ECS Paradigm
- Team check-ins
- Prototype work time
- Before Class: finish Framebuffers
- Linear Blend Skinning Example Code
- Prototype work time
- How to playtest
- Prototype playtest
- Vertical slice planning + work time
- Before Class: finish Lighting
- Light Loops Example Code
- Vertical slice work time
- Before Class: finish Shadows
- Shadow Maps Example Code
- "Keynote" demos + "show floor" playtesting
- Build out planning + work time
- Game Theory, Planning, and Value Functions
- Build out work time
- Writing nifty shaders (water, ambient occlusion, edge detection, GPU particles)
- The confusing state of cross-platform graphics APIs
- Build out work time
- Build out work time
- set up distribution (itch.io?)
- Crowd Simulation and Rendering
- Build out work time
- Bug hunting
- Polish + presskit planning + work time
- Rendering for VR
- Final game show and tell
Aug 30 Game1: Sprite-Based Game due
Sep 8 Game2: The Virtual World due
Sep 15 Game3: Require Sound due
Sep 22 Game4: Choice-Based Game due
Sep 29 Game5: Walkmesh due
Oct 6 Game6: Multiplayer due
Oct 25 final A: Prototype due
Nov 1 final B: Vertical Slice due
Nov 10 final C: Build Out due
Dec 1 final D: Polishing & Presskit due