Skip to content

Commit

Permalink
2.6.9 Experimental wave rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewgdewar committed Jan 14, 2025
1 parent 6a2ef0f commit 75ae669
Show file tree
Hide file tree
Showing 11 changed files with 238 additions and 195 deletions.
22 changes: 10 additions & 12 deletions config/Presets.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
{
"live-like": {},
"more-scavs": {
"moreScavGroups": true,
"scavGroupChance": 0.5,
"scavMaxGroupSize": 5,
"scavWaveQuantity": 1.2
},
"more-pmcs": {
"scavWaveDistribution": 0.4,
"morePmcGroups": true,
"pmcGroupChance": 0.5,
"pmcMaxGroupSize": 5,
"pmcWaveQuantity": 1.2
},
"more-scavs-and-pmcs": {
"scavWaveDistribution": 0.4,
"moreScavGroups": true,
"scavGroupChance": 0.7,
"scavMaxGroupSize": 5,
"morePmcGroups": true,
"pmcGroupChance": 0.8,
"pmcMaxGroupSize": 5,
"scavWaveQuantity": 1.2,
"pmcWaveQuantity": 1.2,
Expand All @@ -37,14 +35,13 @@
"randomRaiderGroupChance": 50
},
"insanity": {
"scavWaveDistribution": 0.4,
"scavWaveQuantity": 1.3,
"pmcWaveQuantity": 1.3,
"moreScavGroups": true,
"morePmcGroups": true,
"scavGroupChance": 0.7,
"pmcGroupChance": 0.8,
"pmcMaxGroupSize": 6,
"scavMaxGroupSize": 6,
"snipersHaveFriends": true,
"sniperGroupChance": 1,
"bossOpenZones": true,
"randomRaiderGroup": true,
"randomRaiderGroupChance": 50,
Expand All @@ -59,6 +56,7 @@
"mainBossChanceBuff": 35
},
"sniper-buddies": {
"snipersHaveFriends": true
"sniperMaxGroupSize": 2.5,
"sniperGroupChance": 1
}
}
}
21 changes: 11 additions & 10 deletions config/config.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
{
"enableBotSpawning": true,
"spawnSmoothing":true,

"pmcDifficulty": 0.6,
"scavDifficulty": 0.4,

"scavWaveDistribution": 0.5,
"scavWaveDistribution": 1.2,
"scavWaveQuantity": 1,

"startingPmcs": false,
"pmcWaveDistribution": 0.7,
"pmcWaveQuantity": 1,

"playerOpenZones": false,
"pmcOpenZones": true,
"allOpenZones": false,

"pmcWaveDistribution": 0.7,
"pmcWaveQuantity": 1,

"zombiesEnabled": false,
"zombieWaveDistribution": 0.5,
"zombieWaveDistribution": 0.8,
"zombieWaveQuantity": 1,
"zombieHealth": 1,

"maxBotCap": 25,
"maxBotPerZone": 5,
"maxBotPerZone": 7,

"moreScavGroups": false,
"morePmcGroups": false,
"sniperGroupChance": 0.1,
"scavGroupChance": 0.2,
"pmcGroupChance": 0.2,

"pmcMaxGroupSize": 4,
"scavMaxGroupSize": 4,

"snipersHaveFriends": false,
"sniperMaxGroupSize": 1.7,

"bossOpenZones": false,

Expand Down
8 changes: 4 additions & 4 deletions config/mapConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"interchange": {
"spawnMinDistance": 40,
"pmcWaveCount": 14,
"scavWaveCount": 32,
"scavWaveCount": 28,
"zombieWaveCount": 12,
"scavHotZones": [
"ZoneCenterBot",
Expand Down Expand Up @@ -68,7 +68,7 @@
"shoreline": {
"spawnMinDistance": 40,
"pmcWaveCount": 14,
"scavWaveCount": 32,
"scavWaveCount": 28,
"zombieWaveCount": 12,
"scavHotZones": [
"ZoneSanatorium1"
Expand All @@ -79,8 +79,8 @@
},
"tarkovstreets": {
"spawnMinDistance": 40,
"pmcWaveCount": 16,
"scavWaveCount": 28,
"pmcWaveCount": 14,
"scavWaveCount": 26,
"zombieWaveCount": 13
},
"woods": {
Expand Down
Binary file removed dist/DewardianDev-MOAR-2.6.7.zip
Binary file not shown.
Binary file added dist/DewardianDev-MOAR-2.6.9.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MOAR",
"version": "2.6.7",
"version": "2.6.9",
"main": "src/mod.js",
"license": "MIT",
"author": "DewardianDev",
Expand Down
17 changes: 12 additions & 5 deletions src/Spawning/Spawning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { buildBossWaves } from "./buildBossWaves";
import buildZombieWaves from "./buildZombieWaves";
import buildScavMarksmanWaves from "./buildScavMarksmanWaves";
import buildPmcs from "./buildPmcs";
import { setEscapeTimeOverrides } from "./utils";
import { enforceSmoothing, setEscapeTimeOverrides } from "./utils";
import { ILogger } from "@spt/models/spt/utils/ILogger";
import updateSpawnLocations from "./updateSpawnLocations";

Expand All @@ -40,7 +40,7 @@ export const buildWaves = (container: DependencyContainer) => {

const databaseServer = container.resolve<DatabaseServer>("DatabaseServer");

const { locations, bots, globals } = databaseServer.getTables();
const { locations, bots } = databaseServer.getTables();

let config = cloneDeep(globalValues.baseConfig) as typeof _config;

Expand Down Expand Up @@ -135,9 +135,6 @@ export const buildWaves = (container: DependencyContainer) => {

setEscapeTimeOverrides(locationList, _mapConfig, Logger, config);

// Make main waves
buildScavMarksmanWaves(config, locationList, botConfig);

// BOSS RELATED STUFF!
buildBossWaves(config, locationList);

Expand All @@ -148,6 +145,16 @@ export const buildWaves = (container: DependencyContainer) => {

buildPmcs(config, locationList);

// Make main waves
buildScavMarksmanWaves(config, locationList, botConfig);

// enableSmoothing
if (config.spawnSmoothing) {
enforceSmoothing(locationList)
}

// saveToFile(locations.bigmap.base.SpawnPointParams, "spawns.json");

originalMapList.forEach((name, index) => {
if (!locations[name]) {
console.log("[MOAR] OH CRAP we have a problem!", name);
Expand Down
56 changes: 43 additions & 13 deletions src/Spawning/buildPmcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
defaultEscapeTimes,
defaultHostility,
} from "./constants";
import { buildPmcWaves, MapSettings, shuffle } from "./utils";
import { buildBotWaves, MapSettings, shuffle } from "./utils";
import { saveToFile } from "../utils";

export default function buildPmcs(
Expand All @@ -19,10 +19,14 @@ export default function buildPmcs(
>;
const map = mapSettingsList[index];

// Set pmcs hostile to everything
locationList[index].base.BotLocationModifier.AdditionalHostilitySettings =
defaultHostility;

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

let pmcZones = shuffle<string[]>([
...new Set(
Expand All @@ -37,16 +41,14 @@ export default function buildPmcs(
.map(({ BotZoneName, ...rest }) => {
return BotZoneName;
})
),
), ...pmcHotZones
]);

// Make labs have only named zones
if (map === "laboratory") {
pmcZones = new Array(10).fill(pmcZones).flat(1);
}

const { pmcWaveCount } = mapConfig[map];

const escapeTimeLimitRatio = Math.round(
locationList[index].base.EscapeTimeLimit / defaultEscapeTimes[map]
);
Expand All @@ -72,16 +74,44 @@ export default function buildPmcs(

const timeLimit = locationList[index].base.EscapeTimeLimit * 60;

const waves = buildPmcWaves(
totalWaves,
timeLimit,
config,
pmcZones,
pmcHotZones
const half = Math.round(
totalWaves % 2 === 0 ? totalWaves / 2 : (totalWaves + 1) / 2
);

const start = Math.random() > 0.5

const pmcUSEC = buildBotWaves(
half,
config.startingPmcs ? Math.round(0.2 * timeLimit) : timeLimit,
config.pmcMaxGroupSize - 1,
config.pmcGroupChance,
pmcZones.slice(0, Math.round(pmcZones.length / 2)),
config.pmcDifficulty,
"pmcUSEC",
false,
config.pmcWaveDistribution,
start ? -1 : 0
);

const pmcBEAR = buildBotWaves(
half,
config.startingPmcs ? Math.round(0.2 * timeLimit) : timeLimit,
config.pmcMaxGroupSize - 1,
config.pmcGroupChance,
pmcZones.slice(Math.round(pmcZones.length / 2)),
config.pmcDifficulty,
"pmcBEAR",
false,
config.pmcWaveDistribution,
start ? 15 : -1
);





locationList[index].base.BossLocationSpawn = [
...waves,
...pmcUSEC,
...pmcBEAR,
...locationList[index].base.BossLocationSpawn,
];
}
Expand Down
Loading

0 comments on commit 75ae669

Please sign in to comment.