STAGE 2-4
PROTOTYPE

Maths & Physics Playground

Role Gameplay Math & Systems Programmer
Timeline 2025
Platform Unity 3D · PC
Team Size 1 (Solo)
UnityC#Vector MathControl Theory (P-Controller)Object PoolingGizmos
STAGE 2-4 // GAMEPLAY MATHS & PHYSICS PLAYGROUND Unity C# Vector Math Control Theory (P-Controller) Object Pooling Gizmos SYSTEM_INIT: OK | MEMORY: ALLOCATED | RENDERING: ONLINE

Mission Brief

Solve common 3D gameplay-math bugs from first principles using dot products, cross products, and subspace projection rather than black-box engine helpers.

Key Systems Engineered

Dimension-Reduced XZ-Plane Field-of-View Detection (EnemyVision.cs)

Flattens both the observer's forward vector and the direction-to-target onto the XZ plane (zeroing Y before normalizing) prior to computing the dot product against cos(viewAngle / 2). Prevents elevation differences from causing false-positive or false-negative 3D cone checks, visualized live with green/red Editor Gizmos.

Un-Normalized Cross-Product Proportional Turret Controller (TurretLogic.cs)

Computes the cross product of the flattened turret forward vector and flattened target direction, intentionally omitting normalization so the resulting Y component's magnitude scales proportionally with angular error. Acts as a natural P-controller that decelerates smoothly into alignment without bang-bang overshoot jitter.

Gracefully Self-Expanding Projectile Pool (ObjectPool.cs & PooledObject.cs)

Pre-warms inactive projectiles at Start() and dynamically instantiates and registers additional instances on the fly if sustained fire exhausts the active pool, resetting lifetime timers in OnEnable().

Implementation Details

Architecture & Deep Dive

This project solves three common 3D gameplay-math problems from first principles: field-of-view detection, smooth turret tracking, and efficient projectile management.

The FOV system flattens vectors to the XZ plane before dot-product comparison, preventing Y-axis elevation from corrupting horizontal angle checks. The turret controller uses an un-normalized cross product as a natural proportional controller — angular error directly maps to rotation speed without needing explicit PID tuning.

Select Player Class

Your class determines which skills and projects are highlighted throughout the site.

Achievements (0/11)

Press Start
Skipped or clicked through the boot sequence.
Class Act
Selected a Player Class to customize project ordering.
Efficient
Opened the 60-second Recruiter Mode summary.
Level Up
Opened your first engineering project Case File.
Completionist
Cleared all 12 project Case Files.
Coin Collector
Found and collected all 7 hidden coins across the site.
Old School
Entered the Konami Code or activated Arcade Mode.
Snake Charmer
Scored 10 or more points in the 404 Game Over Snake mini-game.
Hello, World
Copied the contact email address to your clipboard.
Curious
Opened the Keyboard Controls (?) overlay.
Bonus Round
Entered the hidden Bonus Stage development lab.

System Settings

Theme
Motion
Audio
Sound Effects
Advanced
Keyboard Shortcuts
Show Hidden Coins
Arcade Mode (CRT)

Keyboard Shortcuts

Navigate Sections
1 2 3 4
Open Achievements
A
Open Settings
S
Toggle Audio
M
Close Modal
Esc
Konami Code
↑ ↑ ↓ ↓ ← → ← → B A