Skip to content

A game engine developed for CSC 581 (Game Engine Foundations), Group 15, Fall 2024 @ NC State

Notifications You must be signed in to change notification settings

gef24-group/game-engine

Repository files navigation

checks build

game-engine

This repo houses the game engine developed for CSC 581 (Game Engine Foundations), Group 15, Fall 2024 @ NC State

Build

Prerequisites

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

Ubuntu 24.04

sudo apt update
sudo apt install build-essential x11-apps cmake

macOS Sequoia 15.1.1

Install Homebrew from brew.sh

xcode-select --install
brew install cmake

Windows 11 Version 24H2

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

Configure the build

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

Build all games

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

Build a specific game

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

Play

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

Engine flags

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)

Examples

Client-server mode (Ubuntu or macOS)

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"

Peer-to-peer mode (Ubuntu or macOS)

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"

Client mode (Windows 11)

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"

Cleanup

To clear all build artifacts, run

make clean           # Ubuntu or macOS
.\scripts\clean.ps1  # Windows 11

Common inputs

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

Gallery

Screenshots of games

References

Please find all references in References.md

About

A game engine developed for CSC 581 (Game Engine Foundations), Group 15, Fall 2024 @ NC State

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages