Back to TPG

tpg.ent.controlpoint.server:CaptureStep

S🏷️ Controlpoint

Part of TPG namespace

ENT:CaptureStep(dt)
View on GitHub|entities/entities/tpg_controlpoint/init.lua:118-193
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

One fixed-size step of capture math: count who's standing on the point, move CapProgress toward whichever side outnumbers the other, and flip CapOwnership when it crosses timeNeutral/-timeNeutral. dt is the wall-clock duration of this step (seconds, defaulting to TPG.Config.captureStep). Progress is tracked in seconds, so capTimeNeutral/capTimeMax are real seconds regardless of tickrate or step size -- the old code added a whole balance per step instead, which made a point flip in ~0.75s no matter what capTimeNeutral said. Objective overtime (TPG.Objectives.GetOvertime) shrinks both time thresholds toward instant, and the SHRUNK ceiling (timeMax, stashed as self.EffectiveCapTimeMax) is what ENT:UpdateColor divides by -- using the configured, un-shrunk CapTimeMax there was a real bug this file documents fixing: a fully-held point in overtime read as ~10% progress and rendered near-black. An unbalanced point tops up toward the ceiling at a flat 0.5/second when nobody is contesting it; a neutral (0-owner), empty point decays exponentially toward zero (* 0.5^dt, ~halves per second) rather than holding still.

Parameters

NameTypeDescription
dtnumberStep duration in seconds.

Returns

No return values documented.

Examples

No examples available.

Used In

No usages found in the codebase.