Expose engine constants to random map libraries
|Reported by:||FeXoR||Owned by:|
Description (last modified by )
As for example random maps need to take into account some engine parameters it would be nice if some would be added to globalscripts e.g. in a file
EngineParameters.js in an dictionary like object
The following parameters are needed by random maps (Most of them allready found at the beginning of library.js):
- CELL_SIZE = 4 (The width of a terrain texture tile in horizontal engine space units)
- HEIGHT_UNITS_PER_METRE = 92 (The number of vertical engine space units matching a horizontal engine space unit)
- MAX_HEIGHT_RANGE = 0xFFFF / HEIGHT_UNITS_PER_METRE (The maximum value for vertical engine space in horizontal engine space units)
- MAP_BORDER_WIDTH = 3 (The width in )
NOTE: Any space unit will do if the scaling is given as well.
Some other parameters would be nice to also have access to but I'm not sure if they are engine parameters or set in the mods:
- MIN_MAP_SIZE = 128 (The map width of the smallest map as chosable in mapsetup/Atlas in terrain tiles)
- MAX_MAP_SIZE = 512 (Same just the largest chosable map size)
- BUILDING_ORIENTATION = - PI / 4 (The placement angle buildings should be placed by default. For random maps it's rotated and the direction changed, see map.js
Other components like simulation/UnitAI/PlayerAI, Atlas might also need some parameters so further comments welcome!
This is basically for reducing hardcoding the same things at multiple places. However, it's also quite vital for mods if build from scratch.
Change History (13)
comment:1 by , 4 years ago
comment:2 by , 3 years ago
|Component:||Core engine → Maps|
|Milestone:||Backlog → Alpha 23|
|Priority:||Nice to Have → Should Have|