Topic: Hex Editing of Starfleet executables  (Read 204563 times)

0 Members and 4 Guests are viewing this topic.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #40 on: December 30, 2014, 09:58:54 am »
I can't read hexidecimal so it is all just number sequences to me.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #41 on: December 30, 2014, 10:32:47 am »
It'd be nice to check the seeking weapon reduced damage due to ECM chart too. All the games should be the same in that regard, unless something is broken/unfinished in EAW.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #42 on: December 30, 2014, 10:54:05 am »
DesireGameSpeed....DesireTurnRate....DesireChargeRate


I have no clue what this is.
32   43 96 00 00   300
36   43 34 00 00   180
40   43 20 00 00   160


These might be the turn modes for all ships, but not shuttles/fighters, PF's (AA) or FRD and  DEFSATS (F) or bases (G) which might be handled elsewhere.
44   42 F0 00 00   120  Either Turn Mode A or E?
48   42 B4 00 00   90    Either Turn Mode B or D?
52   42 70 00 00   60   Turn Mode C?
56   42 20 00 00   40    Either Turn Mode D or B?
60   42 0C 00 00   35    Either Turn Mode E or A?


These could possibly be charge rate by turn since nothing takes more than three turns to charge.
64   41 F0 00 00   30  3 Turns?
68   41 C8 00 00   25  2.5 Turns? (I think the ESG takes 2.5 turns, but I haven't used one in awhile)
72   41 A0 00 00   20  2 Turns?
76   41 20 00 00   10  1 Turn?
« Last Edit: December 30, 2014, 11:07:30 am by Corbomite »

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #43 on: December 30, 2014, 11:07:14 am »
AFAIK acceleration can be set to any positive integer. Here's the one's that I pulled from OP+: 2,3,4,5,6,7,8,10,15,18,25. I don't see a pattern match here.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #44 on: December 30, 2014, 11:13:56 am »
You know it could be as simple as game speed 1-11 and pause. There are 12 entries anyway.

Offline Nemesis

  • Captain Kayn
  • Global Moderator
  • Commodore
  • *
  • Posts: 13064
Re: Hex Editing of Starfleet executables
« Reply #45 on: December 30, 2014, 12:30:47 pm »
Your Chart for Heavy Disruptors

Range:   0   1   2   3-4   5-15   16-22   23-30   31-40
To Hit:   100%83%   83%   67%   67%   67%            50%           33%
Damage:   10   10   8   8   6   4              4             4

What I gather from the exe code

Range:   0-1   1-2   2-3   3-5   (5-9)(9-16)   16-23   23-31   31-41

Damage:   10   10   8   8     6       6              4              4             4
Damage:   10   10   8   8     6       6              4              4             4
Damage:   10   10   8   8     6       6              4              4             0
Damage:   10   10   8   8     6       6              4              0             0
Damage:   10   10   8   0     0       0              0              0             0
Damage:   10   0   0   0     0       0              0              0             0

then it continues with overloaded values. what do you think corb? any significant difference

But that chart has six entries to simulate a D6 being rolled, then you calculate damage (which can be none) based on range. To Hit/Damage weapons roll a d6/2d6 to determine if the weapon hit or not, then damage is assigned based on several factors (like Phots not degrading over distance and Dizzys/Hellbores doing so).

Unless they used a common function to handle the roll for all weapons.  Then this chart would be needed for reading out the damage in the same format as all direct fire weapons.  If so then there should be a chart for all such weapons even the attack probe. 
Do unto others as Frey has done unto you.
Seti Team    Free Software
I believe truth and principle do matter. If you have to sacrifice them to get the results you want, then the results aren't worth it.
 FoaS_XC : "Take great pains to distinguish a criticism vs. an attack. A person reading a post should never be able to confuse the two."

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #46 on: December 30, 2014, 01:29:25 pm »
Let's assume Nem is right and see what we have here.

The whole range numbers probably mean to .99, where 0-1 really means 0.00-0.99 etc. So at range 0 you have a 100% chance to hit, which means 10 points of damage because you are eligible to light up all the selections in column one of the coded chart.

From ranges 1-3 you have an 83% chance to hit so you are eligible to light up five out of six selections in columns two and three, with their respective damages based on range.

From ranges 3-23 you have a 67% chance to hit so you are eligible to light up four out of six selections in columns four, five, six and seven, with their respective damages based on range.

From range 23-31 you have a 50% chance to hit so you are eligible to light up three out of six selections in column eight, with its respective damage based on range.

From range 31-41 you have a 33% chance to hit so you are eligible to light up two out of six selections in column nine, with its respective damage based on range.



I'm beginning to think that the extra bracket at the OL juncture has something to do with interacting with the OL cuttoff for range.







Heavy Disruptor:


Arming Rate: 1 Turn


NOTE: Heavy Disruptors are able to occasionally "leak" a small amount of damage through shields. O/L Heavy Disruptors fired at range 0 will do a feedback damage of 4 to the shield facing your target.


Range:________0______1______2_______3-4______5-15______16-22______23-30______31-40___
Normal
To Hit:    100%    83%     83%      67%       67%        67%        50%        33%
Damage:      10     10       8        8         6          4          4          4
Range:________0______1_____2-4______5-8___
Overload
To Hit:    100%     83%    83%      83%
Damage:      20      20     16       12




Sample of exe code:


Range:   0-1   1-2   2-3   3-5   (5-9)   (9-16)   16-23   23-31   31-41
Damage:    10    10     8     8      6       6       4       4       4
Damage:    10    10     8     8      6       6       4       4       4
Damage:    10    10     8     8      6       6       4       4       0
Damage:    10    10     8     8      6       6       4       0       0
Damage:    10    10     8     0      0       0       0       0       0
Damage:    10     0     0     0      0       0       0       0       0

« Last Edit: December 30, 2014, 01:45:00 pm by Corbomite »

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #47 on: December 30, 2014, 01:59:30 pm »
You know it could be as simple as game speed 1-11 and pause. There are 12 entries anyway.

I will have to experiment and evaluate what I see. How long does one turn take at speed 7. But you may be right.
Default for game speed 7 is 35 seconds per turn. Speed 8 is 30 seconds per turn.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #48 on: December 30, 2014, 02:10:28 pm »
It'd be nice to check the seeking weapon reduced damage due to ECM chart too. All the games should be the same in that regard, unless something is broken/unfinished in EAW.
In EAW, single-player mode uses a chance-of-reduced-damage chart, but multiplayer doesn't. When I find the bytes in Community Edition, I'll try to enable it for multiplayer...

As a refresher: Roll a d6. Add the Attack Shift to it. Consult chart.

Total   |  Damage Multiplier
1-6     |         1.00
7-8     |         0.50
9-10    |        0.25

« Last Edit: December 30, 2014, 03:46:05 pm by TarMinyatur »

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #49 on: December 30, 2014, 02:11:22 pm »
You know it could be as simple as game speed 1-11 and pause. There are 12 entries anyway.

I will have to experiment and evaluate what I see. How long does one turn take at speed 7. But you may be right.
Default for game speed 7 is 35 seconds per turn. Speed 8 is 30 seconds per turn.


Let's assume Tar is right and see what we have here.

32   43 96 00 00   300 Pause, it might indicate Speed 0, but I wouldn't know why.
36   43 34 00 00   180 Speed 1
40   43 20 00 00   160 Speed 2
44   42 F0 00 00   120 Speed 3
48   42 B4 00 00   90   Speed 4
52   42 70 00 00   60   Speed 5
56   42 20 00 00   40   Speed 6
60   42 0C 00 00   35   Speed 7
64   41 F0 00 00   30   Speed 8
68   41 C8 00 00   25   Speed 9
72   41 A0 00 00   20   Speed 10
76   41 20 00 00   10   Speed 11





Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #50 on: December 30, 2014, 07:27:46 pm »
I believe the AI's great reluctance to use electronic warfare (EW) can be improved in Community Edition. Dave Ferrell, 12 years ago, wrote that the game's internals multiply the external speed and range by ten. I had forgotten that nugget of info. Something may be off by a magnitude of ten in the EW department.

I suspect that the AI uses 30.0 (instead of 3.0) to determine the range at which to abandon ECCM and ECM. Most weapons are probably going to hit at ranges less than 3, so the AI seems to invest in shield reinforcement instead (which is guaranteed to absorb damage). But the AI thinks you're at range 1.5 when you're really at range 15, and it has therefore given up the EW game. Pull away to range 35, and it will start to generate ECM.

However, at ranges greater than 30, and with abundant energy, the AI is excellent at the ECM/ECCM game. First, it will negate your ECM, point-for-point. Second, any remaining EW power will go towards ECM. Third, it checks to see if it is wasting energy. If you put up 6 ECCM, it will never maintain 6 ECM, so it stops using ECM. If it can't quite gain a +2 shift, it reduces its ECM to be exactly 1 more than your ECCM. Very efficient. Well programmed.

I could, of course, be completely wrong.

I'll look for the low-hanging fruit in the binary...

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #51 on: December 30, 2014, 09:59:02 pm »
Adam, 31 isn't the top speed for all ships. Battleships can only reach 30.5.

Warp energy is somewhere restricted to whatever amount is needed to reach a speed of 30.

Impulse engines can add 0.5 to a Battleship's speed. Smaller vessels can gain 1 when they are at maximum tactical warp speed. (In fact, a frigate lacking warp engines can move at a speed of 3 instead of 1.)

I found the location which controls the capacity of the speed control. Search for 31.0f. Since it is a gauge, it doesn't get multiplied by ten.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #52 on: December 31, 2014, 02:46:54 am »
Some values such as max overload range may have been programmed as constants in one location.  I don't know how this would translate to the binary but I'm sure it has some type of effect (not a programmer but know some theory).

I figured it out tonight. There is no constant for [some] overloaded weapons! The programmers defined the maximum overload range as a specific bracket for each weapon, not a specific distance. I haven't yet located the bytes that determine the displacement in the array of floats. (Some OL weapons are indeed limited in range by the constant 90.0f)

I am able to fire Overloaded Disruptors from range 11.99 by modifying the existing  5-8 bracket to encompass 5-11. Reducing the maximum overload range is also possible. Lots of moddability here.

In other news, the rate-of-fire for Phasers has been located. It is defined as turns per shot, rather than shots per turn. The icons that show the state of charge aren't proportional.
« Last Edit: January 20, 2015, 12:56:21 pm by TarMinyatur »

Offline Javora

  • America for Americans first.
  • Commander
  • *
  • Posts: 2999
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #53 on: December 31, 2014, 07:18:39 am »
You guys are awesome.  I wish I had time to try this out.  It's amazing how fast you all are unraveling all the threads to this game.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #54 on: December 31, 2014, 10:25:21 am »
Wow! That was quick in breaking the 31 barrier. Reverse? That would be intriguing. Blackholes somewhat work in that manner...

Here's the Community Edition section that determines Phaser cycles. 4-byte floats of 00 00 80 3F (1.0f). I set Phaser-2's to 0.5 and they could fire every 15 seconds. Its icon's state of charge would jump from 50% to 100% on the final split second.

Like you wrote, the charge cost for Phasers needs to be found so that low-power, low-yield, rapid-fire weapons can be created. The Ph-G exists, but it obeys Shift-Z, so it isn't quite the same.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #55 on: December 31, 2014, 11:10:37 am »
I noticed that my ship can't turn at speeds greater than 31.99 because that turn mode is currently undefined. Actually, I like this consequence. If you want to sail really fast, you lose your rudder. Feels like emergency warp.

Offline Nemesis

  • Captain Kayn
  • Global Moderator
  • Commodore
  • *
  • Posts: 13064
Re: Hex Editing of Starfleet executables
« Reply #56 on: December 31, 2014, 01:24:23 pm »
Id like to also find the shield regeneration which if memory serves me is associated with the labs. Not sure but hopefully I can get that too.

That matches my memory too. 
Do unto others as Frey has done unto you.
Seti Team    Free Software
I believe truth and principle do matter. If you have to sacrifice them to get the results you want, then the results aren't worth it.
 FoaS_XC : "Take great pains to distinguish a criticism vs. an attack. A person reading a post should never be able to confuse the two."

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #57 on: December 31, 2014, 02:52:59 pm »
Id like to also find the shield regeneration which if memory serves me is associated with the labs. Not sure but hopefully I can get that too.

That matches my memory too.

Each Shield arc regenerates 0.3 + (0.1 * Labs) per turn. As a ship's labs get destroyed, the rate decreases until it reaches the minimum of 0.3 per turn. This formula is for EAW, so OP could be different. (The number 0.1f is in the binary file as "CD CC CC 3D".)

So the Enterprise, with her 8 labs, regenerates up to 6.6 shield "boxes" per turn, 1.1 per arc. Not too shabby for the 2 points of power required to raise shields. A ship like the War Eagle, with her 2 labs, only regenerates up to 3 shield boxes per turn, 0.5 per arc.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #58 on: December 31, 2014, 05:12:51 pm »
If you increase the 0.3f base then that levels the playing field. If you increase the 0.1f lab multiple, that favors ships with many labs.

So, if you double the lab multiple...

0.3 + (0.2 * Labs) = 1.9 per arc for the Enterprise which has 8 Labs.


If you double the base regeneration rate...

0.6 + (0.1 * Labs) = 1.4 per arc.


If you double both...

0.6 + (0.2 * Labs) = 2.2 per arc.

The last one could make the ship a really tough nut to crack using any long range sniping. Only crunch weapons could overcome that sort of regeneration. The Enterprise can present 3 different shields and still keep the enemy in its crosshairs, spreading damage across all three facings.

SFC1 had a maximum regeneration rate of 2 points per arc per turn. Ships with 4 or more Labs got a +1 bonus. All ships had a base rate of 1.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #59 on: December 31, 2014, 07:42:44 pm »
You are welcome, Adam.

I unexpectedly found the Maneuverability constants while looking for the shield regeneration rate.

I added Warp Tacs and Sub-light Tacs by modifying the speed 5 entry. (Ships that devote the Warp energy required to move at a speed of 4 plus 1 Impulse engine can instead make five 60 degree pivots instead of moving linearly.)

Look for this sequence in the binary: CD CC 4C 3E CD CC 4C 3E 9A 99 99 3E CD CC CC 3E

Those are the first four rotational constants ( 0.2f, 0.2f, 0.3f, 0.4f ), for non-inclusive speeds 1, 2, 3 and 4. Again, this means 0.99, 1.99, 2.99, and 3.99. The next 29 floats are for speeds 5 to 33.

Each "turn class" has a currently unknown value (AA, A, B, C, D, E) that is multiplied by these rotational constants. Thus a frigate turns a little quicker than a destroyer. And a destroyer turns a little faster than a cruiser. The difference is about 10% from class to class.

Orion Pirates may be different because of Plasma-X. It may have an entry for speeds up to 40.