shapez/src/js/core/config.js

116 lines
2.9 KiB
JavaScript
Raw Normal View History

2020-05-09 16:45:23 +02:00
export const IS_DEBUG =
G_IS_DEV &&
typeof window !== "undefined" &&
window.location.port === "3005" &&
(window.location.host.indexOf("localhost:") >= 0 || window.location.host.indexOf("192.168.0.") >= 0) &&
window.location.search.indexOf("nodebug") < 0;
const smoothCanvas = true;
export const globalConfig = {
// Size of a single tile in Pixels.
// NOTICE: Update webpack.production.config too!
tileSize: 32,
halfTileSize: 16,
// Which dpi the assets have
assetsDpi: 192 / 32,
assetsSharpness: 1.2,
shapesSharpness: 1.4,
2020-05-14 10:25:00 +02:00
// Production analytics
2020-05-13 18:04:51 +02:00
statisticsGraphDpi: 2.5,
statisticsGraphSlices: 100,
2020-05-14 10:25:00 +02:00
analyticsSliceDurationSeconds: 10,
2020-05-13 18:04:51 +02:00
2020-05-09 16:45:23 +02:00
// [Calculated] physics step size
physicsDeltaMs: 0,
physicsDeltaSeconds: 0,
// Update physics at N fps, independent of rendering
// physicsUpdateRate: 55,
physicsUpdateRate: 120,
2020-05-09 16:45:23 +02:00
// Map
mapChunkSize: 32,
mapChunkPrerenderMinZoom: 1.3,
2020-05-09 16:45:23 +02:00
mapChunkOverviewMinZoom: 0.7,
// Belt speeds
// NOTICE: Update webpack.production.config too!
2020-05-16 23:01:26 +02:00
beltSpeedItemsPerSecond: 5,
2020-05-09 16:45:23 +02:00
itemSpacingOnBelts: 0.63,
minerSpeedItemsPerSecond: 0, // COMPUTED
2020-05-16 23:48:56 +02:00
undergroundBeltMaxTilesByTier: [5, 8],
2020-05-09 16:45:23 +02:00
buildingSpeeds: {
2020-05-11 23:42:10 +02:00
cutter: 1 / 4,
2020-05-11 14:21:59 +02:00
rotater: 1 / 1,
2020-05-16 23:13:45 +02:00
rotaterCCW: 1 / 1,
2020-05-09 16:45:23 +02:00
painter: 1 / 3,
painterDouble: 1 / 3,
2020-05-09 16:45:23 +02:00
mixer: 1 / 2,
stacker: 1 / 5,
},
// Zooming
initialZoom: 1.9,
minZoomLevel: 0.1,
maxZoomLevel: 3,
// Global game speed
gameSpeed: 1,
warmupTimeSecondsFast: 0.1,
warmupTimeSecondsRegular: 1,
smoothing: {
smoothMainCanvas: smoothCanvas && true,
quality: "low", // Low is CRUCIAL for mobile performance!
},
rendering: {},
debug: {
/* dev:start */
fastGameEnter: true,
2020-05-09 16:45:23 +02:00
noArtificialDelays: true,
2020-05-14 21:54:11 +02:00
// disableSavegameWrite: true,
2020-05-09 16:45:23 +02:00
showEntityBounds: false,
showAcceptorEjectors: false,
usePlainShapeIds: true,
2020-05-14 21:54:11 +02:00
disableMusic: true,
2020-05-09 16:45:23 +02:00
doNotRenderStatics: false,
disableZoomLimits: false,
showChunkBorders: false,
rewardsInstant: false,
allBuildingsUnlocked: true,
upgradesNoCost: true,
2020-05-14 19:12:58 +02:00
disableUnlockDialog: false,
2020-05-09 16:45:23 +02:00
/* dev:end */
},
// Secret vars
info: {
// Binary file salt
file: "Ec'])@^+*9zMevK3uMV4432x9%iK'=",
// Savegame salt
sgSalt: "}95Q3%8/.837Lqym_BJx%q7)pAHJbF",
2020-05-12 20:06:50 +02:00
// Analytics key
analyticsApiKey: "baf6a50f0cc7dfdec5a0e21c88a1c69a4b34bc4a",
2020-05-09 16:45:23 +02:00
},
};
export const IS_MOBILE = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
// Automatic calculations
globalConfig.physicsDeltaMs = 1000.0 / globalConfig.physicsUpdateRate;
globalConfig.physicsDeltaSeconds = 1.0 / globalConfig.physicsUpdateRate;
globalConfig.minerSpeedItemsPerSecond =
globalConfig.beltSpeedItemsPerSecond / globalConfig.itemSpacingOnBelts / 6;