Changing Map Size


Original Post


Assuming you want to increase the mapsize, I doubt anyone would want to make it smaller than it already is.
We'll go with an increase in the example ( 640 -> 720 ) and calling it "Carlos Size"

1. data\scripts\dmscript.global

Line 48 : Adjust following values


   gc_idlegrid_mapwidth = 720;
   gc_idlegrid_mapheight = 720;
   gc_idlegrid_countx = 900;//gc_idlegrid_mapwidth*1.25;
   gc_idlegrid_county = 900;//gc_idlegrid_mapheight*1.25;

   gc_scangrid_mapwidth = 720;
   gc_scangrid_mapheight = 720;

   gc_resgrid_mapwidth = 720;
   gc_resgrid_mapheight = 720;

   gc_soundgrid_mapwidth = 720;
   gc_soundgrid_mapheight = 720;

   gc_terraindata_mapwidth = 720;
   gc_terraindata_mapheight = 720;

 

Line 125

   gc_MaxMapWidth = 720;
   gc_MaxMapHeight = 720;

 

2. data\scripts\common.inc\dogenerate.inc

Line 430
       [*] = ;   const cMapSize = 720;

Line 1298

[*] = ;if (mapW<>720) or (mapH<>720) then
[*] = ;   var modifier : Float = (720/((mapW+mapH)/2));

 

3. data\scripts\common.inc\generatemap.inc
Line 618

      [*] = ;   const cWaterMapArrSize = (720 div cWaterFieldSize);
 

Line 657

[*] = ;   var mapsizemod : Float = (cWaterMapArrSize/((720/mapheight)*2))*cWaterFieldSize; // var mapsizemod : Float = (cWaterMapArrSize div ((720 div mapheight)*2))*cWaterFieldSize;

Line 684

       [*] = ;   var tmpPatternMask : array [0..720-1] of array [0..720-1] of Boolean;
 

4. data\scripts\common.inc\postprocess.inc
Line 35

      [*] = ;var mask : array [0..720-1] of array [0..720-1] of TColor;
      [*] = ;var maskTmp : array [0..720-1] of array [0..720-1] of TColor;

 

5. data\scripts\common.inc\smoothtiles.inc
Line 27

      [*] = ;var atilemap : array [0..720] of array [0..720] of Integer;
 

6. data\scripts\lib\misc.script
Line 3260

procedure _misc_StandPatternPlaceMask(patName : String; standX, standZ, angle : Float; var tmpPatternMask : array [0..719] of array [0..719] of Boolean);
 

7. gui\menu.inc\donewgame.inc
Line 6

       [*] = ;const cMapSize = 720;
 

Line 36

      [*] = ;case gMap.settings.gen.mapsize of
      [*] = ;   0 : genMapSize := 320;
      [*] = ;   1 : genMapSize := 480;
      [*] = ;   2 : genMapSize := 640;
      [*] = ;   3 : genMapSize := 720;
      [*] = ;   else
      [*] = ;   genMapSize := 320;
      [*] = ;end;

 

8. gui\menu.inc\showcustomgame.inc
Line 124

      [*] = ;procedure FillComboBoxMapSize(elmHnd : Integer);
      [*] = ;begin
      [*] = ;   var cTextSizeNormal, cTextSizeLarge, cTextSizeHuge, CTextSizeCarlosSized : String;
      [*] = ;   _misc_GetNewTextLocale('map.size.normal', cTextSizeNormal);
      [*] = ;   _misc_GetNewTextLocale('map.size.large', cTextSizeLarge);
      [*] = ;   _misc_GetNewTextLocale('map.size.huge', cTextSizeHuge);
      [*] = ;   _misc_GetNewTextLocale('map.size.carlossize', cTextSizeCarlosSized);
      [*] = ;   var i : Integer;
      [*] = ;   if (GetGUIListBoxItemsCount(elmHnd)=0) then
      [*] = ;   begin
      [*] = ;      GUIListBoxAddItem(elmHnd, cTextSizeNormal, 0);
      [*] = ;      GUIListBoxAddItem(elmHnd, cTextSizeLarge, 1);
      [*] = ;      GUIListBoxAddItem(elmHnd, cTextSizeHuge, 2);
      [*] = ;      GUIListBoxAddItem(elmHnd, cTextSizeCarlosSized, 3);
      [*] = ;      SetGUIListBoxItemIndexSilent(elmHnd, 0);
      [*] = ;   end;
      [*] = ;end;

 

9. Localisation.
Mapsize strings for english are in /data/locale/needloc/new.lng
Other languages in /data/locale/xx/new.lng
See to guide about random map options or the language editor tool how to use Language editor.
Add string:

map.size.carlossize     Carlos Size

Note: Scrollbar or not.
10. gui\menu.inc\showcustomgame.inc
Line 552
No scroll bar :

      [*] = ;elmHnd := _gui_CreateComboBox('mapsize', elmMain, 4, 0, gc_halParentLeft, gc_valParentTop, 805+cAddOffsetL, 103+ind*cOffY, 145, gc_halLeft, gc_valMiddle, 5, 0, gc_font_serif_12, bAllowChange, eventstate, bupdate, True);

Scrollbar :

      [*] = ;elmHnd := _gui_CreateComboBox('mapsize', elmMain, 3, 0, gc_halParentLeft, gc_valParentTop, 805+cAddOffsetL, 103+ind*cOffY, 145, gc_halLeft, gc_valMiddle, 5, 0, gc_font_serif_12, bAllowChange, eventstate, bupdate, True);
 

 
Without scroll bar for this option is better I think.

Took a long time to generate the map, because of the size. Especially the forest stage. I hope you have a good computer.
I didn't thoroughly test this, it's very well possible I forgot to change something somewhere, but it works on first glance.