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

0 Members and 1 Guest are viewing this topic.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #120 on: January 08, 2015, 04:21:14 pm »
I found and reported the charge rate (7.0f) for Suicide OL Fusion Beams in OP. I believe that their total energy is defined as the charge cost, so you'll never find that data. TotalEnergy = ChargeRate. You may not be able to mod them to fire faster than once per turn. (I'm not saying it's impossible. Maybe there's a 1.0f that affects the rate of fire.) The same idea may apply to Disruptors.

The hold cost, however, is defined as 1/2 of the charge rate. So you'll never find a particular 3.5f associated with Suicide Overloads. I modified the charge rate to be 14 and the resultant hold cost was 7. It charged in one turn.

The odd thing about Fusions is that they have a range 3-10 bracket. This exceeds the regular overload range by 2. Something is shortening this bracket to 3-8 for Overloads (but not for SOL's). I guessed that maybe the 3rd bracket was being subtracted from the 4th, but that isn't the case.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #121 on: January 08, 2015, 07:33:51 pm »
Nice to see the Gorn logo in SFC3, JanB! I'm glad you're making good progress. That's excellent.

Adam, I was able to break the link between OL Plasma-S and OL-PPD. They shared a total energy of 12.0f. So I overwrote some nulls with 14.0f and then changed the first reference to the original data to the segment address of the new data. Tested this in-game...the weapon systems are truly independent now. :-)

I didn't understand segment addresses until tonight. They are little-endian.

I can continue my work on Community Edition.

Offline JanB

  • Lt. Junior Grade
  • *
  • Posts: 103
Re: Hex Editing of Starfleet executables
« Reply #122 on: January 08, 2015, 09:44:27 pm »
On a side note I tried to fix some minor SFC3 issues. I wanted to change the default skirmish game points level (65000) and I wanted destroyers and battlecruisers to have their own DD and BC logos on the map. SFC3.exe mentions a max skirmish points object, but no value (I also looked for instances of 65000 in hex and none of them changed the value, I guess the value could be stored like 65.000 or 6500 or 64999.99 or something) and although I can change the ship logos for destroyers and battlecruisers the logos for light and heavy cruisers automatically changes with them. I'm also stuck on the shuttle front, the other SFC games handle shuttles completely different. If only we had the source code of the .exe...
« Last Edit: January 08, 2015, 09:54:48 pm by JanB »

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #123 on: January 08, 2015, 10:43:18 pm »
Well, when you figure all the details out on how to separate the phaser texture and/or add weapons :smitten:, please share the info, I'd love to add more weapons to SFC2OP.
You'll be my savior!
For now can you show me what exactly you did?

Adam

PS

In SCP2OP, the PPD and PlaS aren't linked bc I have tested both the PlaS and PPD, both in unique areas so I'm assuming you are referring to SFC2EAW.

Right, I broke the link between OL Plasma-S and OL PPD in Community Edition. We don't have this problem in Orion Pirates, [too].

The fix is complicated and demanding. First, you need to find 4 consecutive bytes to hold a new variable. To do this accurately, you need another tool called IDA which examines the data for references to the assembly code so you don't overwrite important data. Then you follow the references (by clicking on the shared variable) to various subroutines. You make a guess as to which one affects Plasma or PPDs. You overwrite the original segment address reference with the new segment address reference (which is different than its HexEdit address). Launch the game and hope you found the right one. Check for bugs.

All Plasma Torpedoes now have independent variables for total energy! (Plas-I and Two-Turn-F's are treated as Plas-F for total energy purposes -- they require an investment of 5 energy.)

(Fixed the Klingon Phaser UI this morning. For 15 years it referred to Overloaded Fusion Beams! Its area in sprites needed to be cleaned up. Same for the quicktip references for the Hydran OL Hellbore and Romulan Phaser. Edited sprites to include quicktips for Mirak Disruptors and Romulan Photons. Discovered some numerical assignments to the UI layout...10-13)
« Last Edit: January 22, 2015, 02:47:50 am by TarMinyatur »

Offline RazalYllib

  • Imperial Romulan Information Service-senior advisor
  • Lt.
  • *
  • Posts: 784
  • Gender: Male
    • IRIS
Re: Hex Editing of Starfleet executables
« Reply #124 on: January 09, 2015, 07:35:26 pm »
Been awhile since i visited older semi-abandoned 1 haunts, but based on a reading of the thread, you peeps are GREAT!

Slogging through code....finding things, testing, re-testing- take a bow.

I may have to reinstall OP and the SFB mods and dream the big dream again of all the things Taldren could have done if the plug was'nt pulled.
Comes a time when the blind man takes your hand
Says "don't you see?"
Gotta make it somehow
On the dreams you still believe
Don't give it up
You got an empty cup
Only love can fill
Only love can fill

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #125 on: January 10, 2015, 05:30:14 am »
Thanks.

The binary files are strange and difficult at first. But once you get the hang of little-endianness and segment addresses, things get easier.

I've segregated most of the weapon data in Community Edition, but some data I've kept linked. The rate-of-fire and charge cost of Photons is the same for Normal and Proximity modes. This convention could be changed by a player who wants to experiment. I had to laugh out loud when I could fire hundreds of Plasma-F's per turn! All due to a single typo...a '6' instead of a 'C'.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #126 on: January 10, 2015, 06:08:08 pm »
There is no TRBLStatus or TRBHStatus in StarfleetOP.exe. We need to add these new functions. I don't know how to add functions. The easiest approach may be to link individual TRB's to the multiple weapons UI. Or just add the word "TRBeamStatus" where it should probably be, and see what happens.

StarfleetOP.exe does have TRBeamStatus1/2/3/4. So Taldren worked on the weapons' UI.
Sprites.q3 doesn't mention TRBeam, TRBeamStatus, or TRBL/H.

Maybe a section of sprites can be copied and pasted to the end of file. Then it can be edited to accomodate this Andromedan weapon. There are no TR bitmaps, icons, or buttons. They'd have to use the Phaser panel or something and they'd need new strings. (At this moment, it seems like a lot of work for little gain. The multiple-weapon UI works ok for TR Beams.)

Yeah, the range 15.99 range limits are mysterious. None of the 160.0f's seem to affect this limit...
« Last Edit: January 10, 2015, 09:44:39 pm by TarMinyatur »

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #127 on: January 12, 2015, 01:40:59 am »
My first contribution, I bring you the PLASMA SPEEDS, just made mine 72.0  whoop whoop
search for

1st : 00 (00 00 B4 43) 59 DF E0 9E 75 0A B8 00 19 00 00 Controls Plasma Speed for PlaR Only

2nd : 86 60 02 00 00 (00 00 B4 43) 59 DF E0 9E 75 B6 B8 Controls Plasma Speed for PlaF/I & G

3rd : 24 D8 1D 1C 56 79 00 59 C7 86 60 02 00 00 (00 00 B4 43) 59 DF E0 9E 0F 85 69 FF FF FF B8 00 05 00 Controls Plasma Speed for PlaD

4th : 00 00 (00 00 B4 43) 59 D9 45 24 D8 1D 1C 56 79 00 Controls Plasma Speed for PlaS & E (SFC2OP)

Now you can look for Plasma Damage, Adam. I found them together in CE, just before "PlasmaRLauncher."
Hexadecimal: 32 1E 14 14 14 0A
For types: R  S  G  F  I  D

Since OP has Plasma-X and the Snare, there will be another number in there.
Hexadecimal: 32 1E 14 14 14 0A 28 14
For types: R  S  G  F  I  D  X  E



(Regular damage numbers: 50  30  20  20  20  10 for CE + 40 20 for OP)

(I noticed that there are 3 seemingly disabled Plasma arming-modes. Maybe they were put in the code to allow larger launchers (R/S/G) to charge a Plas-F for 1.66/turn * 3 turns instead of 2.5/turn * 2 turns.)
« Last Edit: January 12, 2015, 06:52:21 am by TarMinyatur »

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #128 on: January 12, 2015, 09:54:20 pm »
Awesome!!!!
I will take a look. This sounds promising.
Now to locate Plasma's degradation.  ;)

I'm looking for this:
Code: [Select]
Plasma-G
Range: 10.99 15.99 18.99 19.99 20.99 21
Damage: 20 15 10 5 1 0
Mult: 1.0 0.75 0.5 0.25 0.05 0

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #129 on: January 13, 2015, 05:07:01 am »
EAW and OP do not use the same scheme as Community Edition uses for determining Plasma's range. EAW/OP Torpedoes will match their chart-based damage with a mere +0.05 extension. A Phaser-1, on the other hand, has an extension of +0.99, such that it does the same damage at range 5.00 through 5.99. We are all very accustomed to that convention.

But EAW/OP Plasma doesn't work this way. If your G-CA fires at a nominal range of 10 (let's say 10.92) from an immobile target, you will not do 20 damage per Plasma-G. You'll do 15 instead, as if you were firing at a nominal range of 11.

In Community Edition, I believe the coders might have tried to give Plasma the same +0.99 extension that all direct-fire weapons have. It makes sense to me... But I've discovered that this new extension is too big (or perhaps the rate of decay is slightly low).

The Plasma-G can do 20 damage at a range of 11.5. It's over-reaching by 0.5.
At range 21.7, it can do 1 point of damage. It's over-reaching by about 0.8.

The Plasma-R, however, gets a bigger extension due to its great endurance, over-reaching by up to 3.4. The Plasma-R should not do 10 damage after travelling 32.6 hexes! It should stop doing 10 damage at range 28.9. And be completely exhausted at 30.9.

There's a slight error that's being compounded. It's trivial for Plasma-D/F, but substantial for larger torpedoes.

(The attached image shows the movement of plasma that is properly not counted against it in CE because the models are 6000 miles long. Range in SFC is determined shield to shield, not center to center. This peculiarity may influence the Plasma "charts", wherever they may be.)
« Last Edit: February 26, 2015, 10:39:41 am by TarMinyatur »

Offline JanB

  • Lt. Junior Grade
  • *
  • Posts: 103
Re: Hex Editing of Starfleet executables
« Reply #130 on: January 13, 2015, 06:22:49 pm »
NOTE: this post has been made obsolete by new information: http://www.dynaverse.net/forum/index.php/topic,163394152.msg1123048180.html#msg1123048180

Wow, I finally got somewhere with the shuttle problem in SFC3. A program called Ida Pro was very helpful and now I've managed to give Species 8472 it's own shuttle and I've decoupled the Ferengi shuttle from the Federation shuttle. Unfortunately this did mean forcing the pirates and Rakellians to use the same shuttle as the Ferengi (they're now coupled), but I'm sure it's not a stretch for pirates to use bought Ferengi shuttles and most people find Species 8472 more interesting for a mod than they do the Rakellians (you could also raceswap if you don't use Species 8472 and want a unique Rakellian shuttle). Neutral vessels now use the Ferengi/pirate/Rakellian shuttle isntead of the Federation shuttle. All the other races keep the shuttle they already had.

Here's how you do it:

- open up SFC3.exe (I worked with version v354b) with a hex editor and navigate to offset 000061B08 (that's the hexadecimal address)

- REPLACE the following 27 bits:

48 74 34 48 74 2A 48 74 20 48 48 74 15 48 48 74 0A 48 75 39 BB 78 66 94 00 EB 21

has to become

48 74 34 48 74 2A 48 74 20 48 74 0F 48 74 13 48 78 3B 79 00 BB 78 66 94 00 EB 21

- now look for the string "Klingon Shuttle" (without the parentheses), you'll find the area where the shuttle names are defined.

- change the names as you see fit, but that you compensate with null characters (. in text, 00 in hex) for longer or shorter names, for example replace "Rakellian Shuttle" with "Dominion Shuttle." and ".Pirate Shuttle" with "Ferengi Shuttle". there are limits to how far you can move the names before they start to interfere with each other and once you're out of null characters you can't choose longer names. Just play with it and you'll see.
« Last Edit: January 16, 2015, 09:52:37 am by JanB »

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #131 on: January 14, 2015, 07:23:44 am »
I really would have liked to find a solution to increasing the range of ph3/g/ESGL/fusions etc

Look for 249.9f and 89.9f. Fusion Beams in CE are limited by those unusual constants for maximum range and regular overload range, respectively.No range limit was implemented for Suicide OL's. The AI tends to use them at long range and thus squanders them.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #132 on: January 14, 2015, 09:46:36 pm »
Stumbled onto a feature of PPDs tonight. They fire one pulse for every two points of energy invested. The 2, 4, or 6 pulses with which we are familiar, aren't stored in three variables.

So a modified, long-range, high-energy PPD could fire 10 consecutive pulses after an investment of 20 total energy. The energy cost would be 4/turn for 5 turns. The hold costs, which are not proportional, haven't been found yet.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #133 on: January 14, 2015, 11:54:51 pm »
Here is the data for an Overloaded PPD for Orion Pirates. If you increase its total energy from 12.0f to 24.0f, it will take twice as much time and energy to arm. However, it should fire twice as many pulses.
« Last Edit: January 15, 2015, 12:44:53 am by TarMinyatur »

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #134 on: January 15, 2015, 06:46:05 am »
If you guys could find the cause (and fix) of the PPD fire hose, that would be a considerable boon.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #135 on: January 15, 2015, 08:35:53 am »
I'm guessing the 4xPPD hardpoint doesn't deduct energy as it should. Have you ever seen a PPD fire hose coming from a 1x or 2x hardpoint? Intermittent problems, such as this, will be the most difficult stuff to address. If a 4xPPD couldn't fire at all, I could focus on that function and maybe find the flaw in the logic (or an incompatible data type).

Currently, there's much to learn about fundamental game mechanics.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #136 on: January 15, 2015, 08:57:05 am »
No, SFB doesn't have HP's. Taldren knew about it, yet never made a fix. There may be a reason you can't put more than two PPD's on a HP.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #137 on: January 15, 2015, 09:12:17 am »
Investigating this in Orion Pirates...

The fire hose is not intermittent. Every time I fire a single PPD from a 4xPPD hardpoint only one quarter of it discharges. The array won't decrement below 2 (the 3rd element) without shift-z. I might possibly be able to do something about this, Corbomite.

Stay tuned...


Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #138 on: January 15, 2015, 09:15:34 am »
Have you ever seen a PPD fire hose coming from a 1x or 2x hardpoint?

No, only the unmentionable PPD bug, which would be good to fix too if you stumble across it. I'm pretty sure three PPD's on a HP do it too, but it has been years.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #139 on: January 15, 2015, 09:16:59 am »
Investigating this in Orion Pirates...

The fire hose is not intermittent. Every time I fire a single PPD from a 4xPPD hardpoint only one quarter of it discharges. The array won't decrement below 2 (the 3rd element) without shift-z. I might possibly be able to do something about this, Corbomite.

Stay tuned...

IIRC it only happens when you fire all of them at once, but again it's been years.