Skip to content

Commit

Permalink
Make intitialSpawnDelay configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewgdewar committed Jan 25, 2025
1 parent 103e0b1 commit 453cb74
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
12 changes: 12 additions & 0 deletions config/mapConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"customs": {
"initialSpawnDelay": 15,
"smoothingDistribution": 0.9,
"mapCullingNearPointValue": 10,
"spawnMinDistance": 30,
Expand All @@ -14,6 +15,7 @@
]
},
"factoryDay": {
"initialSpawnDelay": 10,
"smoothingDistribution": 0.4,
"mapCullingNearPointValue": 3,
"spawnMinDistance": 15,
Expand All @@ -24,6 +26,7 @@
"zombieWaveCount": 6
},
"factoryNight": {
"initialSpawnDelay": 10,
"smoothingDistribution": 0.4,
"mapCullingNearPointValue": 3,
"spawnMinDistance": 15,
Expand All @@ -34,6 +37,7 @@
"zombieWaveCount": 6
},
"interchange": {
"initialSpawnDelay": 20,
"smoothingDistribution": 0.9,
"mapCullingNearPointValue": 8,
"spawnMinDistance": 40,
Expand All @@ -46,6 +50,7 @@
]
},
"laboratory": {
"initialSpawnDelay": 15,
"smoothingDistribution": 0.9,
"mapCullingNearPointValue": 3,
"spawnMinDistance": 20,
Expand All @@ -54,6 +59,7 @@
"zombieWaveCount": 12
},
"lighthouse": {
"initialSpawnDelay": 20,
"smoothingDistribution": 0.9,
"mapCullingNearPointValue": 10,
"spawnMinDistance": 40,
Expand All @@ -66,6 +72,7 @@
]
},
"rezervbase": {
"initialSpawnDelay": 20,
"smoothingDistribution": 0.9,
"mapCullingNearPointValue": 10,
"spawnMinDistance": 40,
Expand All @@ -80,6 +87,7 @@
]
},
"shoreline": {
"initialSpawnDelay": 20,
"smoothingDistribution": 0.9,
"mapCullingNearPointValue": 10,
"spawnMinDistance": 40,
Expand All @@ -94,6 +102,7 @@
]
},
"tarkovstreets": {
"initialSpawnDelay": 20,
"smoothingDistribution": 0.9,
"mapCullingNearPointValue": 10,
"spawnMinDistance": 40,
Expand All @@ -102,6 +111,7 @@
"zombieWaveCount": 13
},
"woods": {
"initialSpawnDelay": 20,
"smoothingDistribution": 0.9,
"mapCullingNearPointValue": 10,
"spawnMinDistance": 40,
Expand All @@ -116,6 +126,7 @@
]
},
"gzLow": {
"initialSpawnDelay": 10,
"smoothingDistribution": 1,
"mapCullingNearPointValue": 7,
"spawnMinDistance": 30,
Expand All @@ -124,6 +135,7 @@
"zombieWaveCount": 9
},
"gzHigh": {
"initialSpawnDelay": 10,
"smoothingDistribution": 1,
"mapCullingNearPointValue": 7,
"spawnMinDistance": 30,
Expand Down
Binary file modified dist/DewardianDev-MOAR-2.7.0.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions src/Spawning/buildPmcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ export default function buildPmcs(
locationList[index].base.BotLocationModifier.AdditionalHostilitySettings =
defaultHostility;

const { pmcHotZones = [], pmcWaveCount } =
const { pmcHotZones = [], pmcWaveCount, initialSpawnDelay } =
(mapConfig?.[map] as MapSettings) || {};

const {
Position: { x, z },
} =
locationList[index].base.SpawnPointParams[
locationList[index].base.SpawnPointParams.length - 1
locationList[index].base.SpawnPointParams.length - 1
];

// console.log(map);
Expand Down Expand Up @@ -99,7 +99,7 @@ export default function buildPmcs(
"pmcUSEC",
false,
config.pmcWaveDistribution,
15 + Math.round(10 * Math.random())
initialSpawnDelay + Math.round(10 * Math.random())
);

const pmcBEAR = buildBotWaves(
Expand All @@ -112,7 +112,7 @@ export default function buildPmcs(
"pmcBEAR",
false,
config.pmcWaveDistribution,
15 + Math.round(10 * Math.random())
initialSpawnDelay + Math.round(10 * Math.random())
);

const pmcs = [...pmcUSEC, ...pmcBEAR];
Expand Down
11 changes: 5 additions & 6 deletions src/Spawning/buildScavMarksmanWaves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { ILocation } from "@spt/models/eft/common/ILocation";
import _config from "../../config/config.json";
import mapConfig from "../../config/mapConfig.json";
import {
configLocations,
defaultEscapeTimes,
defaultHostility,
originalMapList,
} from "./constants";
import { buildBotWaves, MapSettings, shuffle, waveBuilder } from "./utils";
import { buildBotWaves, MapSettings, shuffle } from "./utils";
import { WildSpawnType } from "@spt/models/eft/common/ILocationBase";
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { saveToFile } from "../utils";
Expand Down Expand Up @@ -64,6 +62,8 @@ export default function buildScavMarksmanWaves(
maxBotCapOverride,
EscapeTimeLimit,
scavHotZones = [],
scavWaveCount,
initialSpawnDelay
} = (mapConfig?.[map] as MapSettings) || {};

// Set per map EscapeTimeLimit
Expand Down Expand Up @@ -104,7 +104,7 @@ export default function buildScavMarksmanWaves(
Position: { x, z },
} =
locationList[index].base.SpawnPointParams[
locationList[index].base.SpawnPointParams.length - 1
locationList[index].base.SpawnPointParams.length - 1
];

let sniperLocations = getSortedSpawnPointList(
Expand All @@ -129,7 +129,6 @@ export default function buildScavMarksmanWaves(
];
}

const { scavWaveCount } = mapConfig[map];

let scavZones = getSortedSpawnPointList(
locationList[index].base.SpawnPointParams.filter(
Expand Down Expand Up @@ -198,7 +197,7 @@ export default function buildScavMarksmanWaves(
WildSpawnType.ASSAULT,
false,
scavWaveDistribution,
15
initialSpawnDelay + Math.round(10 * Math.random())
);

// Add hotzones if exist
Expand Down
9 changes: 5 additions & 4 deletions src/Spawning/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ export const buildBotWaves = (
BossPlayer: false,
BossZone:
bossZones[
isMarksman
? totalCountThusFar
: Math.floor(totalCountThusFar * botToZoneTotal)
isMarksman
? totalCountThusFar
: Math.floor(totalCountThusFar * botToZoneTotal)
] || "",
Delay: 0,
DependKarma: false,
Expand Down Expand Up @@ -341,6 +341,7 @@ export const buildZombie = (
};

export interface MapSettings {
initialSpawnDelay: number;
smoothingDistribution: number;
mapCullingNearPointValue: number;
spawnMinDistance: number;
Expand Down Expand Up @@ -419,7 +420,7 @@ export const setEscapeTimeOverrides = (
if (
!override &&
locationList[index].base.EscapeTimeLimit / defaultEscapeTimes[map] >
hardcodedEscapeLimitMax
hardcodedEscapeLimitMax
) {
const maxLimit = defaultEscapeTimes[map] * hardcodedEscapeLimitMax;
logger.warning(
Expand Down

0 comments on commit 453cb74

Please sign in to comment.