This repo houses the game engine developed for CSC 581 (Game Engine Foundations), Group 15, Fall 2024 @ NC State
This project uses CMake along with Ninja as the build system
You may install a pre built package of Ninja on your platform
Additionally, please ensure that the following dependencies are installed on your platform
sudo apt update
sudo apt install build-essential x11-apps cmake
Install Homebrew from brew.sh
xcode-select --install
brew install cmake
Install Visual Studio 2022 and choose the Desktop development with C++
workload
Please note that all the Windows commands will need to be run on Developer PowerShell for VS 2022
Fetch dependent libraries and generate build files for your platform
This is a one-time step and need not be done when rebuilding the project
make configure # Ubuntu or macOS
.\scripts\configure.ps1 # Windows 11
Every folder in src/games
maps to a game
The .targetgames
file defines all the games that are supported in the current build
To build all games defined in .targetgames
, run
make # Ubuntu or macOS
.\scripts\build.ps1 # Windows 11
To build a specific game, set the GAME
variable
For example, if these are the games defined in .targetgames
hw5_joshua_homebound
hw5_rohan_space_invaders
hw5_rohan_brick_breaker
And you would like to only build hw5_joshua_homebound
, then you would need to run
make GAME=hw5_joshua_homebound # Ubuntu or macOS
.\scripts\build.ps1 -GAME hw5_joshua_homebound # Windows 11
After a game has been built, you may play it using this command
make play GAME=<game> ARGS="<game_args>" # Ubuntu or macOS
.\scripts\play.ps1 -GAME <game> -GAME_ARGS "<game_args>" # Windows 11
Most games include multi-player support, but require certain flags to be passed to the engine
This is facilitated by the ARGS
variable (GAME_ARGS
on Windows)
The flags supported by the engine are
--mode [single, cs, p2p] (default: single)
--role [server, client, host, peer] (default: client)
--encoding [struct, json] (default: struct)
--server_ip <ip_address> (default: localhost)
--host_ip <ip_address> (default: localhost)
--peer_ip <ip_address> (default: localhost)
To run hw5_joshua_homebound
in the client-server mode, run these commands in different shells
Server
make play GAME=hw5_joshua_homebound ARGS="--mode cs --role server"
Client
make play GAME=hw5_joshua_homebound ARGS="--mode cs --role client"
To run hw5_rohan_space_invaders
in the peer-to-peer mode, run these commands in different shells
Host
make play GAME=hw5_rohan_space_invaders ARGS="--mode p2p --role host"
Peer
make play GAME=hw5_rohan_space_invaders ARGS="--mode p2p --role peer"
To run hw5_rohan_brick_breaker
in the client mode, run the following command
This assumes that the server was already started on the same machine
Client
.\scripts\play.ps1 -GAME hw5_rohan_brick_breaker -GAME_ARGS "--mode cs --role client"
To clear all build artifacts, run
make clean # Ubuntu or macOS
.\scripts\clean.ps1 # Windows 11
Here is a map of inputs common to every game
Input | Action |
---|---|
p | Toggle timeline pause |
, | Slow down the timeline |
. | Speed up the timeline |
x | Toggle display scaling |
z | Toggle hidden zone visibility |
q | Toggle recording |
r | Replay the recording |
Please find all references in References.md