Initial Number of Orbitals for Minor Races

Initial Number of Orbitals for Minor Races; support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Initial Number of Orbitals for Minor Races

Post by Gowron »

By default, minor races start off with one orbital battery per 50 population (rounded down). The divisor (i.e. the "50") is stored in trek.exe at position 0x50AE6 and can be modified to make minors start with more (or less) orbitals :)


Assembler Code:

Code: Select all

:004516CD 8B842462010000          mov eax, dword[esp+00000162]      // get star...
:004516D4 C1F810                  sar eax, 10                       // ... system ID
:004516D7 69C028030000            imul eax, 00000328                // multiply by size of a star system entry
:004516DD 8B15C8365A00            mov edx, dword[005A36C8]          // systInfo offset
:004516E3 01D0                    add eax, edx                      // data offset for current star system
:004516E5 B932000000              mov ecx, 00000032                 // divisor
:004516EA 8B4040                  mov eax, dword[eax+40]            // (starting) population number
:004516ED 31D2                    xor edx, edx
:004516EF F7F1                    div ecx                           // division
:004516F1 8BB42464010000          mov esi, dword[esp+00000164]
:004516F8 89C3                    mov ebx, eax                      // number of orbitals = result of division
:004516FA 31C9                    xor ecx, ecx
:004516FC 85C0                    test eax, eax
:004516FE 7E14                    jle 00451714                      // skip loop if number is zero
:00451700 BF05000000              mov edi, 00000005                 // orbital battery ID
---------
:00451705 0FBFC6                  movsx eax, si
:00451708 89FA                    mov edx, edi
:0045170A 41                      inc ecx                           // increase loop counter
:0045170B E8E046FFFF              call 00445DF0                     // create building specified by ID
:00451710 39D9                    cmp ecx, ebx
:00451712 7CF1                    jl 00451705                       // loop
Note that minors will be very hard to conquer if they start with lots of orbitals, even if their tech levels are low, because there's a feature that makes their orbitals do as much damage as level 8 OBs even at the lowest tech levels:
viewtopic.php?p=33132&sid=a5befc73bc0f4 ... 285#p33132
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
Post Reply

Return to “Initial Number of Orbitals for Minor Races”