25 lines
1.1 KiB
JavaScript
25 lines
1.1 KiB
JavaScript
// Tuning constants for the world map view.
|
|
|
|
export const RESYNC_HOURS = 0.75;
|
|
export const PREDICTION_GRACE_HOURS = 2.0;
|
|
export const DRAG_THRESHOLD = 5;
|
|
export const ZOOM_MIN = 0.2;
|
|
export const ZOOM_MAX = 2.0;
|
|
|
|
// A battle spreads the two stacks to either side of the tile centre, with the
|
|
// battle icon between them. Side offset is in pixels; step is the spacing
|
|
// between the (half-size) units of one stack.
|
|
export const BATTLE_SIDE_OFFSET = 15;
|
|
export const BATTLE_STACK_STEP = 9;
|
|
|
|
// The detailed view is built from square blocks of tiles. Only the blocks that
|
|
// intersect the viewport (plus CHUNK_MARGIN blocks of slack on every side) are
|
|
// materialised, so panning costs the same no matter how big the map is. Tiles
|
|
// are pooled and recycled as blocks leave the view.
|
|
export const CHUNK_SIZE = 8;
|
|
export const CHUNK_MARGIN = 1;
|
|
// Built chunks are kept detached in an LRU cache so panning back over ground
|
|
// already visited reattaches them instead of rebuilding hundreds of tiles. The
|
|
// cap bounds how many detached tile nodes can be held at once.
|
|
export const CHUNK_CACHE_LIMIT = 160;
|