Gowron wrote:During combat, a ship is designated as "unarmed" if its minimum beam range is equal to zero.
viewtopic.php?f=208&t=79#p596
Apart from this are we sure the 'beam minimum range?' at shiplist.sst +0xDC is actually used?
The 'minimum range?' for beam-weapons of space stations is not read from shiplist.sst but fixed in trek.exe (default -1):
Code: Select all
005224B5 mov dword ptr [eax+210h], 0
005224BF mov dword ptr [eax+214h], 0BFF00000h
Since -1 is cosine of pi (fcos function interprets values as radians) this would be 360.0 degree in shiplist.sst.
'Minimum range?' for beam-weapons of ships & monsters from shiplist.sst gets coverted into radians via *pi/360 (stations & 'plasma?' not):
Code: Select all
584CEC BeamMinRange_x_0_5 // * 0.5 = /2
584CF4 BeamMinRange_x_pi // * pi
584CFC BeamMinRange_x_0_005p // * 5/900 = /180
Unlike stations the fcos function is applied before storing.
'Minimum range?' for 'plasma?'-weapons of ships in trek.exe at:
Code: Select all
584D04 PlasmaMinRange_0_3926990816987238 // radian PI/8 for fcos function equals 45.0 degree in shiplist.sst
Note that all shiplist.sst values mistakenly referred to with 'plasma'(they are not connected with plasma.hob files) are only used for ships (not stations & monster).
Phaser/plasma switch is in the trek.exe ship slot at +0x10 (0 = use phaser / 1 = use plasma). The info here is false:
viewtopic.php?f=150&t=3321#p44235
1. Shiplist.sst +0xDC is an angular degree, converted into radians for fcos function (e.g. degrees/cos = 0/1 180/0 360/-1).
2. The calculated cosine values don't seem to be used but instead values depending on trek.exe phaser-slots.
Trek.exe Phaser Slot values
Sub_52C548 assigns each slot four values depending on set bits:
for C0 (Turret?) set values 1-4 to 1 / 0 / 0 / -1 (360 degree) and exit
for all other calculate values 1-3 using radians A & B:
(remove bits 7-8)
only bit 5 set radian A = 0 & radian B = 0.5pi
only bit 6 set radian A = 0 & radian B = -0.5pi
else (remove bits 5-8) and set radian A for:
0h = not set
1h = 0
2h = pi
3h = not set
4h = 1.5pi
5h = 1.75pi
6h = 1.25pi
7h = not set
8h = 0.5pi
9h = 0.25pi
Ah = 0.75pi
B-F= not set
then check bits 5 & 6 for radian B:
0 or both -- radian B = 0
only bit 5 - radian B = 0.25pi
only bit 6 - radian B = -0.25pi
Calculate values 1-3:
1 = cosine radian A * cosine radian B
2 = sine radian A * cosine radian B
3 = sine radian B
then check bits 7 & 8 for value 4 (firing arc):
0 or both set 0.5 = 120 degree (Beam/Emitter Banks?)
only bit 7 set 0.866 = 60 degree (Dual & Heavy Cannons?)
only bit 8 set 0 = 180 degree (Beam/Emitter Array?)
Have the phaser slots in hob.files a direction value (e.g. rear/aft-mounted or up/down) or is the direction set by radians A & B?
Bits 1-8 (read from right to left):
https://kb.iu.edu/d/afdl
Code: Select all
1 - forward
2 - rear
3 - right
4 - left
5 - up
6 - down
7 - narrow firing arc
8 - wide firing arc
In theory one could use different firing arcs for Heavy Cannons, Beam Banks, Arrays or Turrets on the same ship.
Unfortunately the game development stopped before different weapon types, strengths and animations could get assigned to specific weapon slots of the ship model.
- no torpedo and/or unkown ship hob slots
- phaser & plasma hob are mutually exclusive and share same ship hob & trek.exe slots
- the second energy weapon (galaxy class 2 default) has no ingame display for stats, issues when paired with main phasers and shares the phaser/plasma setting