This project page highlights the work done during the 'Game Programming Fundamentals' module at Teesside University (Year 1, 2024 - 2025). The course progressed from simple introductory C++ tasks to experimenting with the SFML library to create a 2D Maze Game and circle experiment. The starter code/framework was provided by the lecturer.
Circle's Experiment - Experimented with SFML and physics with circles bouncing around the screen.
Randomised Initialisation: Created shape classes which utilise a Constructor to randomize attributes upon instantiation, generating unique positions, sizes, velocities, and colours for every entity.
Physics & Collision: Experimented with particle systems, gravity, and a realistic screen bouncing effect through inverting the velocity once the circle's edge collides with the screen's edge.
Input Handling: Implemented mouse detection logic; a Left-Mouse click instantly moves all active circles to the cursor's position, a Right-Mouse click instantiates a new circle.
Rectangle Experimentation: Expanded the codebase by creating a Rectangle class that replicates the behaviour of the Circle class, minus the mouse inputs.
Maze Game - Created a simple maze game with enemy AI, and file handling using SFML.
Grid-Based Logic: Utilised 2D arrays to handle the levels, iterating through the grid to render the different cells (player, walls, hazards etc).
File Handling: Implemented level saving and loading using 'FStream', this is done by saving level state to a text file and then reading it for loading.
Enemy AI: Developed a patrolling enemy. The AI calculates a random cardinal direction and checks if the target tile is "walkable" (not a Wall) before moving, preventing it from clipping through the level.
Game State Management: Managed game states where reaching the goal (G) triggers a level increment (loading the next map file) and contact with an enemy or hazard triggers a reset.
The first few weeks of the module focused on providing small individual tasks to introduce us to C++.
Loops & Arrays: Experimented with different loops to manipulate arrays, writing an algorithm which populated one half of an array and then mirrored it to the other half.
Boolean Logic & Comparisons: Explored Boolean logic (AND, OR and NOT) and if statements. Demonstrated through a text-based guard AI which evaluates numerous variables (e.g. ammo, health, visibility) to determine the guard's state.
Variables, Math & The Console: Introduced to foundational C++ skills, exploring variable types (int, float, string etc) and simple operations (multiplication, modulus etc). This culminated in a temperature conversion tool that utilised 'cin' and 'cout' for user interaction.
Language: C++
Libraries/Frameworks: SFML, C++ Standard Libraries (fstream, vector, iostream, cstdlib, ctime)
Core Concepts: OOP (Classes, Constructors, Inheritance), File I/O, 2D Arrays & Grid Logic, Memory Management (Pointers/References), Collision Detection
IDE: Visual Studio
Tools: GitHub
As my first delve into the industry-standard programming language, C++, this module proved quite challenging yet informative.
Adapting to C++: Due to my background experience with C#, moving from it to C++ didn't prove as daunting as it could've been. Whilst there were some initial challenges due to the differences, the similarities more than made up for it. The real challenge came with learning SFML; this was entirely unfamiliar so came as quite a challenge, one I overcame greatly benefitting me in the end.
File Handling Logic: Understanding the logic for 'fstream' was an initial challenge. Whilst I understood how to save to a text file—I struggled with reading from it. I eventually learned how to loop through, character by character, allowing me to save those characters to an array.
AI Movement: In the Maze Game, I struggled with a bug where the AI would move multiple tiles in a single frame. I realised this was an issue with how the game loop handled updates; once this was realised it was quickly solved.
Pointers & References (Theory vs. Practice): During the module, I found the concept of direct memory management using Pointers and References intriguing, but implementing them practically proved more challenging than anticipated. Despite this, I understand their critical role in efficient memory handling and am committed to mastering them for use in future low-level projects.
Algorithmic Logic: One of the early logic puzzles involved populating an array and then mirroring its values to the second half. Finding the correct mathematical formula to reverse the index order required significant trial and error, but it solidified my understanding of how to manipulate data structures efficiently.
Reflective Summary: Looking back, I wish I had more time to explore SFML deeper to implement more complex mechanics, such as smoother, logic-driven AI pathfinding. However, this module gave me a strong appreciation for the low-level architecture that powers the engines I use today.
Module Grade: 88%