Alexander Aseme
GitHub IconLinkedIn Icon

Portal Clone

This was a solo C++ project built over four labs for a game programming course. Implemented in a custom engine using SDL and OpenGL, the game replicates core mechanics from Portal, including recursive portal rendering, energy pellet puzzles, turret AI, and a VO system with subtitles. It features first-person movement, physics-based platforming, portal teleportation, and environment interaction via raycasting and collision detection.

Implementing quaternion-based portal orientation, player teleportation with forward vector transforms, and dynamic portal view matrices required a strong grasp of linear algebra and careful debugging of edge cases. While it followed the specs, executing every system offered valuable hands-on experience with real-time rendering and gameplay programming.

Portal Clone

The game featured first-person navigation with gravity, platforming, and 3D collision handling. Players could place blue and orange portals on valid surfaces using raycasting and segment casts, enabling teleportation of both the player and interactable objects. Quaternion transforms ensured proper orientation and velocity transfer through portals, maintaining a seamless experience.

Recursive portal rendering was achieved by transforming the player's camera through the portal's matrix and rendering the view from that perspective. Energy pellet mechanics included timed launchers, catchers, and doors that unlocked when a pellet was caught in the corresponding catccher. Turrets were stateful AI actors capable of detecting, targeting, and damaging the player using laser beams via raycasting.

Audio and UI systems included distance-based volume fall-off, an HUD with voiceover subtitles, and directional damage indicators. VO triggers loaded sequences of audio lines with associated subtitles, optionally opening doors or loading new levels after playback.

Key Features

  • First-person movement, gravity, and physics-based jumping
  • Blue/orange portal placement using raycasting and segment casts
  • Recursive portal rendering with dynamic camera clipping
  • Portal teleportation preserving forward vector and velocity
  • Energy pellet puzzles with launchers, catchers, and doors
  • Turret AI with search, track, fire, fall, and shutdown states
  • Volume falloff audio system tied to actor distance
  • Voiceover triggers with sequential audio and subtitles
  • HUD damage indicators and player death VO taunts
  • Deterministic input replay system for speedruns/debugging

Technical Details

  • Genre: Puzzle Platformer (First-Person)
  • Engine: Custom (SDL + OpenGL)
  • Language: C++
  • Version Control: Git

Project Demo