Hamiltons Draft
A Blueprint for Flight
Hamiltons Draft is a custom flight game built on the .NET 10 framework. The project utilizes the SFML library to create a 2D presentation which is viewed from above and is driven entirely by underlying 3D movement calculations. The primary focus of the game centers on utilizing quaternions for rotation and flight control. The inspiration for this project originated during a GameJam. I wanted to master the challenge of smooth 3D rotation which avoids the usual angle pitfalls.
The Mathematical Foundation
William Rowan Hamilton introduced quaternions in 1843 to generalize complex numbers. Today this mathematical concept serves as a core tool for aerospace applications and modern game engines because it solves fundamental problems regarding 3D spatial orientation. For this project I implemented custom quaternion mathematics completely from scratch to ensure precision and rotations which are free of gimbal lock. The mathematical core includes functions for axis angle construction, normalization, inversion, vector rotation, and spherical linear interpolation. Implementing the mathematical logic itself proved easier than I initially expected, but grasping the deep functional concepts was challenging. While I gained a foundational understanding of quaternions, I did not reach my original learning goal and will need to continue studying them. Debugging the rotation order and locking conditions took several rigorous passes to ensure complete stability.
In quaternion mode the game updates roll, pitch, and yaw using quaternion multiplication to avoid gimbal lock and provide stable 3D orientation. I learned that when using Euler angles the order of axis rotations matters significantly because the middle axis often exerts the strongest effect. The project architecture also stores key bindings, high scores, and level map data within JSON configuration files to maintain modular support.
Audio and Visual Presentation
The visual presentation relies on a projection from the top down onto the XY plane. The project includes no visual game sprites because all visual elements such as the grid and the heads up display are generated at runtime using SFML draw calls. The player object uses a complex collider built from several ellipsoid collider parts. These 3D colliders are mathematically projected into a seamless 2D visualization so that players can properly interact with the environment. To complement the visual style, the game features custom music which my mother and sister composed specifically for this project.
Development Challenges
Balancing the 2D visual style with strict 3D rules proved to be a complex aesthetic and technical challenge. Setting up the collider projection which translates 3D into 2D correctly consumed the most time during the development phase. I encountered a movement bug where the flight path failed to match the visual display. My brother suggested creating a side projection from the space of the player so that the same side would always remain visible. I decided not to implement that specific approach due to time constraints after I successfully corrected the movement bug using the inclinometer.
The inclinometer displays the current pitch and roll angles of the player in real time. This tool was crucial for resolving movement bugs by ensuring that the mathematical orientation calculations perfectly aligned with the visual output on the screen.
Conclusion
Building this project independently reinforced how much effort coordinating multiple systems demands at this scale. I learned how to effectively balance and integrate input management, game state logic, asset loading, time control, and rendering. My technical understanding has grown significantly, and I successfully bridged abstract mathematical logic with practical gameplay feel.