Eyan Martucci

Game Programmer Portfolio

  • Home
  • Contact
<–Back

Enemy Lock on Targeting

Language: C++ | Engine: Unreal Engine | Team Size: 1 | Released: Oct 2025

Play Enemy Lock on Targeting Demo
GitHub Repository

Introduction

This project was developed independently as a technical exploration of native C++ gameplay systems architecture within Unreal Engine. The core objective was to reverse-engineer and optimize the dynamic, physics-based lock-on targeting systems popularized by iconic 3D action-adventure titles like The Legend of Zelda. By working strictly within C++, the project serves as a showcase of algorithmic camera manipulation, computational geometry, and modular AI design patterns inside Unreal’s gameplay framework.


Contributions

Dynamic Camera Matrix & Spring Arm Manipulation

The foundational architecture of the project relies on a custom camera rig engineered entirely via C++ scripts rather than Blueprint nodes.

  • Algorithmic Camera Framing: Programmed a dynamic update loop that continuously recalculates the camera Spring Arm’s spatial coordinates and length vector based on the relative distance vectors between the player character and the active target. This ensures both actors remain perfectly framed within the viewport frustum regardless of movement.
  • Vector-Offset Rotation Overrides: Implemented an input override matrix that permits the user to manually adjust the camera angle while locked onto a target. The system calculates a structural vector offset from the default orientation, dynamically caching and applying this translation to preserve user intent without breaking the core look-at constraints

Spatial Multi-Target Switching Mechanics

To facilitate combat fluidity against dense groups of enemies, I engineered robust algorithmic proximity-sorting systems.

  • Proximity-Based Filtering: Built a rapid cycling system that queries the surrounding spatial environment, filters out the active target, and immediately re-anchors focus to the next nearest valid enemy entity. Players can quickly unlock and re-lock the camera to activate this system and target the next closest enemy.
  • Camera-Relative Vector Sorting: Implemented a directional target-switching algorithm that maps surrounding enemies onto a camera-relative coordinate space. By parsing lateral screen-space vector distances, players can directly input Q (left) or E (right) to instantly transfer the targeting lock to the adjacent enemy based on visual alignment, rather than arbitrary proximity.

Supporting Gameplay Systems

To accurately stress-test the camera mechanics in a real-time combat scenario, I authored an array of foundational gameplay modules.

  • State-Driven Combat & AI: Programmed basic melee collision tracing, responsive character controller movement profiles, and modular enemy AI behavior trees in native C++.
  • Predictive Visual Feeds: Designed and implemented a dual-state targeting UI indicator. By calculating the player’s look-at and forward vector projections at runtime, the engine renders a world-space arrow over the actively locked target, alongside a translucent predictive indicator pointing to the next-in-line entity before the user even initiates the lock-on state.

What I Learned

This project served as a comprehensive deep-dive into native C++ engine integration, providing essential familiarity with Unreal Engine’s underlying gameplay framework, memory management protocols, and character controller hierarchies. Transitioning from commercial C# environments to native C++ forced me to think deeply about system performance, pointer safety, and real-time mathematical calculations.

Developing this framework proved that supplemental assistive systems, such as an automated lock-on targeting architecture, are critical to the user experience. By removing the friction of manual camera positioning during high-intensity sequences, the system drastically reduces cognitive load and user frustration, allowing the player to focus purely on core strategic engagement. From a broader software engineering perspective, this project gave me deep insight into human-computer interaction and digital accessibility. It emphasized that high-quality software relies on creating intelligent, automated subsystems that abstract away mechanical complexity, ultimately making applications more tactile, responsive, and universally intuitive for users of varying skill levels.

Eyan Martucci

  • Home
  • Contact
Loading Comments...