Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/data/maps/core/MapScaffolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,33 +162,6 @@ function findClosestOfType(
return closest;
}

/** Find all bases of a specific type belonging to a player */
function _findPlayerBases(
bases: BaseLocation[],
playerSlot: number,
type?: BaseType
): BaseLocation[] {
return bases.filter(b =>
b.playerSlot === playerSlot &&
(!type || b.type === type)
);
}

/** Group bases by player */
function _groupByPlayer(bases: BaseLocation[]): Map<number, BaseLocation[]> {
const groups = new Map<number, BaseLocation[]>();

for (const base of bases) {
const slot = base.playerSlot ?? 0;
if (!groups.has(slot)) {
groups.set(slot, []);
}
groups.get(slot)!.push(base);
}

return groups;
}

// =============================================================================
// CONNECTION DETECTION
// =============================================================================
Expand Down Expand Up @@ -240,7 +213,6 @@ function detectConnections(
// Get mains
const mains = bases.filter(b => b.type === 'main');
const naturals = bases.filter(b => b.type === 'natural');
const _thirds = bases.filter(b => b.type === 'third');

// Auto-connect mains to their closest natural
if (config.autoConnectMainNatural) {
Expand Down
26 changes: 0 additions & 26 deletions src/engine/ai/ScoutingMemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,32 +152,6 @@ const TECH_TREE: Record<string, { requires: string[]; enables: string[] }> = {
research_module: { requires: [], enables: ['breacher', 'devastator', 'operative'] },
};

/**
* Strategy indicators
*/
const _STRATEGY_INDICATORS = {
rush: {
signs: ['early_aggression', 'low_workers', 'few_buildings', 'no_expansion'],
antiSigns: ['expansion', 'high_tech'],
},
macro: {
signs: ['expansion', 'high_workers', 'multiple_production'],
antiSigns: ['early_aggression', 'low_workers'],
},
tech: {
signs: ['early_gas', 'tech_buildings', 'low_army'],
antiSigns: ['early_aggression', 'no_gas'],
},
turtle: {
signs: ['defensive_buildings', 'late_expansion', 'static_defense'],
antiSigns: ['early_expansion', 'mobile_army'],
},
air_transition: {
signs: ['hangar', 'air_units', 'starport_activity'],
antiSigns: ['no_air_tech'],
},
};

/**
* Scouting Memory - Tracks and infers enemy strategy
*/
Expand Down
11 changes: 0 additions & 11 deletions src/engine/animation/AnimationParameterBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,6 @@ export function updateAnimationParameters(
controller.setBool('isBuilding', unit.state === 'building');
}

/**
* Unit states that should play walk animation when moving
*/
const _WALKING_STATES = new Set([
'moving',
'attackmoving',
'patrolling',
'gathering',
'building',
]);

/**
* Get the logical animation state from game state
* (for debugging / state inspection)
Expand Down
16 changes: 2 additions & 14 deletions src/engine/systems/CombatSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { isLocalPlayer } from '@/store/gameSetupStore';
import { debugCombat } from '@/utils/debugLogger';
import { deterministicDamage, quantize, QUANT_DAMAGE } from '@/utils/FixedPoint';
import { getDamageMultiplier, COMBAT_CONFIG } from '@/data/combat/combat';
import { getDefaultTargetPriority } from '@/data/units/categories';
import AssetManager from '@/assets/AssetManager';
import { getProjectileType, DEFAULT_PROJECTILE, isInstantProjectile } from '@/data/projectiles';
import { SpatialEntityData, SpatialUnitState } from '../core/SpatialGrid';
Expand Down Expand Up @@ -62,17 +61,6 @@ const underAttackPayload = {
// Combat constants now loaded from data-driven config (@/data/combat/combat.ts)
// Target priorities now loaded from unit definitions or categories (@/data/units/categories.ts)

/**
* Get target priority for a unit, checking unit component first, then category defaults.
* Higher values = more likely to be targeted first.
*/
function _getTargetPriority(unitId: string, _unit?: Unit): number {
// First check if unit has explicit priority set (from unit definition)
// The Unit component doesn't store targetPriority directly, so we use category defaults
// Fall back to category-based default priority from data config
return getDefaultTargetPriority(unitId);
}

// Assault mode timeout - clear assault mode after this many ticks of being idle with no targets
// 60 ticks = ~3 seconds at 20 ticks/sec - enough time to scan for new targets before giving up
const ASSAULT_IDLE_TIMEOUT = 60;
Expand Down Expand Up @@ -346,7 +334,7 @@ export class CombatSystem extends System {
/**
* PERF OPTIMIZATION: Rebuild attack ready queue from all combat units
*/
private rebuildAttackQueue(_gameTime: number): void {
private rebuildAttackQueue(): void {
this.attackReadyQueue.length = 0;

for (const entityId of this.combatActiveUnits) {
Expand Down Expand Up @@ -488,7 +476,7 @@ export class CombatSystem extends System {

// PERF OPTIMIZATION: Rebuild attack queue if dirty
if (this.attackQueueDirty) {
this.rebuildAttackQueue(gameTime);
this.rebuildAttackQueue();
}

// PERF OPTIMIZATION: First pass - handle dead units (fast scan of all units)
Expand Down
Loading