src/projects/melee-combat/page.tsx
workspace/projects/melee-combat

Deterministic Melee Combat Framework

Gameplay Framework
Role

Lead Combat & Physics Programmer

Timeline

Nov 2024 - Jan 2025

-- Source Code

M1Service.luau1 of many files
luau
1local Players = game:GetService("Players")
2local ReplicatedStorage = game:GetService("ReplicatedStorage")
3local RunService = game:GetService("RunService")
4local Workspace = game:GetService("Workspace")
5
6local CombatConfig = require(ReplicatedStorage:WaitForChild("Shared"):WaitForChild("Config"):WaitForChild("CombatConfig"))
7local HitboxUtils = require(ReplicatedStorage:WaitForChild("Shared"):WaitForChild("Utils"):WaitForChild("HitboxUtils"))
8
9local DamageService = require(script.Parent:WaitForChild("DamageService"))
10local StateService = require(script.Parent:WaitForChild("StateService"))
11
12local M1Service = {}
13
14local VALID_FINISHER_TYPES = {
15 Normal = true,
16 Uppercut = true,
17 Downslam = true,
18}
19
20local GROUND_RAYCAST_DISTANCE = 3.5

-- Description

Engineered a robust, deterministic melee combat framework using Rojo and Wally. Orchestrated game state transitions via custom asynchronous loops and Promises. The core includes a character kinematics controller overriding default physics behavior in favor of custom momentum vector manipulation. Designed strict spatial validation, blocking jump/dash combinations on the Y-axis when the avatar is airborne. Built a fatigue calculator that decays jump velocity on successive inputs, enforcing a non-linear respiratory cooldown. Hit registration features directional validation based on the dot product of relative player vectors. Frontal-cone block state procedurally absorbs damage, while rear attacks bypass defense and trigger speed-throttling. The strike sequences are driven by a Finite State Machine (FSM) enabling smooth, low-latency chaining between dashes and M1 attacks. Implemented a separate local camera controller utilizing rotation matrices for unrestricted view angles during translation movements. Designed an asynchronous HUD that subscribes directly to cooldown states, utilizing UIGradient clipping masks to display millisecond-accurate skill recovery. Procedural rendering effects are triggered asynchronously upon hit validation.

-- Technologies

LuauRojoPromisesFSMRaycastingVector Math

Challenges

Overcoming erratic physics behaviors in network environments during rapid movements, managing state synchronization for multi-phase hitboxes, and displaying lag-free, high-precision cooldown visualizers.

Solutions

Created custom kinematics algorithms overriding native physical constraints, implemented dot-product target verification on the server, and built UI modules that hook directly into state change callbacks via local Promises.

-- Snippet

melee-combat.luau
local p = workspace:FindFirstChild("MeleeCombatFramework")

// EOF - Built with Next.js, Tailwind CSS & Framer Motion