Skip to content

Commit

Permalink
Spawn update
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewgdewar committed Feb 6, 2025
1 parent 7ab2a33 commit f284544
Show file tree
Hide file tree
Showing 7 changed files with 1,053 additions and 111 deletions.
210 changes: 210 additions & 0 deletions src/SpawnZoneChanges/CoopUUIDS.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
export const CoopUUIDS = [
"8b301a0d-e694-4f24-b938-32329a5084f5",
"ddca1267-6caa-4986-bd13-0ed29a81e6d2",
"9dd4bcc0-062e-45a4-9346-2b488ed4ad72",
"c8b04f3f-1f80-49a7-8530-3180b3ff71e9",
"b96df3dc-23f2-4e1d-8a9a-9fbe05a94f47",
"4f865c11-d533-4fce-9833-fe41a6cb52af",
"b0126d65-ba76-45ad-b25e-32f4f3509904",
"62f5b14d-cb51-4529-b572-f5a8f5815bb5",
"f61dc8f4-8ab8-4a1b-9771-8c4d26568769",
"10a75815-d786-43e2-9639-6b94071433f8",
"181f7000-df70-4bc7-bff3-a709291c907f",
"c36b37b1-e654-45b8-a921-4864d1a325a4",
"5caf5e1b-0113-41fc-9867-007e37ffe906",
"3b54601a-2e4b-4991-988e-962f1ee45668",
"fd6734ed-6ba8-423b-8a7b-2943f31c6527",
"b049c6f8-afb9-42f9-9591-2f265fef2097",
"287bf35f-5cdc-44dc-97b6-c035d5054bfa",
"4fb0d413-cf19-4580-8217-b2d6ca431e91",
"97185451-3b24-4e74-baa1-6a706f09c520",
"daaa4a02-1f51-460b-bdf8-29b3bd2c838b",
"3dd5759f-3764-491f-be62-82f2db15a699",
"d2bc609f-cfaf-421a-8a02-a535e2b25d35",
"99840da7-52c4-4f5f-832e-c705e9d07572",
"35e7edfa-5d6c-4512-b3f0-ebb823e076de",
"3f0277ba-5d1f-4e3d-b763-234a33b904e3",
"2875ed6d-0a92-4473-b641-0616a69f6388",
"d685da1e-6b1e-45fb-8e31-e3a42a382fed",
"0e95dd99-d6b7-4562-9813-74d4da9aaf6f",
"d7fc05a2-a7d9-494a-af5c-e092bb560bb9",
"bc1a8dad-c186-4238-9340-90ac952050e6",
"3eed3347-ac2d-429b-870e-6e6bc076e05e",
"105e5c93-2399-4054-b31d-ec981a66491f",
"f8efba5d-56be-4091-b537-c97e88b031f2",
"d7e47ba9-1862-4070-95de-9a9b2f0e46ff",
"2984a7ec-f10b-42a8-b466-554f37f9ea3e",
"5f9f188b-8489-4c06-ae14-ba4ca2a46028",
"af54940c-1d1c-4281-a44d-cb2cf46e436b",
"e33e5a4b-4c9e-46f9-b1df-5e9281746f58",
"acdd7189-0c4b-4be6-9e6e-57dbca0f6212",
"68f38db1-e55e-4170-9e79-1f9e34e8cdc5",
"e6fb5fd6-dff6-4af0-bc35-7c4d8dd198fc",
"deea2fb8-334a-4327-8e1e-a520140ac51e",
"69378f13-ba17-464e-8875-618e6219d7e5",
"e4f280f7-ba13-4fa1-83ec-fac99e8f66b5",
"b09e235d-d504-4607-843f-b8286c3dbd62",
"ab6dee85-93f5-45cb-a910-1ccd06e604ad",
"e48a6b22-ef3f-4c2b-96ef-1a36803af60d",
"9f04fd7f-bc63-4641-8373-ac41edfc16de",
"d2da7554-3689-481c-9e29-4c55f4ba50cb",
"850f44fe-ea49-4c84-91b3-5f31c6b14c5f",
"e46cc7ed-cb3b-46cf-a822-ecca3fc36638",
"319279a1-ec16-4d6e-8c87-3382938823f7",
"eeafbe43-88fa-4755-8c10-d5815528838d",
"1aaa922d-7f31-433a-8457-075f9886600b",
"dd6a29b3-46ab-4b43-a64d-a556342cc243",
"e05ef34f-8247-44aa-95a9-fc5085998045",
"1baafdd1-e250-453c-94b3-f842c87f4b8a",
"f997caf2-a40d-457c-ae98-20b17660a5aa",
"cec41a3d-7939-4d43-8c64-36b1aed8818f",
"a6fd8d7e-1bd3-4a41-8589-b3f0c35eb87c",
"9ec89724-0285-4ffc-9ba7-0e1b0912410c",
"69bb5762-c2a6-45f2-98f3-7e6e04f22245",
"17f6bc8e-2843-4b8b-90c4-f9b1cffadce3",
"93118e0f-24e6-46dd-8223-fca47e775ce8",
"798903d9-e63e-4885-aae0-3cd32de508b7",
"a546535d-6b7e-40e7-a237-f03a7858ae64",
"73efe9a1-529b-4688-97da-d691e0bfd343",
"8afc43bd-7cad-4407-b895-0a87de14dfaf",
"06766669-aece-4c12-a0a5-9db4413ffad3",
"88981068-2dad-4362-9c88-4eb5f0eee96f",
"56ab3b71-89a9-482d-8d61-585c05368f61",
"fada2feb-2f5c-47b1-af58-5aa3f498d99b",
"8c12ace2-3af3-4d5a-a4aa-0895a4ef8a56",
"3403518f-cdf5-4b64-befe-d322a6507694",
"2788bad0-51b8-4596-954d-11dc5b2edefa",
"1a64d7c0-9d68-496b-9461-78cf140ac306",
"81423963-a10b-4474-947a-daa1e5e91a8d",
"6c13f76e-e938-47f2-a048-5105b403202a",
"f5e70152-8845-44bf-94c0-d586cac03006",
"7c08bad0-3e16-4919-a882-4f261159d2cb",
"b45226b7-f530-423d-a079-427ce52e3fb3",
"d27c7203-8b21-415d-8244-dc416ed63d20",
"63219eb1-d0c8-4c56-9b20-9202abbc8a9b",
"63219eb1-d0c8-4c56-9b20-9202abbc8a9b",
"289db12e-94af-42ab-ac89-0828b8d58709",
"4ef7931f-d559-4ad2-a850-8c53ff038651",
"853a88d5-ecf3-4131-aa49-bfd53a45e627",
"e0048716-f08b-4594-9d5c-340d17b7f2a6",
"966f9ec5-32c5-4576-8940-430821816f51",
"bf2409cf-36b1-45f6-a891-711cfc4b8301",
"64cc034d-d5b6-4d6b-8f9c-cb50175004de",
"b425c6d9-ccac-451d-a859-7c0ac171e618",
"15b6e485-67c8-4d29-837b-c1d5576684a9",
"b9725c82-b56b-4399-a5a0-af96fe5be188",
"0741db23-e8c9-474a-8c0b-ec7e6f5ebe78",
"854ea99d-9c9a-4155-ba38-a3fb3f42226a",
"14b54bc4-64b6-4d9f-b21f-ec4d00ea12c4",
"fa5ad796-2cff-460c-9162-6b44dbdd0441",
"18381674-3e66-4089-848f-f58600be9689",
"c82f1789-7941-4205-b547-280c23a2ebd5",
"7df08a3e-3488-4077-8bec-48eac7903934",
"f453c38d-5bad-44d7-b71c-7c7bad6b3e70",
"dcc98552-3235-46e4-bd1f-409af32b50cf",
"db36d732-053f-48be-b73c-b1a7fbe23514",
"68091dec-b042-4e80-9caf-b6a9e8a43877",
"7214a6f6-1ad5-4a25-98d4-5fc92559d599",
"b2970193-779c-4598-a2d2-0a474afec06c",
"2fdbfe41-bd5c-446b-80a8-8681f926ab94",
"6646be81-5f8c-4c2d-bb8f-cb148c0c6fae",
"fa7869a2-8896-4414-ba7d-60a7c95bd1a8",
"8799bb42-bc67-4556-94fb-c5a401efb5b3",
"f96f3b5d-2aae-4238-adac-0af4d71b97fa",
"ea3ee12f-63bf-40b0-86b2-d73e575e6b38",
"10b98bcc-fa01-4045-9de1-31a89b9d2c24",
"124b1a0f-28da-4de3-b2f6-bfd60da6e44a",
"52d32a54-836d-4b78-b2d7-6ec797c3bde8",
"4dca4f98-d5b5-4f2f-9976-4e19f4b3479b",
"c23035da-dbd1-4bde-b90f-9b809215ee57",
"da2f58e2-3e97-4830-aa08-2d1902c88943",
"a02f1065-8639-4738-afa0-9a031c18912f",
"977b34cf-397f-4ec9-a2b0-f7bbf67284ed",
"44370e95-5bec-4943-8de1-e53beaa8e758",
"11ce34bc-53bb-4a1b-83d5-140043008d80",
"d72a6e26-6f13-4e56-b902-a50465fd844b",
"7bd68d2b-39aa-4eef-a98a-5394fc63eed7",
"da8bcf91-a3cd-49f2-bddf-d70ae9ccee96",
"7214a6f6-1ad5-4a25-98d4-5fc92559d599",
"ba72e3de-9971-429d-9235-3f1803bb9a4a",
"54093830-8555-41f4-929f-2faa687aedd7",
"7c5203e0-f239-41b6-be4e-93366faaf857",
"6a9699f3-46c0-4c72-bcb0-2075ffe2a777",
"92163c32-233b-42a0-ba3a-be10554ac266",
"2231842f-d5f9-411a-ab01-02072fb11297",
"ddad0594-dea6-446e-8b1e-1de3b7f43677",
"61421812-9ef3-4ca3-88bb-ca526149814d",
"5deae6e8-5819-4896-a198-3e5b42e3e863",
"594acb82-cc88-43b0-bff1-0199e4195afb",
"0f334893-a01d-44f4-a684-0040c05f7029",
"a59d52cb-e92a-4e80-9000-eb2211045742",
"2912d83e-b7a3-404e-8cc2-5a801c64e524",
"382b4a79-0a0f-4242-b444-0bdaf7f1b52b",
"13b9c174-67fb-4657-a020-34bd04140295",
"da7f0704-9a32-4743-9249-c0d140624733",
"f7d9fd21-aa76-4c4f-ac8e-5019ad44fbed",
"f79c4cad-9e70-4da7-bae8-19c2ff9bd403",
"c5d9e312-8420-4e93-895b-edb98bd378e2",
"d3134c35-d002-4460-8770-4521bff63908",
"aa0a2c1f-ad7d-4109-b629-1007e8b0698c",
"8b301a0d-e694-4f24-b938-32329a5084f5",
"ddca1267-6caa-4986-bd13-0ed29a81e6d2",
"9dd4bcc0-062e-45a4-9346-2b488ed4ad72",
"c8b04f3f-1f80-49a7-8530-3180b3ff71e9",
"b96df3dc-23f2-4e1d-8a9a-9fbe05a94f47",
"4f865c11-d533-4fce-9833-fe41a6cb52af",
"b0126d65-ba76-45ad-b25e-32f4f3509904",
"62f5b14d-cb51-4529-b572-f5a8f5815bb5",
"f61dc8f4-8ab8-4a1b-9771-8c4d26568769",
"10a75815-d786-43e2-9639-6b94071433f8",
"181f7000-df70-4bc7-bff3-a709291c907f",
"c36b37b1-e654-45b8-a921-4864d1a325a4",
"5caf5e1b-0113-41fc-9867-007e37ffe906",
"3b54601a-2e4b-4991-988e-962f1ee45668",
"fd6734ed-6ba8-423b-8a7b-2943f31c6527",
"b049c6f8-afb9-42f9-9591-2f265fef2097",
"287bf35f-5cdc-44dc-97b6-c035d5054bfa",
"4fb0d413-cf19-4580-8217-b2d6ca431e91",
"97185451-3b24-4e74-baa1-6a706f09c520",
"daaa4a02-1f51-460b-bdf8-29b3bd2c838b",
"8b301a0d-e694-4f24-b938-32329a5084f5",
"ddca1267-6caa-4986-bd13-0ed29a81e6d2",
"9dd4bcc0-062e-45a4-9346-2b488ed4ad72",
"c8b04f3f-1f80-49a7-8530-3180b3ff71e9",
"b96df3dc-23f2-4e1d-8a9a-9fbe05a94f47",
"4f865c11-d533-4fce-9833-fe41a6cb52af",
"b0126d65-ba76-45ad-b25e-32f4f3509904",
"62f5b14d-cb51-4529-b572-f5a8f5815bb5",
"f61dc8f4-8ab8-4a1b-9771-8c4d26568769",
"10a75815-d786-43e2-9639-6b94071433f8",
"181f7000-df70-4bc7-bff3-a709291c907f",
"c36b37b1-e654-45b8-a921-4864d1a325a4",
"5caf5e1b-0113-41fc-9867-007e37ffe906",
"3b54601a-2e4b-4991-988e-962f1ee45668",
"fd6734ed-6ba8-423b-8a7b-2943f31c6527",
"b049c6f8-afb9-42f9-9591-2f265fef2097",
"287bf35f-5cdc-44dc-97b6-c035d5054bfa",
"4fb0d413-cf19-4580-8217-b2d6ca431e91",
"97185451-3b24-4e74-baa1-6a706f09c520",
"daaa4a02-1f51-460b-bdf8-29b3bd2c838b",
"d1b3cb3f-042c-4698-9284-9cb3985eca30",
"0043f275-0dc2-4c04-87a1-bd90cbaf183a",
"effc8ec3-29a6-4531-89eb-a23ab350d015",
"f9ba0574-638b-4900-874c-21b6f4d5e6b4",
"ddcd040c-42b2-4586-879d-f9d07d9737ce",
"22c00064-df0c-474b-b479-918175a539a7",
"19383115-da70-4cc5-8ab7-d80bf8045113",
"9ae1736f-4869-4c3b-99c2-5825878573d8",
"8804ccce-fc0a-488f-9a50-12837e382ae9",
"c59b04c4-0ceb-4af0-851e-2f81a7a02c02",
"863a8fba-0b54-4c06-9a4e-498298c7f938",
"7859f63b-aff6-4bb5-9423-1fc08f2120b9",
"c7f058cd-cff0-4f4b-9bf1-dc6632c63eaf",
"04ca5c72-7c54-43cf-9150-6ddcaedf9808",
"9896b358-7857-4dfc-baba-c9ff10f4b288",
"832a9963-7ad2-436b-8140-9d52d113afba",
"af9b450f-11df-4411-b92b-4df4ecc7504b",
"9781bf62-5817-49c8-91f5-e1718080f43c",
"a35626aa-d89e-4ace-8bff-5b7582f6bc30",
"d385b5f5-d5c6-4f6a-9486-e128cbba2da6",
];
72 changes: 52 additions & 20 deletions src/SpawnZoneChanges/setupSpawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { saveToFile } from "../utils";
import { Ixyz } from "@spt/models/eft/common/Ixyz";
import { BotSpawns } from "../Spawns";
import { updateAllBotSpawns } from "../Spawns/updateUtils";
import { CoopUUIDS } from "./CoopUUIDS";

export const setupSpawns = (container: DependencyContainer) => {
const databaseServer = container.resolve<DatabaseServer>("DatabaseServer");
Expand All @@ -26,6 +27,12 @@ export const setupSpawns = (container: DependencyContainer) => {

const botSpawnHash = BotSpawns;

const mapsToExcludeFromPlayerCulling = new Set([
"factory4_day",
"factory4_night",
"laboratory",
]);
const CoopUUIDSet = new Set(CoopUUIDS);
originalMapList.forEach((map, mapIndex) => {
const allZones = [
...new Set(
Expand All @@ -38,9 +45,10 @@ export const setupSpawns = (container: DependencyContainer) => {
locations[map].base.OpenZones = allZones.join(",");

let bossSpawn: ISpawnPointParam[] = [];
let nonBossSpawns: ISpawnPointParam[] = [];
let scavSpawns: ISpawnPointParam[] = [];
let sniperSpawnSpawnPoints: ISpawnPointParam[] = [];
let coopSpawns: ISpawnPointParam[] = [];
let pmcSpawns: ISpawnPointParam[] = [];

const bossZoneList = new Set([
"Zone_Blockpost",
Expand All @@ -55,6 +63,7 @@ export const setupSpawns = (container: DependencyContainer) => {
"BotZoneGate2",
"BotZoneBasement",
]);

const isGZ = map.includes("sandbox");
shuffle<ISpawnPointParam[]>(locations[map].base.SpawnPointParams).forEach(
(point) => {
Expand All @@ -69,18 +78,25 @@ export const setupSpawns = (container: DependencyContainer) => {
sniperSpawnSpawnPoints.push(point);
break;

case point.Categories.includes("Player") && // (point.Categories.includes("Coop") || )
case mapsToExcludeFromPlayerCulling.has(map) && // point.Categories.includes("Coop") && // (point.Categories.includes("Coop") || )
point.Categories.includes("Player") &&
!!point.Infiltration:
coopSpawns.push(point);
break;

case (point.Categories.includes("Coop") ||
point.Categories.includes("Player") ||
CoopUUIDSet.has(point.Id)) &&
!!point.Infiltration:
pmcSpawns.push(point);
break;
default:
nonBossSpawns.push(point);
scavSpawns.push(point);
break;
}
}
);

// console.log(map, coopSpawns.length);
// fix GZ
if (isGZ) {
sniperSpawnSpawnPoints.map((point, index) => {
Expand All @@ -105,11 +121,9 @@ export const setupSpawns = (container: DependencyContainer) => {

const limit = mapConfig[configLocations[mapIndex]].spawnMinDistance;

coopSpawns = cleanClosest(
AddCustomPlayerSpawnPoints(coopSpawns, map),
mapIndex,
true
)
coopSpawns = AddCustomPlayerSpawnPoints(coopSpawns, map, pmcSpawns);

coopSpawns = cleanClosest(coopSpawns, mapIndex, true)
.map((point, index) => {
if (point.ColliderParams?._props?.Radius < limit) {
point.ColliderParams._props.Radius = limit;
Expand All @@ -127,22 +141,37 @@ export const setupSpawns = (container: DependencyContainer) => {
.filter((point) => {
// Now we transfer the extra spawns to the bots
// if (!point.Categories.length) {
// nonBossSpawns.push(point);
// scavSpawns.push(point);
// }
return !!point.Categories.length;
});

if (advancedConfig.ActivateSpawnCullingOnServerStart) {
botSpawnHash[map] =
removeClosestSpawnsFromCustomBots(
nonBossSpawns,
scavSpawns,
map,
configLocations[mapIndex]
) || [];
}

nonBossSpawns = cleanClosest(
AddCustomBotSpawnPoints(nonBossSpawns, map),
pmcSpawns = cleanClosest(pmcSpawns, mapIndex).map((point) => {
if (point.ColliderParams?._props?.Radius < limit) {
point.ColliderParams._props.Radius = limit;
}
return !!point.Categories.length
? {
...point,
BotZoneName: isGZ ? "ZoneSandbox" : point?.BotZoneName || "",
Categories: ["Coop", Math.random() > 0.5 ? "Group" : "Opposite"],
Sides: ["Pmc"],
CorePointId: 0,
}
: point;
});

scavSpawns = cleanClosest(
AddCustomBotSpawnPoints(scavSpawns, map),
mapIndex
).map((point) => {
if (point.ColliderParams?._props?.Radius < limit) {
Expand All @@ -168,23 +197,26 @@ export const setupSpawns = (container: DependencyContainer) => {
indexedMapSpawns[mapIndex] = [
...sniperSpawnSpawnPoints.map((point) => ({ ...point, type: "sniper" })),
...bossSpawn.map((point) => ({ ...point, type: "boss" })),
...nonBossSpawns.map((point) => ({ ...point, type: "nonBoss" })),
...scavSpawns.map((point) => ({ ...point, type: "scav" })),
...coopSpawns.map((point) => ({ ...point, type: "coop" })),
...pmcSpawns.map((point) => ({ ...point, type: "pmc" })),
];

// const added = indexedMapSpawns[mapIndex].filter(
// ({ BotZoneName }) => BotZoneName?.slice(0, 6) === "Added_"
// );
// console.log(
// map,
// "sniperSpawnSpawnPoints",
// sniperSpawnSpawnPoints.length,
// "bossSpawn",
// "boss",
// bossSpawn.length,
// "nonBossSpawns",
// nonBossSpawns.length,
// "coopSpawns",
// coopSpawns.length
// "scav",
// scavSpawns.length,
// "coop",
// coopSpawns.length,
// "pmc",
// pmcSpawns.length,
// map
// );

//;
Expand Down
4 changes: 2 additions & 2 deletions src/Spawning/buildPmcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export default function buildPmcs(

let pmcZones = getSortedSpawnPointList(
locationList[index].base.SpawnPointParams.filter(
(point) => point["type"] === "nonBoss"
).filter((_, sIndex) => sIndex % 3 === 0),
(point) => point["type"] === "pmc"
),
x,
y,
z,
Expand Down
Loading

0 comments on commit f284544

Please sign in to comment.