The Modular Deployment System is a sophisticated faction-agnostic framework that replaces the legacy BaseUpgrade system. It provides a flexible, config-driven approach for all factions to deploy military assets anywhere on the map using a modular architecture.
The Modular Deployment System is production-ready with a complete modular architecture supporting complex deployment scenarios.
Scripts/Game/GameMode/Deployments/OVT_DeploymentComponent.c
Key Features:
Scripts/Game/GameMode/Deployments/OVT_DeploymentManager.c
Scripts/Game/GameMode/Deployments/Modules/OVT_BaseDeploymentModule.c
Deployments are composed of small, reusable modules:
Purpose: Spawns and manages vehicles
class OVT_VehicleSpawningDeploymentModule : OVT_BaseSpawningDeploymentModule
{
[Attribute()]
string m_sVehicleTypeId; // Links to faction vehicle configs
[Attribute()]
int m_iVehicleCount; // Number of vehicles to spawn
[Attribute()]
bool m_bRequiresParkingSlot; // Use parking slot system
[Attribute()]
float m_fSpawnRadius; // Spawn area radius
}
Purpose: Spawns and manages infantry groups
class OVT_InfantrySpawningDeploymentModule : OVT_BaseSpawningDeploymentModule
{
[Attribute()]
string m_sGroupTypeId; // Links to faction group configs
[Attribute()]
int m_iGroupCount; // Number of groups to spawn
[Attribute()]
float m_fSpawnRadius; // Group spawn area
protected ref array<ref SCR_AIGroup> m_aSpawnedGroups;
}
Purpose: Spawns static structures and compositions
class OVT_CompositionSpawningDeploymentModule : OVT_BaseSpawningDeploymentModule
{
[Attribute()]
string m_sCompositionTypeId; // Links to faction composition configs
[Attribute()]
string m_sRequiredSlotType; // Required slot type
[Attribute()]
bool m_bMustBeNearBase; // Base proximity requirement
[Attribute()]
float m_fMaxDistanceFromBase; // Maximum distance from base
}
Purpose: Defines patrol routes and behavior
class OVT_PatrolBehaviorDeploymentModule : OVT_BaseBehaviorDeploymentModule
{
[Attribute()]
string m_sPatrolType; // "perimeter", "point_to_point", "random", "town"
[Attribute()]
float m_fPatrolRadius; // Patrol area radius
[Attribute()]
ref array<ref vector> m_aWaypoints; // Custom waypoint array
[Attribute()]
string m_sTargetTownId; // Target town for town patrols
}
Purpose: Defines defensive positions and behavior
class OVT_DefenseBehaviorDeploymentModule : OVT_BaseBehaviorDeploymentModule
{
[Attribute()]
string m_sDefenseType; // "static", "roaming", "overwatch"
[Attribute()]
float m_fDefenseRadius; // Defense area radius
[Attribute()]
ref array<ref vector> m_aDefensePositions; // Defense position array
[Attribute()]
bool m_bUseNearbyDefendSlots; // Use SCR_AISmartActionSentinelComponent slots
}
Purpose: Defines logistics operations between deployments
class OVT_LogisticsBehaviorDeploymentModule : OVT_BaseBehaviorDeploymentModule
{
[Attribute()]
string m_sLogisticsType; // "supply_run", "reinforcement", "evacuation"
[Attribute()]
ref array<ref vector> m_aTargetLocations; // Target locations array
[Attribute()]
int m_iFrequencyMinutes; // Operation frequency
[Attribute()]
bool m_bRequiresEscort; // Escort requirement flag
}
Purpose: Activates deployment based on player proximity
class OVT_ProximityConditionDeploymentModule : OVT_BaseConditionDeploymentModule
{
[Attribute()]
float m_fActivationRange; // Player proximity for activation
[Attribute()]
float m_fDeactivationRange; // Player distance for deactivation
[Attribute()]
bool m_bRequireLineOfSight; // Line of sight requirement
}
Purpose: Activates deployment based on threat level
class OVT_ThreatConditionDeploymentModule : OVT_BaseConditionDeploymentModule
{
[Attribute()]
float m_fMinimumThreat; // Minimum threat level for activation
[Attribute()]
float m_fMaximumThreat; // Maximum threat level for activation
[Attribute()]
bool m_bRespondToThreatChanges; // Dynamic threat response
}
Purpose: Activates deployment based on time of day
class OVT_TimeConditionDeploymentModule : OVT_BaseConditionDeploymentModule
{
[Attribute()]
int m_iStartHour; // Start hour (0-23)
[Attribute()]
int m_iEndHour; // End hour (0-23)
[Attribute()]
bool m_bWeekdaysOnly; // Weekday restriction
}
Purpose: Defines faction-specific available assets
class OVT_FactionDeploymentAssets : OVT_BaseConfig
{
[Attribute()]
ref array<ref OVT_FactionVehicleAsset> m_aVehicles;
[Attribute()]
ref array<ref OVT_FactionGroupAsset> m_aGroups;
[Attribute()]
ref array<ref OVT_FactionCompositionAsset> m_aCompositions;
}
class OVT_FactionVehicleAsset
{
[Attribute()]
string m_sTypeId; // Matches module vehicle type ID
[Attribute()]
ResourceName m_sPrefab; // Vehicle prefab resource
[Attribute()]
int m_iResourceCost; // Deployment resource cost
}
The system leverages existing slot infrastructure:
SLOT_FLAT_SMALL
- Bunkers, small structuresSLOT_FLAT_MEDIUM
- Towers, medium buildingsSLOT_FLAT_LARGE
- Large compositions, basesSLOT_ROAD_*
- Roadblocks and checkpointsOVT_ParkingComponent
- Vehicle spawning// Modules can specify constraints
m_bMustBeNearBase = true; // Base proximity requirement
m_fMaxDistanceFromBase = 500; // Maximum distance from base
m_bMustBeOnRoad = true; // Road requirement
m_sRequiredSlotType = "road_medium"; // Specific slot type
OVT_DeploymentConfig {
m_sDeploymentName "Highway Patrol"
m_aAllowedFactionTypes {"occupying"}
m_iBaseCost 400
m_iPriority 5
m_aModules {
// Spawn patrol vehicles
OVT_VehicleSpawningDeploymentModule {
m_sVehicleTypeId "patrol_car"
m_iVehicleCount 2
m_bRequiresParkingSlot true
}
// Spawn patrol crews
OVT_InfantrySpawningDeploymentModule {
m_sGroupTypeId "patrol_crew"
m_iGroupCount 2
}
// Define patrol behavior
OVT_PatrolBehaviorDeploymentModule {
m_sPatrolType "point_to_point"
m_aWaypoints { /* waypoint vectors */ }
m_fPatrolSpeed 50
}
// Proximity-based activation
OVT_ProximityConditionDeploymentModule {
m_fActivationRange 1000
m_fDeactivationRange 1500
}
}
}
OVT_DeploymentConfig {
m_sDeploymentName "Road Checkpoint"
m_aAllowedFactionTypes {"occupying"}
m_iBaseCost 200
m_iPriority 3
m_aModules {
// Spawn checkpoint structure
OVT_CompositionSpawningDeploymentModule {
m_sCompositionTypeId "checkpoint_medium"
m_sRequiredSlotType "road_medium"
m_bMustBeOnRoad true
}
// Spawn checkpoint guards
OVT_InfantrySpawningDeploymentModule {
m_sGroupTypeId "checkpoint_guards"
m_iGroupCount 1
}
// Static defense behavior
OVT_DefenseBehaviorDeploymentModule {
m_sDefenseType "static"
m_bUseNearbyDefendSlots true
}
// Always active near roads
OVT_ProximityConditionDeploymentModule {
m_fActivationRange 800
}
}
}
void OVT_DeploymentComponent::InitializeDeployment(OVT_DeploymentConfig config, int factionIndex)
{
// Initialize all modules with parent reference
// Set faction ownership and resource allocation
// Register with deployment manager
}
void OVT_DeploymentComponent::ActivateDeployment()
{
// Check all condition modules
// Activate spawning modules if conditions met
// Apply behavior modules to spawned entities
// Update threat level and resource status
}
void OVT_DeploymentComponent::UpdateDeployment(int deltaTime)
{
// Update all modules with time delta
// Check condition modules for state changes
// Handle proximity-based activation/deactivation
// Process threat level changes
}
class OVT_BaseDeploymentModule
{
protected OVT_DeploymentComponent m_ParentDeployment;
void Initialize(OVT_DeploymentComponent parent)
{
m_ParentDeployment = parent;
OnInitialize(); // Module-specific initialization
}
// Access other modules via parent
array<OVT_BaseSpawningDeploymentModule> GetSpawningModules()
{
return m_ParentDeployment.GetSpawningModules();
}
}
The modular architecture allows easy addition of:
The Modular Deployment System represents a sophisticated evolution of faction military capabilities, providing a flexible, performant, and extensible framework for dynamic military operations across all factions in Overthrow.