Homework #3 : Game Loops & Text Adventures
The story of most game engines begins with a game
A genre long gone (but-not-forgotten), Text Adventures– games played entirely via text / terminal– enjoyed their heyday in the 1970s. Developers created vivid worlds and adventures with little but the written word (play one of the early ones, Colossal Cave Adventure (left), here). This genre will provide a gentle environment in which to experiment with core game engine concepts before the introduction of realtime 2D rendering in a couple weeks. (Left image by andiwm2003)
Pitch
Homework #3 : Game Loops & Text Adventures is the first core, programming-intensive assignment in the course.
It marks the beginning of our C++ game engine codebases– code that will be upgraded and iterated on for the remainder of the semester. Students will practice low-level basics of game development in the context of a storied (and programmer-friendly) genre. Future weeks and assignments will bring dramatic improvements to flexibility, expressiveness, aesthetics, and performance.
Purpose
Most game engines begin as a single, one-off game. The famous Unreal Engine, for instance, began as the codebase for Unreal– a 1998 first person shooter game to rival id software’s Quake. When Epic MegaGames (their name at the time) began to re-use Unreal’s technology for future projects, and even license it to external developers for usage, their codebase transformed from that of a game to a reusable engine. Succinctly put– “Make a game, then make a second game. The stuff you re-used is the game engine.”
This assignment will--
● Mark the beginning of students’ custom game engine codebases (via a simple text adventure game)
● Introduce the classic (Input -> Update -> Render) game loop.
● Introduce the concept of Actors.
● Introduce the course autograder and multiplatform build process (Visual Studio, XCode, Make)
● Introduce “Test Driven Development” (TDD) as a means for iterative (step-by-step) software development.
Tasks
Study the Autograder and Assignment Submission Process
● Autograder General Guide
○ Windows / Visual Studio Guide
○ OSX / XCode Guide
○ Make Guide
Acquire Assignment Dependencies
New : GLM 0.9.9.8 (“GL Math”)
● A header-only library that provides useful mathematical structures and functions, such as glm::ivec2 (an integer vector-2 useful for representing 2D integer coordinates). You will need to tell your compilers / IDEs where to look for these header files. Begin using it via #include "glm/glm.hpp"
○ Note : In C++ "vector" typically means std::vector (AKA, “dynamic array”). Here we refer to the mathematical / tuple meaning of “vector” (“2d vector”, “3d vector”, etc).
○ Trivia : GLM data types / functions are also used in the GLSL shading language, which may prove useful for writing shaders in the future (though OpenGL may deprecate… eventually).
New : MapHelper.h
● An assignment-specific helper file that includes a struct definition for Actors, a hardcoded scene (map), an array of hardcoded Actors, intro / outro message strings, etc.
NOTE : Do not use absolute file paths when configuring location of include / header directories.
● These will break on other machines / other filesystems. Use $(ProjectDir) / $(PROJECT_DIR) / other macros to establish relative paths instead.
Recommended .gitignore
Test-Driven Development
Each of the following test suites has a particular focus, and requires the implementation of particular features.
You are recommended to clear all test cases in a given suite before proceeding to the next. If you break an older feature or introduce a bug, you may rely on older test suites to warn you of such regressions (You may read about test-driven development, and why it features heavily in industry, here).
my wechat:_0206girl
Don't hesitate to contact me