Skip to content

Commit

Permalink
update build script and qa
Browse files Browse the repository at this point in the history
  • Loading branch information
antihax committed Dec 4, 2022
1 parent 32b2acc commit 15e0876
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 57 deletions.
44 changes: 20 additions & 24 deletions build_json.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const resourceDir = baseDir + "Binaries/Win64/resources/";
const workDir = process.cwd();
const os = require("os");
const serverConfig = helpers.parseJSONFile(baseDir + "ServerGrid.json");
const islandInfo = helpers.parseJSONFile(resourceDir + "islandInfo.json");
const xGrids = serverConfig.totalGridsX;
const yGrids = serverConfig.totalGridsY;
const worldUnitsX = xGrids * serverConfig.gridSize;
Expand Down Expand Up @@ -151,6 +152,7 @@ async function main() {

for (let island in s.islandInstances) {
let cp = s.islandInstances[island];
if (!cp.id) continue;
let i = {
id: cp.id,
worldX: cp.worldX,
Expand All @@ -160,7 +162,8 @@ async function main() {
region: s.hiddenAtlasId,
islandWidth: cp.islandWidth,
islandHeight: cp.islandHeight,
isControlPoint: cp.isControlPoint
isControlPoint: cp.isControlPoint,
islandPoints: islandInfo[cp.id].islandPoints || 0
};
i.sublevels = [];
for (let sl in s.sublevels) {
Expand Down Expand Up @@ -190,6 +193,15 @@ async function main() {
}
}

switch (cp.landNodeKey) {
case "AotD":
i.resources["Bone Chips"] = 1;
break;
case "Industrial":
i.resources["Brimstone"] = 1;
break;
}

// build animal list
let allanimals = new Set();
for (let r in grids[grid].Animals) {
Expand All @@ -201,21 +213,6 @@ async function main() {
gridAnimals.add(animal.name);
allanimals.add(animal.name);
animalcheck.add(animal.name);

// print out special animals, check for changes

let test = {
"animals": [{"name": "Parrot"}, {"name": "Parrot"}, {"name": "Parrot"}],
"gps": [[-9.99740219116211, -29.757213592529297]],
"islandLevelMultiplier": 1.0,
"islandLevelOffset": 0,
"levelLerp": 0.0,
"levelMinOveride": 0,
"levelMultiplier": 1.0,
"levelOffset": 0,
"spawnLimits": [5.0, 80, 45.0]
};
if (animal.name === "Tiger" && animalList.levelOffset < 60 && animalList.spawnLimits[0] > 24) console.log(i.id, grid, animalList.spawnLimits, animal);
}
}
}
Expand Down Expand Up @@ -331,6 +328,7 @@ async function main() {

fs.copyFileSync(resourceDir + "animals.json", "./json/animals.json");
fs.copyFileSync(resourceDir + "items.json", "./json/items.json");
fs.copyFileSync(resourceDir + "islandInfo.json", "./json/islandInfo.json");
fs.copyFileSync(resourceDir + "loottable.json", "./json/loottable.json");
fs.copyFileSync(resourceDir + "structures.json", "./json/structures.json");
fs.writeFileSync("./json/assets.json", JSON.stringify(Array.from(allassets).sort(), null, "\t"));
Expand All @@ -344,7 +342,7 @@ async function main() {
fs.writeFileSync("./json/gridList.json", JSON.stringify(sortObjByKey(gridList), null, "\t"));
fs.writeFileSync("./json/shipPaths.json", JSON.stringify(sortObjByKey(serverConfig.shipPaths), null, "\t"));
fs.writeFileSync("./json/tradeWinds.json", JSON.stringify(sortObjByKey(serverConfig.tradeWinds), null, "\t"));
fs.writeFileSync("./json/portals.json", JSON.stringify(sortObjByKey(serverConfig.portalPaths), null, "\t"));
fs.writeFileSync("./json/portals.json", JSON.stringify(sortObjByKey(serverConfig.portalPaths || []), null, "\t"));

let g = graph();
// Pass 1: build nodes and link
Expand All @@ -356,18 +354,16 @@ async function main() {
let lastY;
for (let y = s.gridY * gridSize + gridOffset; y < (s.gridY + 1) * gridSize; y += gridSize / nodesPerAxis) {
let point = [x, y];
let skip = false;
for (let island in s.islandInstances) {
nodeSearch: for (let island in s.islandInstances) {
// skip if the node is inside an island
if (helpers.inside(s.islandInstances[island], point)) {
skip = true;
lastY = undefined;
break;
continue nodeSearch;
}
}
if (skip) continue;
g.addNode(worldToGPS(x, y, gpsBounds).toString(), {});

if (lastY !== undefined) {
// g.addNode(worldToGPS(x, y, gpsBounds).toString(), {});
g.addLink(worldToGPS(x, y, gpsBounds).toString(), worldToGPS(x, lastY, gpsBounds).toString());
g.addLink(worldToGPS(x, lastY, gpsBounds).toString(), worldToGPS(x, y, gpsBounds).toString());
if (x > s.gridX * gridSize + gridOffset * 10)
Expand Down Expand Up @@ -587,7 +583,7 @@ async function main() {
break;
}

g.addNode(destination);
//g.addNode(destination);
g.addLink(origin, destination);
g.addLink(destination, origin);
}
Expand Down
46 changes: 22 additions & 24 deletions qa-json.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
const fs = require("fs");
const execSync = require("child_process").execSync;

const helpers = require("./atlastools/include/helpers.js");
const path = require("./atlastools/include/ngraph.path");
const graph = require("./atlastools/include/ngraph.graph");
const baseDir = "DumpResources/server/ShooterGame/";
const resourceDir = baseDir + "Binaries/Win64/resources/";
const workDir = process.cwd();

const serverConfig = helpers.parseJSONFile(baseDir + "ServerGrid.json");
const xGrids = serverConfig.totalGridsX;
const yGrids = serverConfig.totalGridsY;
const worldUnitsX = xGrids * serverConfig.gridSize;
const worldUnitsY = yGrids * serverConfig.gridSize;

const mapIsland = ["Cay_K_TR_E", "Cay_K_WR", "Cay_K_WR_B", "Cay_L_CL", "Cay_L_CL_B", "Cay_L_EE", "Cay_L_ER", "Cay_L_WR", "Cay_L_WR_B", "Cay_L_CL_B"];

console.log("# Golden Age Islands & No builds");
console.log("## Golden Age Islands & No builds");
console.log("## Should be all trench, GA, Freeports");

for (let server in serverConfig.servers) {
let s = serverConfig.servers[server];

Expand Down Expand Up @@ -43,6 +36,18 @@ for (let server in serverConfig.servers) {
}
}

console.log("\n\n## Nerfed Maps");
for (let server in serverConfig.servers) {
let s = serverConfig.servers[server];

for (let island in s.islandInstances) {
let i = s.islandInstances[island];
if (i.instanceTreasureQualityMultiplier < 1.0 || i.instanceTreasureQualityAddition < 1.0)
console.log(helpers.gridName(s.gridX, s.gridY), i.name, i.instanceTreasureQualityMultiplier, i.instanceTreasureQualityAddition, s.hiddenAtlasId);
}
}


console.log("\n\n## HQ Map Islands");
for (let server in serverConfig.servers) {
let s = serverConfig.servers[server];
Expand All @@ -60,22 +65,22 @@ for (let server in serverConfig.servers) {
let k = s.ServerCustomDatas1.split(",");
let v = s.ServerCustomDatas2.split(",");
for (let i = 1; i < k.length; i++) {
if (k[i] === "SunkenTreasureQualityMultiplier" && v[i] > 1.0) console.log(helpers.gridName(s.gridX, s.gridY), k[i], v[i]);
if (k[i] === "FloatsamQualityMultiplier" && v[i] > 1.5) console.log(helpers.gridName(s.gridX, s.gridY), k[i], v[i]);
if (k[i] === "NPCShipDifficultyMult" && v[i] > 1.5) console.log(helpers.gridName(s.gridX, s.gridY), k[i], v[i]);
//if (k[i] === "SunkenTreasureQualityMultiplier" && v[i] > 1.0) console.log(helpers.gridName(s.gridX, s.gridY), k[i], v[i]);
//if (k[i] === "FloatsamQualityMultiplier" && v[i] > 1.5) console.log(helpers.gridName(s.gridX, s.gridY), k[i], v[i]);
if (k[i] === "NPCShipDifficultyMult" && v[i] > 1.0) console.log(helpers.gridName(s.gridX, s.gridY), k[i], v[i]);
}
}
}

console.log("\n\n## Claimable Islands");
for (let server in serverConfig.servers) {
let s = serverConfig.servers[server];
if (s.forceServerRules !== 3 || s.hiddenAtlasId != "Central Waters") continue;
if (s.forceServerRules !== 3) continue;

for (let island in s.islandInstances) {
let i = s.islandInstances[island];
if (i.name === "ControlPoint" || i.name.startsWith("Ice_")) continue;
if (i.name === "Cay_N_ET" || i.name === "Cay_F_ET") console.log(helpers.gridName(s.gridX, s.gridY), i.name, s.hiddenAtlasId, s.forceServerRules);
console.log(helpers.gridName(s.gridX, s.gridY), i.name, s.hiddenAtlasId, s.forceServerRules);
}
}

Expand All @@ -86,21 +91,14 @@ for (let server in serverConfig.servers) {
if (s.forceServerRules === 3 && s.isHomeServer) console.log(helpers.gridName(s.gridX, s.gridY), s.hiddenAtlasId, s.forceServerRules);
}

console.log("\n\n## No Region");
for (let server in serverConfig.servers) {
let s = serverConfig.servers[server];

if (s.hiddenAtlasId === "Unknown Depths") console.log(helpers.gridName(s.gridX, s.gridY), s.hiddenAtlasId, s.forceServerRules);
}

console.log("\n\n# Land Node Keys");
for (let server in serverConfig.servers) {
let s = serverConfig.servers[server];

for (let island in s.islandInstances) {
let i = s.islandInstances[island];
if (i.landNodeKey === "Industrial") console.log(helpers.gridName(s.gridX, s.gridY), i.landNodeKey, i.name, s.hiddenAtlasId);
if (i.landNodeKey) console.log(helpers.gridName(s.gridX, s.gridY), i.landNodeKey, i.name, s.hiddenAtlasId);
}
}

helpers.sleep(575567);
15 changes: 6 additions & 9 deletions resourceTypes.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"Acai": "Berry",
"Acerolla": "Berry",
"Acerola": "Berry",
"Agate": "Flint",
"Agedwood": "Wood",
"Aloe": "Herb",
"Amarberry": "BAD",
"Amethyst": "Crystal",
Expand Down Expand Up @@ -36,7 +35,6 @@
"Cotton": "Fiber",
"Crude Oil": "Oil",
"Crystal": "Base",
"Darkwood": "Wood",
"Diamond": "Gem",
"Edible Greens": "Vegetable",
"Elderberry": "Berry",
Expand All @@ -63,9 +61,8 @@
"Jute": "Fiber",
"Kala Namak": "Salt",
"Licorice": "Herb",
"Lightwood": "Wood",
"Lignite": "Coal",
"Lignonberry": "Berry",
"Lingonberry": "Berry",
"Lime": "Vegetable",
"Limestone": "Stone",
"Maize": "Vegetable",
Expand Down Expand Up @@ -112,12 +109,10 @@
"Silk": "Fiber",
"Silver": "Metal",
"Slate": "Stone",
"Softwood": "Wood",
"Stimberry": "BAD",
"Stone": "Base",
"Straw": "Fiber",
"Strawberry": "Berry",
"Strongwood": "Wood",
"Sugarcane": "Sugar",
"Sugars": "Sugar",
"Sulfur": "Coal",
Expand All @@ -138,7 +133,6 @@
"Cedar": "Wood",
"Fir": "Wood",
"Ash": "Wood",
"Wetwood": "Wood",
"Wheat": "Vegetable",
"Wheatgrass": "Vegetable",
"Wild Beans": "Vegetable",
Expand Down Expand Up @@ -169,6 +163,9 @@
"Wheat Seed": "Seed",
"Turnip Seed": "Seed",
"Wood": "Base",
"Yarrow": "Herb"
"Yarrow": "Herb",
"Bone Chips": "Transient",
"Brimstone": "Transient"


}

0 comments on commit 15e0876

Please sign in to comment.