ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Map

From ModEnc
(Redirected from LocalSize)
Jump to navigation Jump to search

The map section contains very important information, that being the size of the map and what theater to render it in. Both size and localsize are specified in measure of cells. Size is the actual size of the map (0,0,Width,Height). Localsize is what you see ingame, the viewable part of the map (Left,Top,ViewableWidth,ViewableHeight). The viewable area specified by Localsize should always be smaller than the actual map size. At least 1 cell surrounding the visible area is needed for reinforcements entering the map. Other factors like unusable cells on map top edge with higher cell heights and space needed for aircrafts to turn etc. should be considered when allocating spaace for LocalSize.

Example code for an urban map:

[Map]
Size=0,0,151,200
Theater=URBAN
LocalSize=3,5,145,189

Notes

(In the following content, when a pair of values appears without explicit specification, it defaults to length x width.)

Maximum map size limit in the game depends on several factors. The smallest of those limit is that of OverlayPack using a fixed 256kb data size to fetch offsets for overlay coordinates in the map. Formula used is:

Overlay offset = (X + (512 * Y))

Because of this, a safe formula is arrived at to get various map sizes, that is:

Max of Width + Height should not be greater than 512.

The largest number of cells in a map with this formula is of a map with size 256x256 (130816 cells).

Number of cells in a map = ((MapWidth * 2) - 1) * MapHeight

Bugs/Side-Effects/Unexpected Limitations

Map editor constraints:

  • For FinalAlert2 (v1.02), both length and width must be within the range of 16 to 200.
  • FinalAlert2YR v2.00 and FinalSun v2.00 allows a max width or height of 400.
  • FA2sp extends this limitation internally. So, the map can be edited in a text editor to set the size based on the formula of Width + Height being less than or equal to 512. On new map creation window, different versions of FA2sp places restrictions as follows:
    • FA2sp (v1.6.2), this range has been changed to 1-256.
    • Patched FA2 and Patched FinalSun allows Width + Height being less than or equal to 512. With minimum width or height of 20 and max width or height of 492.
    • FA2 HDM Edition (v1.1.8), follows the Patched FA2 mentioned above.
  • World-Altering Editor uses a fixed texture size of 16384 for rendering. With RA2/YR cell size of 60x30 pixels, the max supported width of a map is 273. While with TS cell size of 48x24 pixels, the max supported width of a map is 341. And minimum length and width must not be less than 50. And the sum of length and width must not exceed 512.

Although the engine can properly parse the value of Theater= regardless of case, official FinalAlert2 only supports uppercase[1]. FA2sp and World-Altering Editor allows lowercase as well.

Footnotes

  1. This was also a popular protection method in the past, which relied on changing the content of Theater= to lowercase to prevent others from editing the finished map.