Shipname Appendix Fix & Adding new name groups

Shipname Appendix Fix & Adding new name groups; support/discussion/questions

Moderator: thunderchero

User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2403
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Shipname Appendix Fix & Adding new name groups

Post by Tethys »

Ever wanted to stop those pesky USS Ubership ABCD appendix addons? Well now you can! Billy Mays here... erm.. ok
zl999d.png
zl999d.png (360.94 KiB) Viewed 7822 times
Thanks SCT, Peter and everyone who posted to help me with this, greatly appreciated! Hope this helps you modders out!
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
eprahsnada
Lieutenant-Junior Grade
Lieutenant-Junior Grade
Posts: 85
Joined: Tue Jun 15, 2010 2:00 am
Location: Banbury, Oxon

Post by eprahsnada »

Thats great. Im fed up with them starting on A, I mean why start a ship name with A if you can have the original, stupid Bethesda.

Eprahsnada
Do you think starships have industrial window wipers? I mean, a space-bug hitting the viewscreen at warp 5 will make one HELL of a mess!
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1924
Joined: Sun Apr 27, 2008 2:00 am

Shipname Appendix Fix

Post by Spocks-cuddly-tribble »

Topic cleaned up (removed outdated/flawed info)


:arrow: Shipname Appendix Fix (no fnt-file changes needed!)

To still have appendixes but the first ship with the name starting without appendix instead of A, use:

Code: Select all

Trek.exe at 0x17959D change 41 to -> 40

trek.exe at 0x748BB - 0x74A1A replace 352 bytes with:

74 F2 89 74 24 30 8D 41 FF E8 97 2C 09 00 89 C2 8B 44 24 3A C1 F8 10 89 44 24 34 8B 74 24 34 C1 E0 02 29 F0 8D 34 85 00 00 00 00 8B 86 6C 55 5B 00 01 C2 89 D0 C1 FA 1F F7 F9 89 D1 31 C0 89 96 6C 55 5B 00 89 DE 8B 54 24 3A C1 FA 10 39 D0 0F 8D A8 00 00 00 8B 16 83 C6 04 40 01 D7 EB E7 BE 70 B7 57 00 89 D8 89 EF E8 08 FC 09 00 57 8A 06 88 07 3C 00 74 10 8A 46 01 83 C6 02 88 47 01 83 C7 02 3C 00 75 E8 5F 31 C0 83 C4 40 5D 5F 5E 59 5B C3 BA D9 00 00 00 B8 74 B7 57 00 E8 94 2A 09 00 89 C2 C1 FA 1F F7 F9 8B 44 24 3A C1 F8 10 89 44 24 34 8B 74 24 34 C1 E0 02 29 F0 8D 34 85 00 00 00 00 89 96 68 55 5B 00 89 96 6C 55 5B 00 66 FF 86 70 55 5B 00 8B 96 6E 55 5B 00 B8 1A 00 00 00 C1 FA 10 80 FA 1B 75 02 33 D2 89 54 24 30 90 90 66 89 96 70 55 5B 00 E9 09 FF FF FF 01 CF 89 F8 C1 E7 02 29 C7 C1 E7 02 29 C7 8B B3 F8 00 00 00 C1 E7 02 8B 4C 24 2C 01 FE 89 E7 01 CE B9 2C 00 00 00 57 89 C8 C1 E9 02 F2 A5 8A C8 80 E1 03 F2 A4 5F B9 28 00 00 00 8D 74 24 04 89 EF 8B 5C 24 30 57 89 C8 C1 E9 02 F2 A5 8A C8 80 E1 03 F2 A4 5F 66 85 DB 74 71 66 83 FA 32 74 6B 66 83 FA

code changes:

004754BB    ^74 F2         JE SHORT 4754AF
004754BD     897424 30     MOV [ESP+30], ESI

0047559F     80FA 1B       CMP DL, 1B
004755A2     75 02         JNZ SHORT 4755A6
004755A4     33D2          XOR EDX, EDX
004755A6     895424 30     MOV [ESP+30], EDX
004755AA     9090          NOP

004755F9     8B5C24 30     MOV EBX, [ESP+30]

00475612     66:83FA 32    CMP DX, 32 // non appendix group (Outpost)

00475618     66:83FA 33    CMP DX, 33 // non appendix group (Starbase)
Note; Group 0 (UPN Invalid) now is a standard appendix group!


To disable appendix addons for name groups (required if groups are shared by different races e.g. Outpost/Starbase), adapt checks for the non-appendix groups.

Example to set non-appendix groups 32h, 33h, 34h & 35h:

Code: Select all

00475612     66:83FA 32    CMP DX, 32
00475616     7C 06         JL SHORT 47561E // appendix group
00475618     66:83FA 35    CMP DX, 35
0047561C     7E 65         JLE SHORT 475683 // non appendix group
Extending shipname.bin (i.e. adding new name groups) is problematic due to internal memory limitations wrt shipname.dat.
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: 1924
Joined: Sun Apr 27, 2008 2:00 am

Adding new shipname groups

Post by Spocks-cuddly-tribble »

Adding new shipname groups - extending shipname.bin & shipname.dat


The following code modifies shipname.dat to support up to 248 shipname groups i.e. IDs 0-D7. It includes the above appendix fix & modding options for non-appendix groups.

So even outposts and starbases now can have unique names and/or appendixes. :)

Note: The new code auto-locates start of the namelist in shipname.bin in order to facilitate the editing (& UE support).

Code: Select all

Trek.exe at 0x17959D change 41 to -> 40

trek.exe at 0x74827 – 0x74A50 replace 0x22A bytes with:

89 90 64 55 5B 00 90 90 90 3D E8 02 00 00 75 DC 5A C3 00 00 00 00 00 00 00 53 51 56 57 55 83 EC 40 66 89 44 24 3C 89 D5 BB 28 00 00 00 31 D2 89 E8 89 54 24 2C E8 F2 83 0A 00 8D 5C 24 30 8D 54 24 2C B8 60 B7 57 00 E8 8D FD 09 00 8B 44 24 3A C1 F8 10 8B 5C 24 2C 8D 14 85 00 00 00 00 01 DA 8B 0A 31 FF 85 C9 0F 8E 87 00 00 00 89 C2 C1 E0 02 29 D0 8A 90 69 55 5B 00 0F B6 B0 6A 55 5B 00 89 74 24 30 90 90 90 90 90 90 90 90 90 90 3A 90 68 55 5B 00 0F 84 8C 00 00 00 8D 41 FF E8 97 2C 09 00 89 C2 8B 44 24 3A C1 F8 10 89 44 24 34 8B 74 24 34 C1 E0 02 29 F0 8B F0 0F B6 86 69 55 5B 00 90 90 90 90 01 C2 89 D0 C1 FA 1F F7 F9 89 D1 31 C0 88 96 69 55 5B 00 89 DE 8B 54 24 3A C1 FA 10 39 D0 0F 8D A8 00 00 00 8B 16 83 C6 04 40 01 D7 EB E7 BE 70 B7 57 00 89 D8 89 EF E8 08 FC 09 00 57 8A 06 88 07 3C 00 74 10 8A 46 01 83 C6 02 88 47 01 83 C7 02 3C 00 75 E8 5F 31 C0 83 C4 40 5D 5F 5E 59 5B C3 BA D9 00 00 00 B8 74 B7 57 00 E8 94 2A 09 00 89 C2 C1 FA 1F F7 F9 8B 44 24 3A C1 F8 10 89 44 24 34 8B 74 24 34 C1 E0 02 29 F0 88 90 68 55 5B 00 88 90 69 55 5B 00 FE 80 6A 55 5B 00 90 90 90 90 90 90 90 90 0F B6 90 6A 55 5B 00 90 90 90 90 90 90 90 80 FA 1B 75 02 33 D2 89 54 24 30 90 90 88 90 6A 55 5B 00 90 E9 09 FF FF FF 01 CF 89 F8 C1 E7 02 29 C7 C1 E7 02 29 C7 C1 E7 02 8D 34 93 83 C6 04 F6 46 03 80 74 F7 03 F7 8B FC B9 2C 00 00 00 57 89 C8 C1 E9 02 F2 A5 8A C8 80 E1 03 F2 A4 5F B9 28 00 00 00 8D 74 24 04 89 EF 8B 5C 24 30 57 89 C8 C1 E9 02 F2 A5 8A C8 80 E1 03 F2 A4 5F 66 85 DB 74 71 66 83 FA 32 74 6B 66 83 FA 33 74 65 BE 9C B7 57 00 8D 7C 24 38 57 8A 06 88 07 3C 00 74 10 8A 46 01 83 C6 02 88 47 01 83 C7 02 3C 00 75 E8 5F 8D 04 95 00 00 00 00 29 D0 8A 80 6A 55 5B 00 90

Code changes:

00475427     8990 64555B00    MOV DWORD PTR DS:[EAX+5B5564],EDX
0047542D     90               NOP
0047542E     90               NOP
0047542F     90               NOP

0047549A     8A90 69555B00      MOV DL,BYTE PTR DS:[EAX+5B5569]
004754A0     0FB6B0 6A555B00    MOVZX ESI,BYTE PTR DS:[EAX+5B556A]
004754A7     897424 30          MOV DWORD PTR SS:[ESP+30],ESI
004754AB     90                 NOP
004754AC     90                 NOP
004754AD     90                 NOP
004754AE     90                 NOP
004754AF     90                 NOP
004754B0     90                 NOP
004754B1     90                 NOP
004754B2     90                 NOP
004754B3     90                 NOP
004754B4     90                 NOP
004754B5     3A90 68555B00      CMP DL,BYTE PTR DS:[EAX+5B5568]

004754DF     8BF0               MOV ESI,EAX
004754E1     0FB686 69555B00    MOVZX EAX,BYTE PTR DS:[ESI+5B5569]
004754E8     90                 NOP
004754E9     90                 NOP
004754EA     90                 NOP
004754EB     90                 NOP

004754F9     8896 69555B00      MOV BYTE PTR DS:[ESI+5B5569],DL

00475577     8890 68555B00      MOV BYTE PTR DS:[EAX+5B5568],DL
0047557D     8890 69555B00      MOV BYTE PTR DS:[EAX+5B5569],DL
00475583     FE80 6A555B00      INC BYTE PTR DS:[EAX+5B556A]
00475589     90                 NOP
0047558A     90                 NOP
0047558B     90                 NOP
0047558C     90                 NOP
0047558D     90                 NOP
0047558E     90                 NOP
0047558F     90                 NOP
00475590     90                 NOP
00475591     0FB690 6A555B00    MOVZX EDX,BYTE PTR DS:[EAX+5B556A]
00475598     90                 NOP
00475599     90                 NOP
0047559A     90                 NOP
0047559B     90                 NOP
0047559C     90                 NOP
0047559D     90                 NOP
0047559E     90                 NOP
0047559F     80FA 1B            CMP DL,1B
004755A2     75 02              JNZ SHORT 4755A6
004755A4     33D2               XOR EDX,EDX
004755A6     895424 30          MOV DWORD PTR SS:[ESP+30],EDX
004755AA     90                 NOP
004755AB     90                 NOP
004755AC     8890 6A555B00      MOV BYTE PTR DS:[EAX+5B556A],DL
004755B2     90                 NOP

004755C6     C1E7 02            SHL EDI,2
004755C9     8D3493             LEA ESI,DWORD PTR DS:[EBX+EDX*4]
004755CC     83C6 04            ADD ESI,4
004755CF     F646 03 80         TEST BYTE PTR DS:[ESI+3],80
004755D3    ^74 F7              JE SHORT 4755CC
004755D5     03F7               ADD ESI,EDI
004755D7     8BFC               MOV EDI,ESP

004755F9     8B5C24 30          MOV EBX,DWORD PTR SS:[ESP+30]

00475612     66:83FA 32         CMP DX,32

00475618     66:83FA 33         CMP DX,33

0047564A     8A80 6A555B00      MOV AL,BYTE PTR DS:[EAX+5B556A]
00475650     90                 NOP
After this, new name groups can be added in shipname.bin (stbof.res):
thunderchero wrote:shipname.bin

there are 62 groups that can be edited

the first 248 Bytes hold info of how many entrys for each group 4 Bytes per group.

next is "FC 00 00 00" for pointer for start of name list [-> can be ignored/overwritten/removed now]

after that it is only each name entry of 44 Bytes.
Name entries start with the group ID (2 byte) + FF FF followed by 40 bytes for the ship name.

Name groups do not have to be sorted in blocks via owner races!
patch for Bof_patcher
shipname_groups.patch
(1.5 KiB) Downloaded 87 times
Last edited by Spocks-cuddly-tribble on Sun Mar 24, 2024 3:13 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: Shipname Appendix Fix & Adding new name groups

Post by EnPhreg »

SCT wrote:
trek.exe at 0x74827 – 0x74A50 replace 0x22A bytes with:
a little typo: there are only 0x2A02 bytes
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Shipname Appendix Fix & Adding new name groups

Post by thunderchero »

EnPhreg wrote:
SCT wrote:
trek.exe at 0x74827 – 0x74A50 replace 0x22A bytes with:
a little typo: there are only 0x2A02 bytes
from what I understand 0x22a is the same as 2A 02 they both equal 554 bytes

but 0x2A02 would equal 02 2A or 10754 bytes
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Shipname Appendix Fix & Adding new name groups

Post by EnPhreg »

can't follow your conversions.
i used the calculator within UE to convert the values.
and cause all the further given "number of bytes" values in other patches were also easy to convert with UE, i assumed that must be a typo.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Shipname Appendix Fix & Adding new name groups

Post by thunderchero »

EnPhreg wrote:can't follow your conversions.
with UE enter 0x22a into "hexadecimal address" box of the convert addresses and press convert button.
this will convert to 554 in decimal address.

the "0x" in front of number changes how it is converted.
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Shipname Appendix Fix & Adding new name groups

Post by EnPhreg »

ah ok,
didn't noticed that, cause for single bytes it doesn't matter if i use the calculator or the converter.
you're right, so my post is obsolete.
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Shipname Appendix Fix & Adding new name groups

Post by EnPhreg »

have a strange problem with extending the shipname groups.
i used the patch and/or UE itself, to implement the necessary changes for adding more shipname groups. i used a vanilla botf install.
if i create a new shipname group (e.g. group 62) i can't choose the new created shipname groups with ship models and the game crashes if i want to launch a new game. very strange. the patch should work fine, or?
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Shipname Appendix Fix & Adding new name groups

Post by thunderchero »

EnPhreg wrote: Tue Dec 25, 2018 10:15 am or?
did you figure it out?
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Shipname Appendix Fix & Adding new name groups

Post by EnPhreg »

no,
can't figure out any reason. very strange. cause patch code should be fine and also UE didn't make it.
did anybody else reported similar problems? one indication is, that i can't select the new name groups for ships within the ship stats screen. the shipname.bin looks fine so far. i think it has to do with the code within the trek.exe. but i used a vanilla install, so the patch should work fine. if i use the patch without making new name groups, i have no problem, but if i create a new name group, the game crashes if i start a new game.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Shipname Appendix Fix & Adding new name groups

Post by thunderchero »

UE will make all required code changes. so manually patching is not required.
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Shipname Appendix Fix & Adding new name groups

Post by EnPhreg »

i know. but if i use UE, than UE asks for the code change in trek.exe and i click yes and save (saving is always successful, no errors), but UE does nothing with trek.exe, cause if i than use the patcher, it shows me, that no code changes are done in trek.exe, cause the patch ins't colored red or green. so no code changes are done by UE. but it is indifferent, if i use UE or patch trek.exe manually. i have always the same problem like already stated above. it's really strange. and i always used fresh trek.exe and stbof.res for testing.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Shipname Appendix Fix & Adding new name groups

Post by thunderchero »

unless you have a patch for Adding new ship name groups, patcher will not show changes.

? have you created a new group with UE and tested?
Post Reply

Return to “Shipname Appendix Fix & Adding new name groups”