System bonuses for high morale

System bonuses for high morale & add wrong main buildings fix; support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

System bonuses for high morale

Post by DCER »

I've been searching for the bonuses you get if your population is loyal or fanatic like additional production, buildings, credits etc. in order to turn it off for a specific race.

The code that checks whether to invoke these bonuses in each system is at 0x3E919. It starts by loading the system's morale descriptor (value between -4 and 3) then it test if morale is 2 (loyal) or 3 (fanatic) to see if it should call the function at 0x3EA6C which seem to decide what bonus to give the system.

So if anyone wants to mess with this they now know where to look. :)
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Post by thunderchero »

I could see were this could be used for a couple races :wink:

thunderchero
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

I'm sure you do :lol: It's all your fault I'm searching for this kind of stuff :lol: :wink:
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Post by thunderchero »

DCER wrote:I'm sure you do :lol: It's all your fault I'm searching for this kind of stuff :lol: :wink:
that when I am not keeping you busy on UE :wink:

Great job btw....

thunderchero
User avatar
The_Nighthawk
Lieutenant-Commander
Lieutenant-Commander
Posts: 149
Joined: Tue May 06, 2008 2:00 am
Location: Vancouver, BC Canada (GMT-8)
Contact:

Post by The_Nighthawk »

I have been under the impression that the cardassians get a bonus to intelligence output when a system is loyal or fanatic. However, I never get around to testing whether that's true or not.

If anyone cares to check using empirical means, or DCER's info above, before I get around to it (likely another year or two with my lack of testing thus far), I would be greatly interested in the answer. :)

EDIT:

See: the Cardassian bonus for manned intel
Playing BoP whenever the wife allows!
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Production Bonus Adding Wrong Main Building IDs Fix

Post by Spocks-cuddly-tribble »

The code sequence for adding extra main buildings due to high morale has some bugs. One of them (adding T1 main food when four times no existing buildings via random output) sometimes renders upgradings impossible.

Cf. the "Add Fed T1 Main Food Bug Fix" with respect to minor buildings here:
viewtopic.php?p=33131&sid=bffafe8619518 ... 681#p33131


:arrow: Production Bonus Adding Wrong Main Building IDs Fix

Features:
  • random generator & add wrong T1 food bug fixed
  • no extra buildings during upgrades fix
  • adds (T1) extra buildings even if no existing building
  • support of extra main intel buildings

Code: Select all

trek.exe at 0x3EC41 - 0x3ED5E new code 0x11E bytes:

05 00 00 00 C1 FA 1F F7 F9 8B B4 24 50 03 00 00 0F B7 9C 56 F8 02 00 00 80 FF 7F 74 16 90 90 90 90 8D 4B 01 66 3B 8E 8A 00 00 00 74 C1 EB 50 90 90 90 90 85 D2 74 09 F6 C2 01 75 03 4A EB 01 42 6B CA 03 C1 E1 06 BB 20 51 44 00 2B D9 0F B6 46 4C 8D 94 24 D0 01 00 00 FF D3 0F B7 9C 24 20 02 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 8B 06 8B D3 89 9C 24 58 03 00 00 E8 20 65 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90

asm code:

0043F840     B9 05000000          MOV ECX, 5 // random divisor for Main building area

0043F84A     8BB424 50030000      MOV ESI, [ESP+350] // systInfo
0043F851     0FB79C56 F8020000    MOVZX EBX,WORD [ESI+EDX*2+2F8] // get building ID
0043F859     80FF 7F              CMP BH, 7F
0043F85C     74 16                JE SHORT 43F874  // add T1 if not given
0043F85E    90                   NOP
0043F85F    90                   NOP
0043F860     90                   NOP
0043F861     90                   NOP
0043F862     8D4B 01              LEA ECX, [EBX+1]
0043F865     66:3B8E 8A000000     CMP CX, [ESI+8A]  // if upgrading...
0043F86C    ^74 C1                JE SHORT 43F82F  // ... new random area
0043F86E    EB 50               JMP SHORT 43F8C0   // goto add building by ID
0043F870     90                   NOP
0043F871     90                   NOP
0043F872     90                   NOP
0043F873     90                   NOP
0043F874   85D2                 TEST EDX, EDX
0043F876   74 09                JE SHORT 43F881
0043F878   F6C2 01              TEST DL, 1 
0043F87B   75 03                JNZ SHORT 43F880 // compensate sorting deviation for...
0043F87D   4A                   DEC EDX   // even numbers
0043F87E   EB 01                JMP SHORT 43F881
0043F880   42                   INC EDX  // uneven numbers
0043F881     6BCA 03              IMUL ECX, EDX, 3
0043F884     C1E1 06              SHL ECX, 6
0043F887     BB 20514400          MOV EBX, 00445120
0043F88C     2BD9                 SUB EBX, ECX
0043F88E     0FB646 4C            MOVZX EAX,BYTE [ESI+4C]  // race ID
0043F892     8D9424 D0010000      LEA EDX, [ESP+1D0]
0043F899     FFD3                 CALL EBX  // load T1 edifice.bst entry
0043F89B     0FB79C24 20020000    MOVZX EBX, WORD [ESP+220]  // building ID
0043F8A3-43F8BF    90            NOP
0043F8C0     8B06                 MOV EAX,DWORD PTR DS:[ESI]  // system ID
0043F8C2     8BD3                 MOV EDX, EBX  // building ID
0043F8C4     899C24 58030000     MOV [ESP+358], EBX   // building ID for message
0043F8CB     E8 27650000          CALL 445DF0  // add building
0043F8D0-43F95E     90            NOP
Add T1 Food Bug Fix (only - not to use in combination with above multi-fix!)

Code: Select all

0043F91E                 jnz     short loc_43F95F // jnz -> jmp at 0x3ED1E change 75 -> EB
---

Code: Select all

NAME: Immigrants Flock Fix
DESC: Adds a system population limit check for the 'Immigrants flock' high morale event.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=33305#p33305

>> 0x0003eeb8 31 ff 8b 42 40 89 bc 24 3c 03 00 00 89 84 24 38 03 00 00 df ac 24 38 03 00 00 dc 0d d4 89 57 00 8b b2 f4 02 00 00 8b 6a 40 83 c6 1e e8 eb db 0d 00 db 9c 24 40 03 00 00 8b 84 24 40 03 00 00 89 b2 f4 02 00 00 01 c5 89 d8 89 6a 40
<< 0x0003eeb8 83 82 f4 02 00 00 1e 8b 02 e8 aa 3f 00 00 2b 42 40 7e 6e db 42 40 dc 0d d4 89 57 00 e8 fb db 0d 00 db 9c 24 40 03 00 00 8b bc 24 40 03 00 00 3b c7 7d 09 8b f8 89 bc 24 40 03 00 00 01 7a 40 8B C3 90 90 90 90 90 90 90 90 90 90 90


#0043FAB8     8382 F4020000 1E      ADD DWORD [EDX+2F4],1E  // systInfo random value +30 
#0043FABF     8B02                  MOV EAX,[EDX]
#0043FAC1     E8 AA3F0000           CALL 443A70     //  GetCurrentSytemPopCap
#0043FAC6     2B42 40               SUB EAX, [EDX+40]
#0043FAC9     7E 6E                 JLE SHORT 43FB39  // exit max pop
#0043FACB     DB42 40               FILD DWORD [EDX+40]  // current pop
#0043FACE     DC0D D4895700         FMUL QWORD [5789D4]  // 0.1
#0043FAD4     E8 FBDB0D00           CALL 51D6D4    round down
#0043FAD9     DB9C24 40030000       FISTP DWORD [ESP+340]
#0043FAE0     8BBC24 40030000       MOV EDI,[ESP+340]
#0043FAE7     3BC7                  CMP EAX,EDI
#0043FAE9     7D 09                 JGE SHORT 43FAF4
#0043FAEB     8BF8                  MOV EDI,EAX   // set max pop growth left
#0043FAED     89BC24 40030000       MOV [ESP+340],EDI
#0043FAF4     017A 40               ADD [EDX+40],EDI
#0043FAF7     8BC3                  MOV EAX,EBX
#0043FAF9 - 43FB03    90            NOP
Last edited by Spocks-cuddly-tribble on Tue Sep 12, 2023 8:11 pm, edited 1 time in total.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: System bonuses for high morale

Post by EnPhreg »

Dcer wrote:
The code that checks whether to invoke these bonuses in each system is at 0x3E919. It starts by loading the system's morale descriptor (value between -4 and 3) then it test if morale is 2 (loyal) or 3 (fanatic) to see if it should call the function at 0x3EA6C which seem to decide what bonus to give the system.
what system bonus for loyal or fanatic moral on system is given? never heard of it or noticed some special bonus for that moral levels.
can anybody tell? are this bonus special random events?

and is it possible to change the local production bonus that morale gives to research and industry without changing simultaneously the output of the manned structures? i know i can increase or lower the output of the manned structures itself to compensate the simultaneously effect from this known multipliers: viewtopic.php?p=11#p11
but that's a bit plump, cause basic production values in the pop-ups for research and industry would always be showing wrong values (only a cosmteic problem but a little bit confusing for players).
so are there any other way to directly change the moral bonus factor for the system production?
and if not, would changing the known research & industry multipliers do effect other ingame effects? or are this specific multipliers for research and industry only effect the production output? has anybody an experience with that?
A lot of multipliers in this topic. Most of them affect more than 1 in-game value, so modding them probably won't be very practical.
Post Reply

Return to “System bonuses for high morale & add wrong main buildings fix”