Marek — TrekHolding
Frontend & tools — HTML · JS · PY · LUA · LUAU

Combat & Progression Systems

Backend Developer • Advanced Game Mechanics for BattleGroundsWWII

System Overview

Developed sophisticated backend systems for BattleGroundsWWII focusing on combat mechanics, damage tracking, and player progression. These systems form the core gameplay foundation, handling complex interactions between players, weapons, and persistent data storage while maintaining performance in multiplayer environments.

Core System Components

  • Complex damage tracking with distance and weapon-type calculations
  • Kill attribution system with timestamp and positional data
  • Multi-weapon loadout management (primary, secondary, tertiary)
  • Real-time XP progression with level advancement mechanics
  • DataStore integration for persistent player statistics
  • Death handling and respawn state management

Technical Implementation

The combat systems required precise timing, accurate damage calculations, and reliable data persistence to ensure fair gameplay experiences.

Advanced Damage Tracking

local function calculateDistance(pos1, pos2) return math.floor((pos1 - pos2).Magnitude) end local function onPlayerDamaged(victim, attacker, weaponName) if victim and attacker and victim ~= attacker then local attackerPosition = attacker.Character and attacker.Character:FindFirstChild("HumanoidRootPart") local victimPosition = victim.Character and victim.Character:FindFirstChild("HumanoidRootPart") lastDamageDealer[victim.UserId] = { killer = attacker, weapon = weaponName or "Unknown Weapon", timestamp = os.clock(), attackerPos = attackerPosition and attackerPosition.Position, victimPos = victimPosition and victimPosition.Position } end end

Weapon Loadout Management

local function equipWeapon(player, weaponType, weaponName) local gun if weaponType == "Primary" then if Type == "Axis" then gun = replicatedStorage.AxisPrimary:FindFirstChild(weaponName):Clone() else gun = replicatedStorage.AlliesPrimary:FindFirstChild(weaponName):Clone() end gun.Parent = player.Backpack end end

XP and Level System

local function onXPChanged(player, xpVal, lvl) local stats = player:WaitForChild("leaderstats") local xpValue = stats:WaitForChild("XP") local levelValue = stats:WaitForChild("Level") local ok, saved = pcall(function() return store:GetAsync(player.UserId) end) if ok then levelValue.Value = math.clamp(saved, 1, LevelService.MaxLevel) end -- Save on disconnect Players.PlayerRemoving:Connect(function(player) pcall(function() store:SetAsync(player.UserId, levelValue.Value) end) end) end

Project Details

Role
Backend Developer
Scope
Core Feature Development
Integration
BattleGroundsWWII Systems
Complexity
High-Performance Backend

Technologies

Luau
Combat Systems
DataStore
XP Systems
Weapon Management
Player Stats

Technical Features

  • Real-time damage calculations
  • Distance-based combat mechanics
  • Multi-weapon loadout system
  • Persistent player progression
  • Kill tracking and attribution
  • DataStore error handling
  • Performance-optimized code