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

0 Members and 3 Guests are viewing this topic.

Offline JanB

  • Lt. Junior Grade
  • *
  • Posts: 103
Re: Hex Editing of Starfleet executables
« Reply #80 on: January 02, 2015, 08:04:29 pm »
Just discovered that the SFC3 romulan disruptor isn't entirely hardcoded: inside SFC3.exe there's a reference to fx_mauler_beam.bmp in the texture folder, this doesn't exist but you can create it. If you copy the phaser1.bmp file and rename the copy to fx_mauler_beam.bmp you can manipulate the thickness of the beam, if you apply a color to the texture you can somewhat manipulate the color of the beam.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #81 on: January 02, 2015, 08:10:59 pm »
We know that impulse is "broken" since we don't get the obligatory one unit of movement for one point of impulse, regardless of size and number of impulse engines generating power since they tied all propulsion into one function; might this be the impulse size class conversion rates?

48   40 80 00 00   4
52   40 00 00 00   2
56   3F C0 00 00   1.5
60   3F 80 00 00   1
64   3F 40 00 00   0.75
68   3F 00 00 00   0.5

Seems to fit.

What about a ship like the old Federation CL? We would need a 1.33 in there, right? 4 hexes for 3 energy, or, 1 Impulse Engine can move it 4/3 of a hex, 1.33. Maybe that's nearby.

I'll check it out. If it's only found in OP, then it might be an Orion Engine Damage thing. Thanks, Corbomite.


The more I think about it the more I don't think I'm right. If all propulsion is tied to the changeable speed/size conversion formula used in the shiplist, then static conversions for impluse are irrelevant and the amount of movement you get from one point of impulse will vary just like warp. Impulse is just limited to one point allowed for movement. It very well may be something tied to pirate ships though. Seeing it/not seeing it it CE will be a clue.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #82 on: January 02, 2015, 08:19:34 pm »
Can these fixes be applied to CE?  Now that we have more eyes combing over the code maybe we can fix the many bugs that plagued this game over the years.  Or get the OP code into CE even.  Can we put these programs up for download once these guys are done?
Putting OP's features into CE is going to be difficult to impossible. I can't make more room in CE for OP's extra features -- not even a single byte (unless there is dead wood in the binary). Players can, however, add an approximation of one of OP's weapons to CE. But they have to sacrifice an existing system. For instance, I can imagine an alternative role for the Disruptor4. It gains strength the further away it's fired from its target (harvesting energy from the traces of matter along the way, E=MC^2). It has excellent performance at long range, but up close, it does no damage. The Disruptor3 is still there for regular duty. At the moment, all Disruptors inherit the same energy costs and rates-of-fire. That might be changeable.

As far as distribution of modified executables....?

I guess it would be similar to getting Firesoul's OP+ or Bonk's SFB_04 or Chris Jones' TNG. Download and use at your own risk. And then you're free to modify them as you see fit. This community has maintained high standards for more than 15 years. Nobody worries that fan-made modifications to Starfleet Command's assets are malware. Adam and I want these games to thrive, nothing more.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #83 on: January 02, 2015, 09:03:40 pm »
Interesting.

A default Plasma-R costs 3 points to charge and to hold. It requires three turns to charge fully.

If it is modified to require just one turn to arm. Do the arming and holding costs triple? Both go from 3 to 9?

Or perhaps you simply changed the arming cost? If the launcher sees 9 energy flowing in, it obeys, and finishes the torpedo in one turn. You may have fast-loaded that Plasma-R via a higher energy input rather than through a modification to a timer.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #84 on: January 02, 2015, 09:42:50 pm »
Adam, you changed one  number and the power of the ship increased by 24?

What was the original value? What is the new value?

How many Warp, APR, and Impulse does that ship have?

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #85 on: January 02, 2015, 09:44:37 pm »
Just discovered that the SFC3 romulan disruptor isn't entirely hardcoded: inside SFC3.exe there's a reference to fx_mauler_beam.bmp in the texture folder, this doesn't exist but you can create it. If you copy the phaser1.bmp file and rename the copy to fx_mauler_beam.bmp you can manipulate the thickness of the beam, if you apply a color to the texture you can somewhat manipulate the color of the beam.
Nice discovery, Jan.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #86 on: January 02, 2015, 10:37:50 pm »
Thanks for that example. You increased the Plasma-R charge cost from 3 to 9. You may also have affected any other system that happens to use that constant. What else might use a 3? I can't think of any systems...the old Hellbore, but the new Hellbore uses 2.5.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #87 on: January 02, 2015, 11:22:34 pm »
I'm sure you'll find the Plasma cycle. It may be one of the 0.33 or 0.33333333 floats. We know phasers use periods. So I think it is likely that Plasma and Hellbores, and Photons all use the same convention. Bigger numbers = shorter cycles. What's the longest weapon cycle in the game? Nothing takes four turns.

Plasma = 3
Photon, Hellbore, Phas-A/B, Plas-F in a larger launcher, PPD = 2
Fusion is weird, 1 to charge, but 1 turn to cool off.
ESG = 1.5
Disruptor and Phaser = 1

So the inverse of those are: 0.33, 0.50, ??, 0.67, 1.00.

Maybe that sequence will show up someday, or it could be scattered.

(Found the Wild Weasel launch speed tonight. They don't have to be launched at top speed. I recommend 3.5 so they don't detonate mines. Suicide Shuttles also use this speed.)
« Last Edit: January 03, 2015, 02:54:17 am by TarMinyatur »

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #88 on: January 03, 2015, 07:37:05 am »
Corb, can you please tell me the cost to charge and hold plasmas, all the OP ones, my book says the R cost 9 for 3 turns and holding is 5. Is the book accurate.


All costs are per turn over three turns except fast F-Torps which are over two turns. Repeating decimals are rounded since the energy display shows two values for energy used, one rounded, one not. I'll leave it to you guys to discover just exactly which is reading correctly based on the actual usage cutoff:


             ___Normal Charge______Normal Hold______Overload Charge______Overload Hold___
Type:
    X                    3                  5                    NA                   NA
    E                  2.5                  1                    NA                   NA
    R                    3                  3                  4.67                    5
    S                 2.67                  2                     4                    4
    G                 2.33                  1                  3.33                  2.5
     F                 1.67                  0                    NA                   NA
Fast F                  2.5                  1                    NA                   NA

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #89 on: January 03, 2015, 03:43:49 pm »
I'd like to find the numbers that control the firing rate so that a modified Plasma-"R" which has a charge cost of 9 doesn't charge in one turn. It would take 27 total energy to arm. So somewhere the conversion rate (if there is one) would need to be divided by 3 in this case. Or perhaps the total energy is stored somewhere...

Plasma,  Total energy
F = 5
G = 7
S = 8
R = 9
EPT-G = 10
EPT-S = 12
EPT-R = 14

I'll look for these.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #90 on: January 03, 2015, 04:51:55 pm »
I found the Plasma arming rate in an indirect manner. There are two numbers that are involved. The first is the per turn charge cost (3.0f for a Plas-R) that you know about.

The second is the total energy required to complete the torpedo(14.0 for an EPT/Defensive Plas-R, the biggest torp).

I found the second component by searching for 14.0f. There aren't many of those.
I also found 12.0f adjacent to it, probably the EPT/Def Plas-S total energy.

So the little plasma icon compares the current energy deposited, let's say 3.0f, with the total energy needed, let's say 9.0f for a regular Plas-R. It divides 3/9 to determine the fraction complete. Thus the icon will show about 1/3rd in full color, the rest will be pale.

Tested in game an EPT-R that had a total energy requirement of 24. It took about 5 turns to finish. The icon was accurate.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #91 on: January 03, 2015, 07:07:24 pm »
Yes, EPT means Enveloping Plasma Torpedo. Defensive means Shotgun.

If you increase the total energy requirement, then the torpedo is going to take longer to complete.

For example, the Plas-R has a total energy requirement of 9.0f. I get that number by multiplying the charging cost (3.0f) by the default amount of turns (3) needed to arm the torpedo. I don't know the location of that 3. I know it from playing the game, just as I know Photons take 2 turns to finish charging.

The charging icon looks at the amount of energy accumulated so far. It compares it to the total requirement. If it has 4.5 energy in the bank, then you still need to contribute another 4.5 energy. It will show as halfway there, 50%.

If I modify Plas-R to require a total investment of 18.0f energy, then it will take 6 turns to complete. You follow? Every turn it puts in a default of 3.0f. After 6 turns, it will have 18.0f energy.

So in this example, the charging cost hasn't been modified. The time needed to charge the torpedo has tripled doubled. The amount of energy invested has also tripled doubled. This is a bad situation for the War Eagle! The Plas-R's damage hasn't increased at all.
---

New situation. If I lower the charge cost for the Plas-R from 3.0f to 1.0f, the War Eagle can charge a default torpedo (which needs the regular 9.0f of energy) at nearly top speed while cloaked. It will, however, take 9 turns to do so! (1.0f per turn * 9 turns = 9 energy invested). That's the trade off -- less energy per turn means more turns to finish the job. The icon will be at 11% after one turn, 22% after 2 turns, etc.

Clear as mud?
I know it's confusing.

[Edited for a mistake.]

Offline EschelonOfJudgemnt

  • Lt. Junior Grade
  • *
  • Posts: 259
Re: Hex Editing of Starfleet executables
« Reply #92 on: January 04, 2015, 12:57:36 am »
OK, I have a fun one for you guys to try and find...

OP limits the shiplist to 16 (8 empire + 8 pirate).  Any chance that's coded somewhere in the editable stuff?  Also, I seem to remember there being an absolute cap on the number of ships that can be on any given empire's shiplist...

I bring this up for those Tholian and Andromedan lovers out there.  We may not be able to get webs and PA panels, but I'm seeing some interesting options for Andros (giving them a buttload of labs to increase their shield regen rate, as a poor man's simulation of PA panels bleeding energy off, also giving Andros some sort of movement advantage in place of the Displacement Device).

Since OP has the 'X' weapons, some of those could be repurposed as other weapons that function in a similar fashion to the existing weapons, i.e. replacing the 'cheese weapons' with other unique weapons.  While I don't necessarily see someone wanting to introduce Seltorians, etc, well this kinda opens up the door for exactly something along those lines...

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #93 on: January 04, 2015, 03:29:15 am »
EoJ,

I'm guessing that certain limits in the shiplist may be imposed by the type of data that stores it. Some variables can only accept 256 values, they are 8-bit. I don't believe I can change that variable to be 32-bit, able to hold billions of values. (Firesoul might know.) Even if I tweaked that number, the program wouldn't be able to process a billion or a thousand Frigates. I think any FF after the first 256 would be ignored.

Adding an extra empire to the game is close to impossible. There is no interface to access the Seltorians or Jindarians. You'd have to remove an existing faction. Years ago, I replaced every reference to Mirak with Kzinti. That doesn't require any .exe editing.

Maybe the .exe could look for Andromedans in the shiplist so that they aren't mingled with a host empire. That would be neat. But I can't envision a way to scroll though more than 8 empires, well...there is that "none" slot...which makes a one-time appearance. Hmm.

I'm beginning to see more shared constants than I had hoped for. You can't change the Overload cost for Photons without it affecting the cost of OL Disruptors and standard PPDs. This also affects the rate-of-charge of the standard Photon and UL PPD.
Even so, there's a boatload of mods to be created.

Accuracy and Damage Tables are better isolated.

Offline JanB

  • Lt. Junior Grade
  • *
  • Posts: 103
Re: Hex Editing of Starfleet executables
« Reply #94 on: January 04, 2015, 11:06:28 am »
Could one of you email me the SFC2 exe and sprites.q3 files (zip or rar them so they don't get mistaken for malware)? I'd like to compare parts of them to the corresponding parts in the exe and sprite files from SFC3, especially considering there are more stock shuttles in SFC2 than SFC3, but also in general a comparison between these versions might be useful to spot certain patterns. If any of you like to have the SFC3 files I could email them to you in return.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #95 on: January 04, 2015, 03:40:38 pm »
Gotta got to work, but anyways, if memory services me, Corb, Need your brain, these numbers multiplied by 100 represent the HB percentages on the chart

64   3C E3 BC D3   0.0278
68   3D AA CD 9F   0.0834
72   3E 2A B3 68   0.1667
76   3E 8E 3B CD   0.2778
80   3E D5 59 B4   0.4167
84   3F 15 59 B4   0.5834
88   3F 38 E8 A7   0.7223
92   3F 55 59 B4   0.8334
96   3F 6A AC DA   0.9167
100   3F 78 E8 A7   0.9723

Corb, last column, 97,92,83,72,58,42,28
Am I right



Mostly a match, but lines 64, 68 and 72 seem to be part of a different data block.

Hellbore:


Range:___ ___0-1_______2___ ____3-4_______5-8_______9-15_______16-22____ ___23-40

To Hit:______97%___ __92%___ __83%______72%______58%___ ____42%________28%

Normal
Damage:__ __ 20_______17_______ 15_______ 13_______ 10__________8_______ ___4__

Overload
Damage:_____30_______25________22___ ____19____ ___NA_________NA_____ ____NA_


Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #96 on: January 04, 2015, 03:44:52 pm »
Jan, you may be better off downloading a working copy of EAW, CE, or OP. Then you can manipulate data and observe the results.

There are backups of the EAW and OP exe on this website under "Downloads" on the root page.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #97 on: January 04, 2015, 03:55:04 pm »
If so, then you should find a corresponding range/damage generator that has entries in those fields. It may well be so that the HB's can go farther than 40, but are just limited from firing by another mechanism.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #98 on: January 04, 2015, 03:59:59 pm »
I think the 2d6 values go below 28% because of ECM attack shifts. The game needs to know what to do with a range 40 Hellbore fired into an attack shift. It can't subtract 16.6% for each shift because it is based on 2d6, not 1d6.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #99 on: January 04, 2015, 04:17:59 pm »
Except those numbers only have allowances for a shift of 3 when 4 is the total shift OP can have (19pts of ECM). Any shift at a range of 23-40 should automatically miss anyway. It may just be that you must complete a random number generator (for the computer) even if you won't be accessing all the data points in the spread.