All values referring to the same edge (in sections 1-3) should always be changed to the same value, to avoid crashes. I've also included the shape control variables which seem to be edge-related, although I'm not sure if it's needed to change them accordingly (at least, changing them accordingly does not seem to hurt).
1. Map Dimensions: Small
Default values are 0x0D (horizontal edge) and 0x0A (vertical edge).
Code locations:
Code: Select all
Offset hex code asm code
:0043D8B7 B80A000000 mov eax, 0000000A
:0043D8E7 B80D000000 mov eax, 0000000D
:0043DAB9 BA0D000000 mov edx, 0000000D
:0044F5E2 B80A000000 mov eax, 0000000A
:0044F5F9 B80D000000 mov eax, 0000000D
:004AF124 BD32000000 mov ebp, 00000032 // 5 times 0x0A
:004AF129 BA41000000 mov edx, 00000041 // 5 times 0x0D
:004AF14E C70514B35C000D000000 mov dword[005CB314], 0000000D
:004AF17B C70514B35C000D000000 mov dword[005CB314], 0000000D
:004AF1B1 C70514B35C000D000000 mov dword[005CB314], 0000000D
:004AF1EA C70514B35C000D000000 mov dword[005CB314], 0000000D
:004B21C9 C7000D000000 mov dword[eax], 0000000D
:004B21CF C740040A000000 mov dword[eax+04], 0000000A
:004B6BE8 B80D000000 mov eax, 0000000D
:004B6CA0 B80D000000 mov eax, 0000000D
:004B6D5B BB0D000000 mov ebx, 0000000D
:004B6D60 B80A000000 mov eax, 0000000A
:004B6DC8 B80D000000 mov eax, 0000000D
:004B6DE0 BE0A000000 mov esi, 0000000A
:004B7170 BA0D000000 mov edx, 0000000D
:004B7175 B90A000000 mov ecx, 0000000A
Default values are 0x10 (horizontal edge) and 0x0C (vertical edge).
Code locations:
Code: Select all
Offset hex code asm code
:0043D8D3 B80C000000 mov eax, 0000000C
:0043D903 B810000000 mov eax, 00000010
:0043DAF4 BA10000000 mov edx, 00000010
:0044F70D B80C000000 mov eax, 0000000C
:0044F723 B810000000 mov eax, 00000010
:004AF07D BD3C000000 mov ebp, 0000003C // 5 times 0x0C
:004AF082 BF50000000 mov edi, 00000050 // 5 times 0x10
:004AF0AB C70514B35C0010000000 mov dword[005CB314], 00000010
:004B220B C70010000000 mov dword[eax], 00000010
:004B2211 C740040C000000 mov dword[eax+04], 0000000C
:004B6BD3 B810000000 mov eax, 00000010
:004B6C8E B810000000 mov eax, 00000010
:004B6D67 BB10000000 mov ebx, 00000010
:004B6D6C B80C000000 mov eax, 0000000C
:004B6E9E B810000000 mov eax, 00000010
:004B6EB4 BE0C000000 mov esi, 0000000C
:004B7050 BD10000000 mov ebp, 00000010
:004B7055 B80C000000 mov eax, 0000000C
Default values are 0x19 (horizontal edge) and 0x12 (vertical edge).
Code locations:
Code: Select all
Offset hex code asm code
:0043D8CC B812000000 mov eax, 00000012
:0043D8FC B819000000 mov eax, 00000019
:0043DAED BA19000000 mov edx, 00000019
:0044F717 B812000000 mov eax, 00000012
:0044F72D B819000000 mov eax, 00000019
:004AF2B2 BD5A000000 mov ebp, 0000005A // 5 times 0x12
:004AF2B7 BA7D000000 mov edx, 0000007D // 5 times 0x19
:004AF2E0 C70514B35C0019000000 mov dword[005CB314], 00000019
:004AF327 C70514B35C0019000000 mov dword[005CB314], 00000019
:004AF35D C70514B35C0019000000 mov dword[005CB314], 00000019
:004B223D C70019000000 mov dword[eax], 00000019
:004B2243 C7400412000000 mov dword[eax+04], 00000012
:004B6BEF B819000000 mov eax, 00000019
:004B6CA7 B819000000 mov eax, 00000019
:004B6D17 BB19000000 mov ebx, 00000019
:004B6D1C B812000000 mov eax, 00000012
:004B6EA8 B819000000 mov eax, 00000019
:004B6EBE BE12000000 mov esi, 00000012
:004B7190 BE19000000 mov esi, 00000019
:004B7195 BF12000000 mov edi, 00000012
A lot of the map grid setup seems to take place in subroutine 4DC280.
It's called from subroutines 4DCF00 and 4DC180, with [edx] set to 2 (small), 3 (medium) or 4 (large), depending on the galaxy size.
Within subroutine 4DC280, a special value is set depending on the galaxy size. It's a multiplier for the grid size. Default values are 0x26 (small), 0x1F (medium), and 0x14 (large).
The grid multiplier has to be adjusted to every change of the map dimensions. If it's set too high, the map will not show at all (although the game still runs).
As a rule of thumb, set this value so that the product of the grid multiplier and the horizontal map dimension is about 500 and the product of the grid multiplier and the vertical map dimension is about 380. If the map does not show up, decrease the grid multiplier until the map is drawn.
Code segments for grid multipliers:
Code: Select all
Offset hex code asm code
:004DC4A7 BF26000000 mov edi, 00000026 // small
:004DC4B1 BF1F000000 mov edi, 0000001F // medium
:004DC4BB BF14000000 mov edi, 00000014 // large
An exact limit for vertical size has yet to be found. I've successfully tested a 26x50 map, with a grid multiplier of 6. However, the game was unable to create a 26x99 map with a grid multiplier of 3 (infinite loop).
UPDATE:
More instances of the grid multipliers (the offsets from the above code segments are also included):
Code: Select all
(0x26) small 0x4DC4A8, 0x4DB02D, 0x4DBB66, 0x4DA860, 0x4DB283, 0x4DB540, 0x4DBBD5, 0x4DBC8D, 0x4DC8B5
(0x1F) medium 0x4DC4B2, 0x4DB037, 0x4DBB6C, 0x4DA86A, 0x4DB28D, 0x4DB54A, 0x4DBBDC, 0x4DBC94, 0x4DC8BF
(0x14) large 0x4DC4BC, 0x4DB041, 0x4DBB72, 0x4DA874, 0x4DB297, 0x4DB554, 0x4DBBE3, 0x4DBC9B, 0x4DC8C9
UPDATE #2:
To bring star icons and system names into their correct positions, alignment multipliers must be set according to the formula
[alignment multiplier] = 0.2 * [grid multiplier]
at the following positions (stored at floats, 4 bytes each):
Code: Select all
small map:
4DA83C, 4DB57A, 4DBD85, 4DC130
medium map:
4DA849, 4DB58A, 4DBD8F, 4DC13D
large map:
4DA856, 4DB59A, 4DBD9C, 4DC14A
maximum possible x and y dimensions for given grid multiplier
thunderchero wrote:you should use UE to edit larger galaxies.
check this tutorial out
https://www.armadafleetcommand.com/botf ... ial-for-ue