1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00
tobspr_shapez.io/src/js/core/config.js

118 lines
3.0 KiB
JavaScript
Raw Normal View History

2020-05-09 14:45:23 +00: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 08:25:00 +00:00
// Production analytics
2020-05-13 16:04:51 +00:00
statisticsGraphDpi: 2.5,
statisticsGraphSlices: 100,
2020-05-14 08:25:00 +00:00
analyticsSliceDurationSeconds: 10,
2020-05-13 16:04:51 +00:00
2020-05-09 14:45:23 +00:00
// [Calculated] physics step size
physicsDeltaMs: 0,
physicsDeltaSeconds: 0,
// Update physics at N fps, independent of rendering
// physicsUpdateRate: 55,
physicsUpdateRate: 120,
2020-05-09 14:45:23 +00:00
// Map
mapChunkSize: 32,
mapChunkPrerenderMinZoom: 1.3,
2020-05-09 14:45:23 +00:00
mapChunkOverviewMinZoom: 0.7,
// Belt speeds
// NOTICE: Update webpack.production.config too!
2020-05-17 14:02:59 +00:00
beltSpeedItemsPerSecond: 2,
2020-05-09 14:45:23 +00:00
itemSpacingOnBelts: 0.63,
minerSpeedItemsPerSecond: 0, // COMPUTED
2020-05-16 21:48:56 +00:00
undergroundBeltMaxTilesByTier: [5, 8],
2020-05-09 14:45:23 +00:00
buildingSpeeds: {
2020-05-11 21:42:10 +00:00
cutter: 1 / 4,
2020-05-16 22:21:33 +00:00
cutterQuad: 1 / 4,
2020-05-11 12:21:59 +00:00
rotater: 1 / 1,
2020-05-16 21:13:45 +00:00
rotaterCCW: 1 / 1,
painter: 1 / 6,
painterDouble: 1 / 7,
painterQuad: 1 / 7,
mixer: 1 / 5,
stacker: 1 / 6,
2020-05-09 14:45:23 +00:00
},
// 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-17 12:46:33 +00:00
noArtificialDelays: true,
2020-05-14 19:54:11 +00:00
// disableSavegameWrite: true,
2020-05-09 14:45:23 +00:00
showEntityBounds: false,
showAcceptorEjectors: false,
usePlainShapeIds: true,
2020-05-14 19:54:11 +00:00
disableMusic: true,
2020-05-09 14:45:23 +00:00
doNotRenderStatics: false,
disableZoomLimits: false,
showChunkBorders: false,
rewardsInstant: false,
allBuildingsUnlocked: true,
2020-05-09 14:45:23 +00:00
upgradesNoCost: true,
2020-05-17 12:46:33 +00:00
disableUnlockDialog: true,
2020-05-17 10:46:51 +00:00
// testTranslations: true,
2020-05-09 14:45:23 +00: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 18:06:50 +00:00
// Analytics key
analyticsApiKey: "baf6a50f0cc7dfdec5a0e21c88a1c69a4b34bc4a",
2020-05-09 14:45:23 +00: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 / 5;