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 » Sun Jan 04, 2009 5:37 pm

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: 6066
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Post by thunderchero » Mon Jan 05, 2009 1:31 am

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 » Mon Jan 05, 2009 4:40 am

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: 6066
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Post by thunderchero » Tue Jan 06, 2009 1:13 am

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 » Tue Jan 13, 2009 1:34 pm

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: 723
Joined: Sun Apr 27, 2008 2:00 am

Production Bonus Adding Wrong Main Building IDs Fix

Post by Spocks-cuddly-tribble » Tue Dec 27, 2011 1:33 pm

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
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

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 » Thu Oct 13, 2016 5:05 pm

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”

Who is online

Users browsing this forum: No registered users