Extending Edifbnft.bst (new building types/bonuses)

edifbnft.bst (building bonus types); support/discussion/questions

Moderator: thunderchero

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

Extending Edifbnft.bst (new building types/bonuses)

Post by Spocks-cuddly-tribble »

Here is how to disable the first frontier preventing us from adding new building types.

edifbnft.bst (stbof.res)
  • first 4 bytes are pointer for start of address map
  • output description strings, read until 0 (vs. 0x20 space in string)
  • address map 4 bytes per entry (start positions to read from)
By default the address map is stored separately (i.e. duplicated) at asm 5B4260. Since there is only space for up to 48 output addresses (far too less for e.g. file-extending fetishists like Peter1984 :wink:) we just ignore this code and read the addresses directly from the loaded original file. If you wanna have a dynamic data field with static address just overwrite asm 450853-450864 with with "90"s and dynamic area 5B4260-5B431F (length 0xC0 / 192 bytes) is unused. :)

:arrow: edifbnft.bst supporting 49+ entries fix

Code: Select all

trek.exe at 0x4FBDC new code 0xC bytes:

C1 E0 02 03 02 8B 04 10 03 C2 5A C3

Changes in sub_4507D0: edifbnft_bst_description_via_bonus_ID

004507DC     C1E0 02     SHL EAX, 2    // bonus ID * 4
004507DF     0302        ADD EAX, [EDX]    // + address of address map in edifbnft.bst
004507E1     8B0410      MOV EAX, [EAX+EDX]   // start position of description string
004507E4     03C2        ADD EAX, EDX    // + address of loaded edifbnft.bst
004507E6     5A          POP EDX
004507E7     C3          RETN

Note that this is just the cosmetic part, building the new output types on your systems still requires: viewtopic.php?p=30656#p30656
Last edited by Spocks-cuddly-tribble on Sat May 07, 2022 4:52 pm, edited 2 times 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
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

Controlling the bonus positions in systInfo

Post by Spocks-cuddly-tribble »

The next limit for new building outputs is the bonus area in systInfo (default 48 slots, 45 used) resp. the corresponding address-map in trek.exe (default 45 slots).

Note that the systInfo bonus area is an empire-only feature, thus e.g. local military outputs like OBs are unneeded since not loaded from there due to the minor & rebel system issue. Also output slots for unrest orders and trade goods can be cleaned up, because they are no real buildings (exception AI trade goods bug).


Below patch decreases trek.exe address-map entry size from 4 to 2 bytes (i.e. 90 slots).
Additionaly, it features a switch marker for outputs not to store in systInfo resp. for ship construction only. :idea:

It comes in two versions:

Without output preview of partially scrapped main buildings (vanilla default)

Code: Select all

>> 0x3E42B 80
<< 0x3E42B 78

>> 0x3E5A7 BF D1 69 D2 28 03 00 00 A1 C8 36 5A 00 8A 44 02 4C 25 FF 00 00 00 66 8B 94 45 86 00 00 00 31 C0 8A 45 72 8B AC 24 74 01 00 00 8B 04 85 6C FC 58 00 01 E8 8B 8C 24 68 01 00 00 81 E2 FF FF
<< 0x3E5A7 B6 5D 72 66 8B 1C 5D 6C FC 58 00 80 FF 01 7F 35 7C 12 8B 01 33 D2 E8 9E 22 00 00 80 B9 7C 02 00 00 00 74 21 0F B6 C3 03 84 24 74 01 00 00 8B 51 4C 66 8B 94 55 86 00 00 00 8B 8C 24 68 01


#0043F028     8B8C24 78010000      MOV ECX, [ESP+178]  // systInfo entry

#0043F1A6     0FB65D 72            MOVZX EBX,BYTE [EBP+72]  // building output ID
#0043F1AA     66:8B1C5D 6CFC5800   MOV BX,WORD [EBX*2+58FC6C]  // bonus position in systInfo
#0043F1B2     80FF 01              CMP BH,1  // if switch marker...
#0043F1B5     7F 35                JG SHORT 43F1EC  // 2+ -> not stored
#0043F1B7     7C 12                JL SHORT 43F1CB  // 0 -> store
#0043F1B9     8B01                 MOV EAX,[ECX]   // system ID
#0043F1BB     33D2                 XOR EDX,EDX
#0043F1BD     E8 9E220000          CALL 441460  // check ordInfo for build ship order in system
#0043F1C2     80B9 7C020000 00     CMP BYTE [ECX+27C],0  // if not build ship...
#0043F1C9     74 21                JE SHORT 43F1EC  // ...not stored
#0043F1CB     0FB6C3               MOVZX EAX,BL
#0043F1CE     038424 74010000      ADD EAX,[ESP+174]  // systInfo bonus/modus area
#0043F1D5     8B51 4C              MOV EDX,[ECX+4C]   // system owner ID
#0043F1D8     66:8B9455 86000000   MOV DX,[EBP+EDX*2+86]  // edifice.bst building output
#0043F1E0     8B8C24 68010000      MOV ECX,[ESP+168]// number of 'not scrapped' buildings

With output preview of partially scrapped main buildings.

Partially scrapped main structures can remain active until the next turn! Might fix this output preview glitch: viewtopic.php?p=48408#p48408

Code: Select all

>> 0x3E42B 80
<< 0x3E42B 78

>> 0x3E5A7 BF D1 69 D2 28 03 00 00 A1 C8 36 5A 00 8A 44 02 4C 25 FF 00 00 00 66 8B 94 45 86 00 00 00 31 C0 8A 45 72 8B AC 24 74 01 00 00 8B 04 85 6C FC 58 00 01 E8 8B 8C 24 68 01 00 00 81 E2 FF FF 00 00
<< 0x3E5A7 B6 5D 72 66 8B 1C 5D 6C FC 58 00 80 FF 01 7F 35 7C 12 8B 01 33 D2 E8 9E 22 00 00 80 B9 7C 02 00 00 00 74 21 0F B6 C3 03 84 24 74 01 00 00 8B 51 4C 66 8B 94 55 86 00 00 00 0F B7 0E 90 90 90 90


#0043F028     8B8C24 78010000      MOV ECX,[ESP+178]  // systInfo entry

#0043F1A6     0FB65D 72            MOVZX EBX,BYTE[EBP+72]  // building output ID
#0043F1AA     66:8B1C5D 6CFC5800   MOV BX,WORD[EBX*2+58FC6C]  // bonus position in systInfo
#0043F1B2     80FF 01              CMP BH,1  // if switch marker...
#0043F1B5     7F 35                JG SHORT 43F1EC  // 2+ -> not stored
#0043F1B7     7C 12                JL SHORT 43F1CB  // 0 -> store
#0043F1B9     8B01                 MOV EAX,[ECX]   // system ID
#0043F1BB     33D2                 XOR EDX,EDX
#0043F1BD     E8 9E220000          CALL 441460  // check ordInfo for build ship order in system
#0043F1C2     80B9 7C020000 00     CMP BYTE[ECX+27C],0  // if not build ship...
#0043F1C9     74 21                JE SHORT 43F1EC ...not stored
#0043F1CB     0FB6C3               MOVZX EAX,BL
#0043F1CE     038424 74010000      ADD EAX,[ESP+174]  // systInfo bonus/modus area
#0043F1D5     8B51 4C              MOV EDX,[ECX+4C]   // system owner ID
#0043F1D8     66:8B9455 86000000   MOV DX,[EBP+EDX*2+86]  // edifice.bst building output
#0043F1E0     0FB70E               MOVZX ECX,WORD[ESI]  // number of buildings
#0043F1E3     90909090             NOP


Next is an adapted and cleaned up vanilla address-map (unneeded outputs get ignored, local morale bonuses share address[+8C]). It also unlocks the unused local static industry bonus for output ID 45 /0x2D i.e. new entry 46 in edifbnft.bst should be " Industry" (strings without % start with a space) and local "% Shipbuilding" for output ID 0x2E i.e. new entry 47.

Note: Albeit the shipbuilding bonus preview-bug has been fixed (i.e. preview screen shows updated industry output when turning on/off building (or scrapping), there is still the Build Queue update bug i.e. old bonuses until re-entering screen or changing worker/energy settings (cf. 'Dilithium Shortage' warning).

Code: Select all

trek.exe 0x18DA6C new address-map 0xB4 bytes:

00 00 04 00 08 00 0C 00 FF 02 28 00 2C 00 18 00 1C 00 20 00 38 00 40 00 44 00 10 00 14 00 48 00 FF 02 FF 02 FF 02 FF 02 8C 00 B8 00 60 00 64 00 68 00 6C 00 70 00 4C 00 74 00 78 00 B0 00 7C 00 AC 00 80 00 3C 00 50 00 FF 02 94 00 A4 00 98 00 88 00 90 00 A0 00 A8 01 BC 00 A8 00 14 01 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02
First byte of each entry is postion (unsigned) second byte the switch marker (signed): 0=store, 1=for ship construction only, 2=ignore. Ignored output types use FF 02 with the FF being pointless.

Output indexes are same as in edifbnft.bst (see above) i.e. entry postion = output ID * 2.



A How-To example: Adding a % Shipbuilding bonus to shipyards

In edifbnft.bst " Builds Ships" is entry 19 (i.e. ID 18 /0x12, since entry 1 is ID 0).
-> at 0x18DA6C +2*0x12 -> default FF 02 (ignored, since unused) former: 5C
-> systInfo bonus area +C0/+180h (see above link) +5C = 11C resp. 1DC
- systInfo wiki info:
Offset 0x011C to 0x011F = Builds Ships (i.e. yard output value -> unused)
Offset 0x01DC to 0x01DF = Builds Ships (i.e. yard output value -> unused)

Offset 0x00D4 to 0x00D7 = +% industry
Offset 0x0194 to 0x0197 = +% industry
-> D4/194h minus C0/180h = +14h

I.e. replacing the above default FF 02 with 14 01 (using the new switch marker) does the job.
Last edited by Spocks-cuddly-tribble on Sat May 07, 2022 5:18 pm, edited 6 times 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
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

Fixing empire-wide bonus addresses & some local bugs

Post by Spocks-cuddly-tribble »

Let's complete this topic with unlocking scientific-& military intel and the powerful empire-wide industry bonus. I've also included fixes for the local % research & intel bonuses (probably the vanilla Ullian building was meant to be % intel local, see below 'intel total') and an updated edifbnft.bst file. :wink:


BotF 1.0.2 building output type issues:

Unused but working:
  • % energy (local)
    % total credits (empire-wide)
Two-in-one bug:
  • % intel total (empire-wide + local -> wrong position)
Broken: Flawed: Missing:
  • % industry empire-wide
    Industry (local static bonus)
    % intel (local)
    % scientific intel
    % military intel
    % Shipbuilding

:arrow: empsInfo building bonuses fix

Code: Select all

trek.exe at 0x43AFA new code 0x39 bytes:

8B 51 50 66 01 50 10 8B 51 54 66 01 50 12 66 8B 91 88 00 00 00 66 01 50 02 8B 51 58 66 01 50 14 8B B1 98 00 00 00 66 01 70 04 8B 51 30 66 01 50 06 90 66 8B 78 16 66 8B 91

asm changes:

004446FA     8B51 50            MOV EDX, [ECX+50]
004446FD     66:0150 10         ADD [EAX+10], DX  // % economic intel
00444701     8B51 54            MOV EDX, [ECX+54]
00444704     66:0150 12         ADD [EAX+12], DX  // % scientific intel

00444713     8B51 58            MOV EDX, [ECX+58]
00444716     66:0150 14         ADD [EAX+14], DX  // % military intel
0044471A     8BB1 98000000      MOV ESI, [ECX+98]
00444720     66:0170 04         ADD [EAX+4], SI  // % raiding
00444724     8B51 30            MOV EDX, [ECX+30]
00444727     66:0150 06         ADD [EAX+6], DX  // % industry
0044472B     90                 NOP

00444730     66:8B91 90000000   MOV DX, [ECX+90]  // % traderoute credits
:arrow: adapted & updated systInfo bonuses address-map (with 'shipbuilding bonus preview-fix' for utopia bonus)

Code: Select all

trek.exe 0x18DA6C new address-map 0xB4 bytes:

00 00 04 00 08 00 0C 00 FF 02 28 00 2C 00 18 00 1C 00 20 00 38 00 40 00 44 00 10 00 14 00 48 00 FF 02 FF 02 FF 02 FF 02 8C 00 B8 00 60 00 64 00 68 00 6C 00 70 00 4C 00 74 00 78 00 B0 00 7C 00 AC 00 80 00 3C 00 50 00 FF 02 94 00 A4 00 98 00 88 00 90 00 A0 00 A8 01 BC 00 A8 00 14 01 5C 00 54 00 58 00 30 00 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02
:arrow: adapted & updated systInfo bonuses address-map (without 'shipbuilding bonus preview-fix' for utopia bonus = vanilla default)

Code: Select all

trek.exe 0x18DA6C new address-map 0xB4 bytes:

00 00 04 00 08 00 0C 00 FF 02 28 00 2C 00 18 00 1C 00 20 00 38 00 40 00 44 00 10 00 14 00 48 00 FF 02 FF 02 FF 02 FF 02 8C 00 B8 00 60 00 64 00 68 00 6C 00 70 00 4C 00 74 00 78 00 B0 00 7C 00 AC 00 80 00 3C 00 50 00 FF 02 94 00 A4 00 98 00 88 00 90 00 A0 00 B4 00 BC 00 A8 00 14 01 5C 00 54 00 58 00 30 00 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02
:arrow: % intel total two-in-one bug & unlock % intel (local) fix -> Other version for 'Intel Tech Bonus': viewtopic.php?p=33046#p33046

Code: Select all

trek.exe at 0x409BA change 3C -> 5C

004415B8     8B73 5C     MOV ESI, [EBX+5C] // local intel % bonus
:arrow: % research (local) fix -> Other version for 'Research Tech Bonus': viewtopic.php?p=33046#p33046

Code: Select all

trek.exe at 0x40ABC new code 0x17 bytes:

0F B7 41 44 03 43 1C 83 E8 64 89 04 24 DD 05 94 89 57 00 DB 04 24 90

asm code:
004416BC     0FB741 44       MOVZX EAX, WORD [ECX+44] // system morale
004416C0     0343 1C         ADD EAX, [EBX+1C]  // system %-bonus
004416C3     83E8 64         SUB EAX, 64
004416C6     890424          MOV [ESP], EAX
004416C9     DD05 94895700   FLD QWORD [578994]
004416CF     DB0424          FILD DWORD [ESP]
004416D2     90              NOP

Link to an updated edifbnft.bst file: edifbnft.bst (english)


New output IDs to use in edifice.bst:
  • 0x2D = Industry (local static bonus)
    0x2E = % Shipbuilding
    0x2F = % intel (local)
    0x30 = % scientific intel
    0x31 = % military intel
    0x32 = % industry empire-wide


EDIT: If trek.exe at 0x18DAC2 = A8 01 (Shipbuilding Bonus Preview-Fix for Utopia bonus) then also use:

Code: Select all

NAME: Extra Fix for 'Shipbuilding Bonus Preview-Fix' (Utopia bonus -> Production Queue "Turns Remaining X")

>> 0x000F22E9 75
<< 0x000F22E9 EB

#004F2EE9           jnz   short loc_4F2F32                  ; jmp 0xF22E9 75 -> EB
Last edited by Spocks-cuddly-tribble on Sun Jan 22, 2023 2:06 pm, edited 19 times 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
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7848
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by thunderchero »

Very sweet,

I have wanted these bonus types working for a long time. I will be checking this out later today.

great job SCT

Off topic question
Btw how is the minor building bug fix (no structures when membering) going that is still a very needed fix. :wink:

thunderchero
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

New building outputs: Extra Pop for Ground Defense & Ground Defense

Post by Spocks-cuddly-tribble »

In case a mod author needs even more structure bonus types, here is an example for two more (multiplayer-proof):


New bonus output IDs to use in edifice.bst: (given an updated edifbnft.bst file) - bonus names could be improved -

0x33 = Extra Pop for Ground Defense (all other bonuses apply) -> e.g. Garrison (also lowers chance of rebellions)
0x34 = Ground Defense (local static bonus) like Wind Turbine -> e.g. Mercenary Units

Option -> credit cost per turn, but no energy cost i.e. more than one per system possible
e.g. +50 Ground Defense each for 2 credits/turn for Mercenary Units (scrap if no longer needed, not for AI aibldreq.bin)


Required => Extending Edifbnft.bst (new building types/bonuses) -> all base patches from this topic + updated edifbnft.bst file

Recommended => Ground Defense Fix for Minor & Rebel Systems viewtopic.php?p=33681#p33681 NOT the additive bonuses option -> conflict!

Code: Select all

NAME: New Building Bonuses 'Extra Pop for Ground Defense' & 'Ground Defense' (updated)
DESC: Requires 'Extending Edifbnft.bst (new building types/bonuses)' base patches and updated edifbnft.bst file.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=32993#p32993

>> 0x45CF6 98 69 C0 28 03 00 00 8B 15 C8 36 5A 00 01 C2 8D 82 80 01 00 00 DB 80 94 00 00 00
<< 0x45CF6 69 D0 28 03 00 00 03 15 C8 36 5A 00 8D 82 14 02 00 00 DB 00 8B 40 F0 89 44 24 10

>> 0x45D67 89
<< 0x45D67 01

>> 0x45D80 DB 5C 24 28 8B 44 24 28 5E 83 C4 28 5A 59 5B
<< 0x45D80 5E DB 1C 24 8B 04 24 03 82 1C 02 00 00 EB 52

>> 0x0004b48e 66 83 7b
>> 0x0004b492 0a 0f 8e 8c
>> 0x0004b498 00 8b 43 42 c1 f8 10
<< 0x0004b48e 0f b7 43
<< 0x0004b492 03 86 04 02
<< 0x0004b498 83 f8 0a 7d 02 b0 0a

>> 0x18DA6C FF 02 FF 02
<< 0x18DA6C 84 00 9C 00


# trek.exe 0x18DA6C address-map update for new building output bonus IDs 0x33 & 0x34 in systInfo:
#
# 84 +204 = unused # Extra Pop for Ground Defense
# 9C +21C = unused # Ground Defense (local static bonus)


#004468F6     69D0 28030000    IMUL EDX,EAX,328 // system ID * 808 entry size
#004468FC     0315 C8365A00    ADD EDX, [5A36C8] // adr systInfo
#00446902     8D82 14020000    LEA EAX, [EDX+214] // systInfo adr of % ground defense bonus
#00446908     DB00             FILD DWORD [EAX] // % ground defense bonus to FPU
#0044690A     8B40 F0          MOV EAX, [EAX-10] // systInfo+204 = new Extra Pop for Ground Defense bonus
#0044690D     894424 10        MOV [ESP+10],EAX // new Extra Pop for Ground Defense bonus 

#00446967     014424 14        ADD [ESP+14],EAX // add pop to new Extra Pop for Ground Defense bonus

# -> conflict with patch changing effect of local + global ground combat bonuses from multiplicative to additive (not recommended anyway)

#00446980     5E               POP ESI
#00446981     DB1C24           FISTP DWORD [ESP]
#00446984     8B0424           MOV EAX,[ESP] // system ground combat value
#00446987     0382 1C020000    ADD EAX,[EDX+21C] // add new Ground Defense (local static bonus)
#0044698D     EB 52            JMP SHORT 4469E1 // exit

#Rebellions
#0044C08E     0FB743 44         MOVZX EAX,WORD [EBX+44]  // morale value
#0044C092     0386 04020000     ADD EAX,[ESI+204]  // new Garrison bonus 'Extra Pop for Ground Defense' 
#0044C098     83F8 0A           CMP EAX,0A  // check min value 10
#0044C09B     7D 02             JGE SHORT 44C09F
#0044C09D     B0 0A             MOV AL,0A  // set min value 10

Example of trek.exe 0x18DA6C address-map 0xB4 bytes (with utopia preview fix) -> already updated by above main patch

Code: Select all

00 00 04 00 08 00 0C 00 FF 02 28 00 2C 00 18 00 1C 00 20 00 38 00 40 00 44 00 10 00 14 00 48 00 FF 02 FF 02 FF 02 FF 02 8C 00 B8 00 60 00 64 00 68 00 6C 00 70 00 4C 00 74 00 78 00 B0 00 7C 00 AC 00 80 00 3C 00 50 00 FF 02 94 00 A4 00 98 00 88 00 90 00 A0 00 A8 01 BC 00 A8 00 14 01 5C 00 54 00 58 00 30 00 84 00 9C 00 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02

systInfo building output area 0x180-0x23F (effective values / preview displacement -0xC0) -> first value refers to above address-map :idea:
0 +180 = cumulated edifice.bst output of main Food
4 +184 = +% food (blg + planet bonuses)
8 +188 = cumulated edifice.bst output of main Energy
C +18C = +% energy (blg + planet bonuses)
10 +190 = cumulated edifice.bst output of main Industry
14 +194 = +% industry
18 +198 = cumulated edifice.bst output of main Research
1C +19C = +% research (not working) # fixed
20 +1A0 = +% research empire-wide (all areas)
24 +1A4 = + Credits (blg output 0x4 = tradegoods -> unused) # free?
28 +1A8 = +% credits
2C +1AC = +% total credits (i.e. empire-wide)
30 +1B0 = Shield per Energy Tech # % industry (empire-wide)
34 +1B4 = + Morale (blg output 0x14 -> e.g. Holo Cinema) -> # free relocated to 8C (remove default add morale code before using)
38 +1B8 = cumulated edifice.bst output of main Intel
3C +1BC = +% general intelligence (& +% intel local -> bug) # fixed local relocated to 5C
40 +1C0 = +% intel total
44 +1C4 = +% security
48 +1C8 = +% espionage total
4C +1CC = +% sabotage total
50 +1D0 = +% economic intel (not working) # fixed
54 +1D4 = Anti-Ship Defenses (base output of running OBs) -> # % scientific intel
58 +1D8 = Ship experience -> # % military intel
5C +1DC = Builds Ships (i.e. yard output value -> unused) -> # intel local
60 +1E0 = +% biotech research
64 +1E4 = +% computer research
68 +1E8 = +% construction research
6C +1EC = +% propulsion research
70 +1F0 = +% weapon research
74 +1F4 = +% energy research
78 +1F8 = Scan range # needed?
7C +1FC = Dilithium (running) # needed? -> Yes AI military power check
80 +200 = + Trade routes
84 +204 = unused -> # Extra Pop for Ground Defense
88 +208 = + Morale empire-wide
8C +20C = +/- Morale (extra morale [edifice.bst+82h] & unrest order)
90 +210 = +% income on trade route (empire-wide)
94 +214 = +% ground defense
98 +218 = +% raiding (not working) # fixed
9C +21C = unused -> # Ground Defense (local static bonus)
A0 +220 = + Food (local static bonus)
A4 +224 = + Energy (local static bonus)
A8 +228 = + Industry (local static bonus -> missing feature?) # added
AC +22C = + Intelligence (local static bonus)
B0 +230 = + Research (local static bonus)
B4 +234 = Shipbuilding bonus to industry (e.g. utopia planetia)
B8 +238 = bribe resistance (minor member systems)
BC +23C = +% ground combat (empire-wide)


thunderchero wrote: Sun Dec 11, 2011 11:29 amBtw how is the minor building bug fix (no structures when membering) going that is still a very needed fix. :wink:
Minors without Main Buildings Bug Fix: viewtopic.php?p=33859#p33859 :idea:
Last edited by Spocks-cuddly-tribble on Fri Dec 30, 2022 9:34 pm, edited 14 times 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
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Controlling the bonus positions in systInfo

Post by Tethys »

Spocks-cuddly-tribble wrote: Next is an adapted and cleaned up vanilla address-map (unneeded outputs get ignored, local morale bonuses share address[+8C]). It also unlocks the unused local static industry bonus for output ID 45 /0x2D i.e. new entry 46 in edifbnft.bst should be " Industry" (strings without % start with a space) and local "% Shipbuilding" for output ID 0x2E i.e. new entry 47. :)

Note: Albeit the shipbuilding bonus preview-bug has been fixed (i.e. preview screen shows updated industry output when turning on/off building (or scrapping), there is still the Build Queue update bug i.e. old bonuses until re-entering screen or changing worker/energy settings (cf. 'Dilithium Shortage' warning).

Code: Select all

trek.exe 0x18DA6C new address-map 0xB4 bytes:

00 00 04 00 08 00 0C 00 FF 02 28 00 2C 00 18 00 1C 00 20 00 38 00 40 00 44 00 10 00 14 00 48 00 FF 02 FF 02 FF 02 FF 02 8C 00 B8 00 60 00 64 00 68 00 6C 00 70 00 4C 00 74 00 78 00 B0 00 7C 00 AC 00 80 00 3C 00 50 00 FF 02 FF 02 FF 02 98 00 88 00 90 00 A0 00 A8 01 BC 00 A8 00 14 01 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02 FF 02
First byte of each entry is postion (unsigned) second byte the switch marker (signed): 0=store, 1=for ship construction only, 2=ignore. Ignored output types use FF 02 with the FF being pointless.

Output indexes are same as in edifbnft.bst (see above) i.e. entry postion = output ID * 2.
SCT upon testing this you accidentally disabled #38 energy.

@ 0x18DAB8

a4 00

I will let you know if I find other working ones you may have accidentally disabled.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by Spocks-cuddly-tribble »

I've corrected both address tables.

Thank you very much and good work with investigating the solution. :)
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by Tethys »

These are all the ones disabled using your updated table and vanilla edifbnft file (for reference):

4: Credits @ 18DA74

16: Ship Experience @ 18DA8C

17: Anti Ship Defense @ 18DA8E

18: Builds Ships @ 18DA90

19: Shield per energy tech @ 18DA92

36: Morale @ 18DAB4

37: % Ground defense @ 18DAB6

38: Energy (now fixed)

From testing, the Ship Experience still works with it disabled in the new table, but are we sure 36: and 37: need to be disabled as well?
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7848
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by thunderchero »

Tethys wrote:These are all the ones disabled using your updated table and vanilla edifbnft file (for reference):
I have not done any testing on this project yet but shouldn't you be using the edited edifbnft.bst SCT uploaded?
Spocks-cuddly-tribble wrote:Link to an updated edifbnft.bst file:
http://www.file-upload.net/download-394 ... e.bst.html :idea:
thunderchero
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by Tethys »

The only difference between the 2 are the added bonuses near the "end".
SCT wrote:Missing:
  • % industry empire-wide
    Industry (local static bonus)
    % intel (local)
    % scientific intel
    % military intel
    % Shipbuilding
Since I was only concerned about vanilla bonuses that may have been turned off by accident, logic took over. :wink:
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by Spocks-cuddly-tribble »

Tethys wrote:are we sure 36: and 37: need to be disabled as well?
#36 are unrest orders (see above)

#37 is a local military output i.e. should not be read from systInfo. However, BotF has some bugs and you just disclosed one of them:
Gowron wrote:2. Ground Combat Values

Say, Tamara has a current pop of 300 and a ground combat strength of 513. You divide 513 by 300 and the result by 0.9 (Tamarian ground combat value)...you get 1.9 as the result
viewtopic.php?f=9&t=56

Updating both address maps 0x18DAB4 -> 94 00

Minor fixes to-do list: Bunker network value to [systInfo+154h & +214h]. The minors will be very happy about your question. :wink:

Also "scan range" is not tested, thus still in systInfo.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by Tethys »

How do Outpost/Starbase/Shipyards give ships range? And can the value be manipulated to provide greater ranges for different instances, such as +1 range for Outpost and +2 for Starbase? Can the value be separated for an entirely new building type (for a planetside Starbase, we would use something like +Ground Defense and a passive bonus to range, like a Shipyard does +Build ships with passive range applied)

Any information you or anyone could provide would be useful even if its ASM and underdeveloped. I am quite curious as to how I would go about creating new bonus types as well.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by EnPhreg »

if i want to adapt the edifbnft.bst for german language, how i will do that?
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7848
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by thunderchero »

EnPhreg wrote:if i want to adapt the edifbnft.bst for german language, how i will do that?
make code changes SCT posted above, then add english edifbnft.bst and use UE to edit/translate bonus type descriptions. That should be all that is needed.
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Extending Edifbnft.bst (new building types/bonuses)

Post by EnPhreg »

yes, this should work :)

one concept i didn't understand is the effect of the 'bonus to unrest threshold' for buidlings. what effect has a positive or negative value?
Post Reply

Return to “edifbnft.bst (building bonus types)”