Changes between Initial Version and Version 2 of Ticket #4034


Ignore:
Timestamp:
Oct 5, 2017, 4:09:39 PM (6 years ago)
Author:
elexis
Comment:

The simulation components are initialized prior to the map generator. So we can simply add getters to the map generator JS interface in MapGenerator.cpp.

MAP_BORDER_WIDTH is a special case because the simulation doesn't have a central place for this yet and instead hardcodes that magic number all over the place, see #4636.

Other components like simulation/UnitAI/PlayerAI, Atlas might also need some parameters so further comments welcome!

For the simulation people already take care not to copy magic numbers and it's easy to access C++ simulation constants from JS simulation components. Not aware of any existing hardcodings in the JS sim.

For atlas, we have

tools/atlas/AtlasUI/ScenarioEditor/Tools/PlaceObject.cpp:static float g_DefaultAngle = (float)(M_PI*3.0/4.0);

Not aware of any other atlas hardcodings. (One might or might not argue it doesn't have to be the same default angle for atlas and random maps.)

the direction changed, see ​map.js getMapData

Don't see anything changing angles there. Edit: it's in getFullEntityList

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4034

    • Property Component Core engineMaps
    • Property Summary Give some engine parameters to JavaScript shared functionsExpose engine constants to random map libraries
    • Property Priority Nice to HaveShould Have
    • Property Milestone BacklogAlpha 23
    • Property Owner set to elexis