Trek.exe Ship Slots (for 3D sfx)

Trek.exe Ship Slots; support/discussion/questions

Moderator: thunderchero

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

Trek.exe Ship Slots (for 3D sfx)

Post by Spocks-cuddly-tribble »

Increasing number of trek.exe ship slots:

Code: Select all

004A28AE                 mov     ecx, offset 5919FC // asm base address (not for TMP!)
004A28CA                 cmp     ebx, 49h // number of read slots (without TMP)
The whole data block can be moved to any location. Bytes needed = 0x30 * number of read slots(without TMP) -> vanilla 0xDB0 (0x30*0x49)


Optimizing usage of TMP slot:

The TMP slot is used for all ships missing on the list (it's unused in vanilla, maybe it was just a safeguard for testing purposes).

An example how to make use of it:

Say a mod uses 100 different ship designs (HOBs) with 50 of them being standard models with 8 phasers, norm scale & no special slots like damage spots.

Add only the 50 non-standard HOBs to the slot list (more shared slots = shorter list, means a faster code, but should be insignificant). Now just adjust number of read slots and edit the TMP slot for 8 phasers & standard scale and you're done.


Structure of the trek.exe ship slots: (length 0x30 each) -> ??? +4/+8 = unused weapon slots and special switch - no trek.exe code

Code: Select all

+0x0 = name of Hob file
+0x4 = ??? most 1;  CS, TT, rom: Warbird HCII, YS & CalCryGoTaCho=0; defiant EdoGod=2; sovy=4, outpost=7, starbase=0,1, 3 or 4 
+0x8 = ??? most 0, some card fer kling rom & Gal-X Sovy Defiant = 1 
+0xC = number of weapon slots (phaser, plasma or Gomtuu effect)
+0x10 = plasma switch marker
+0x14 = number of damage spots -> for scar1.hob & explosions
+0x18 = special damage texture switch marker for starbases -> d*s_b.gif (a bit bugged)
+0x1C = exe scale
+0x20 = phaser/plasma slots (16 max - in order of the hob slots) ->  bitmask for vectors and firing arcs (see below)
List of the 26 valid direction values: (default firing arc 120 degree, for narrow 60 degree add 0x40, for wide 180 degree +0x80)

01 F - Fore
02 A - Aft
04 S - Starboard (right)
05 FS
06 AS
08 P - Port (left)
09 FP
0A AP
10 U - Up
11 FU
12 AU
14 SU
15 FSU
16 ASU
18 PU
19 FPU
1A APU
20 D - Down
21 FD
22 AD
24 SD
25 FSD
28 PD
26 ASD
29 FPD
2A APD

C0 All directions (360 degree arc)

Other trek.exe references wrt ship hob files:

- 0x17B158 (one for each empire, minors share fed entry) will be used if hob name read from shiplist.sst is not in stbof.res, stations & monster use Hs.hob [57D68C] (another safeguard for testing purposes)

- 0x1809A8 are used for the screensaver: (errors = crash)

Code: Select all

00501991                 mov     ecx, 46h // 70 hob files
0050199E                 mov     ecx, 47h // 71 -> next iteration
00501A08                 mov     ds:5966C8, 46h // 70 hob files
00501A1A                 mov     ebx, 47h // 71 -> next iteration
Some open questions:

- rlitanim.hob & laser.hob? -> rlit.vtx & laser.vtx -> no effect when removed from stbof.res? (vtx reference in sub_53CD90)

- trigger situation/code for the borg t01e.gif (smiley)?
Last edited by Spocks-cuddly-tribble on Fri Sep 15, 2023 5:36 pm, edited 7 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: 7849
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Trek.exe Ship Slots (for 3D sfx)

Post by thunderchero »

Very nice find being able to use the TMP slot for all matching ship scale/phasers. I just tested with all major ships replaced with models from UDM3.0.1 ship pack added and then disabled all the major races slots by changing C** -> A** for all slots and no crashes so far. :D this should help tethys with his add every thing mod (AKA Galaxy mod) lol :wink:

Note; be careful when doing this UE will move TMP slot (up one slot) due to unused slot moved to last slot 8O

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: Trek.exe Ship Slots (for 3D sfx)

Post by Tethys »

Funny we had a conversation about ship slots just the other day, I think I used the TMP slot however. I believe it now has 3 models.. lol
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: 7849
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Trek.exe Ship Slots (for 3D sfx)

Post by thunderchero »

Tethys wrote:Funny we had a conversation about ship slots just the other day, I think I used the TMP slot however. I believe it now has 3 models.. lol

So..... if you rename it to TMP and use 150% scale and 8 phasers on that slot, every other slot that used 150% scale and 8 phasers could be used for a different ship.

thunderchero
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Re: Trek.exe Ship Slots (for 3D sfx)

Post by Peter1981 »

@SCT this is very intresting and exciting infomation -- Kudos!
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Re: Trek.exe Ship Slots (for 3D sfx)

Post by DCER »

thunderchero wrote:Note; be careful when doing this UE will move TMP slot (up one slot) due to unused slot moved to last slot 8O
This is now fixed in 0.7.1b and 0.7.2dev4. It was caused by auto-fixing duplicate slots and placing them at the end of the list. Duplicates will still get fixed but now stay in the same place.

In the original trek.exe there is no slot 0 instead there are two slots names HM1. UE will auto-rename the second one to 0.
Post Reply

Return to “Trek.exe Ship Slots”