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

0 Members and 2 Guests are viewing this topic.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #20 on: December 28, 2014, 07:54:13 pm »
I haven't yet found the variable that defines the Overload Range as 8.99. Maybe it is stored as 90.0f. I've looked at those, but they are related to game speed. I'll keep looking...

I can enter damage values in the charts for a theoretical Range-15 Overloaded Disruptor, but it cannot be fired. The HUD info shows that the weapon is ready to fire (i.e. red font), and it correctly shows the max, min, and estimated damage.

Offline Nemesis

  • Captain Kayn
  • Global Moderator
  • Commodore
  • *
  • Posts: 13068
Re: Hex Editing of Starfleet executables
« Reply #21 on: December 28, 2014, 09:32:44 pm »
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). 
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 #22 on: December 28, 2014, 11:33:41 pm »
Tried changing the fusion range but it didn't work. Still couldn't fire passed its usual range.

Let's say we want to extend its maximum range from 24 to 32. We need to locate its terminal range bracket, the one that is 16-24 by default.

That bracket has the 4-byte float value of "00 00 7A 43", which is 250.0 in ordinary numbers. Are you with me, Adam? You should find that sequence shortly before the word "AVtFusionCannon@@". (Please check out the attached .jpg image.)

If you change those 4 bytes to "00 00 A5 43", then the bracket has grown to 330.

00 00 A5 43 is rearranged to 43 A5 00 00. Then it is condensed to 43A50000. And that's how the number 330.0 is represented as a 4-byte "floating point number".

Since the on-screen range is one-tenth of the internal number, the Standard Fusion will be able to fire up to, but not including, 33. In other words, your maximum range is 32.99. (Overloaded Fusions will not be able to fire beyond 8.99.)

Edit#1: Something unknown is enforcing a maximum range of 24.99 on the Fusion Beam! So the previous modifications are insufficient at the moment.

Edit#2: I found a secondary maximum range limiter. It is peculiar because it is 249.9f, not 250.0f. Also found the OL range limiter, which is set to 89.9f, not 90.0f.
« Last Edit: January 13, 2015, 11:59:46 pm by TarMinyatur »

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #23 on: December 28, 2014, 11:50:13 pm »
Confirmed. The maximum range for Fusion Beams, Hellbores, and ADD's is limited by a constant that hasn't been located yet. [Fusion and ADD limiters have been found.]

The maximum range for ESGs and Disruptors can be increased.

I was able to hit a target with a Standard Photon from range 38. (I increased the 13-30 bracket.)
I can't, however, fire Standard Photons in an incompatible bracket. So if I want to modify the maximum bracket for a Standard Photon, I change the next-to-last bracket, not the final one (which was intended for Range-55 Proximities). This concept should apply to Disruptors of Type 1, 2, and 3, as well.

I'll check out other weapons...

I reduced the range of the Phaser-3/G so that it is a defensive weapon, not a anemic sniping weapon. Holy smokes! One Hydran Hornet was essentially missile-proof. This is truly how Gatlings are supposed to work.

I changed the Ph-3/G's inefficient outer brackets (3, 4-8, 9-15) to be functionally identical to the Range-2 bracket. So now it hurts to get close to a Gatling-equipped vessel, everytime. There is a strange feature that allows players to fire in futility at range 15, even though the fire button never gets highlighted lower-left HUD shows the Ph-G data in purple font, not red, at 0-0 (0). The AI, so far, cannot waste its Phaser-G shots.

Phaser-3/G Chart:
      ----Range----
1d6   0    1    2
 1:    4    4    4
 2:    4    4    4
 3:    4    4    4
 4:    4    4    3
 5:    4    3    2
 6:    3    3    1

Nice chart, IMO. Only took 15 years to get it!
« Last Edit: January 14, 2015, 12:00:56 am by TarMinyatur »

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #24 on: December 29, 2014, 06:00:47 am »
Slow missiles back to speed 8 :)

It's not an ideal solution, but the endurance of the missiles can be reduced. A speed-16 missile has a range of 48. A speed-8 missile has a range of 24. Endurance, however, is stored as an integer, not a float, so the range can't be set to half. Type-I's and Type-IV's each have a value of 3. Dogfight missiles have a value of 1. The so-called large missiles carried by fighters have an endurance of 2 turns.

Speed 16 for two turns (instead of three) yields a range of 32, still a bit high if you're shooting for 24.

Unfortunately, this would affect medium and fast missiles too, taking a big chunk off of their range. A fast missile would travel only 64, instead of 96. Not an ideal means to an end. Nope.

The speeds of seeking weapons will be found sooner or later...

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #25 on: December 29, 2014, 09:20:03 am »
On a good note, I managed to have the disruptor beam take its texture from a different bmp other then the one it shares with the mauler. Currently the mauler and Disruptor beam share a texture. Pain in the butt if you want to change one color it changes the other. I just maintained the mauler at its usual white and made another texture of it red and had it read it. The result. Woohoo red Disruptors and white maulers. Just for fun to see if it would work.

So you're saying that it does interact with the sprites file then? When you say Mauler and Disruptor Beam I assume you mean the Heavy Disruptors since the normals have the pulse action? Hmm, since there is no texture file for the TR Beams (that I know of) I wonder what they reference to get that plain blue beam. Both of you are making impressive progress. Why has no one realized this before? Were the simple tools not available then?

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #26 on: December 29, 2014, 11:20:46 am »
9-12 is Photon range. Dizzys have worked as advertised. They're all the same weapon with better targeting scanners. There is no difference between a Dis1 and a Dis4 except one has better eyesight than the other. For game code purposes they may be different objects, but as far as game play goes there is no difference as they go (usually) by ship size. You can put Dis4's on anything though. Some ranges/limits may be hard coded elsewhere and can not be affected since there is no code to read in those instances, but that wouldn't stop the HUD from giving the "correct" information about range and damage should the weapon actually go that far.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #27 on: December 29, 2014, 01:25:57 pm »
The number of fields for each weapons chart may have been amalgamated into one type for coding. You would then get overlapping damage and range information as each weapon would take up the required fields to make their charts. This is just a guess though.

Offline Javora

  • America for Americans first.
  • Commander
  • *
  • Posts: 3003
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #28 on: December 29, 2014, 03:40:33 pm »
IIRC, SFC OP handles plasma tracking differently than SFC II.  Any way we can figure out how that works?

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #29 on: December 29, 2014, 04:49:51 pm »
I did find out that you can change the Phaser B's overall damage to the hull. The damage that only interacts with the shields seems to be coded in such as its 1/3 of the bare hull damage. So we can't as of yet make any changes to the shield damage apart from the overall damage. They are linked.

True. But I think we can eventually make the Phaser-B use any of the existing conversion constants. This data can be found through a Hex Editor: 0.25, 0.33, 0.67, 1.33, 1.5, 1.67, 1.875, etc. If the Phaser-B strikes a shield, it uses a conversion constant of 0.33 (represented as a 4-byte float) and applies that to the chart's damage value. But if we simply change 0.33 to 0.17, for example, that will affect every system that happens to reference this constant! Not good.

The call to the constant needs to be adjusted, not the constant itself. The Phaser-B can be directed to look in the memory location containing the value 0.17. So let's say 0.17 is stored at 0x00123450 and 0.33 is stored at 0x00123454. I can hypothetically subtract 4 bytes from the call so that the Phaser-B will read the value of 0.17 instead of 0.33.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #30 on: December 29, 2014, 09:04:02 pm »
Found the speed of Disruptor Bolts and Photon Torpedoes!
 
Again, there is a multiple of ten that we aren't used to. The value for a Photon is 5000.0f. I changed it to 2500.0f. I love speed-250 torps. The game is cinematic, like TWOK.

I'll continue to update the offsets on Page 1.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #31 on: December 29, 2014, 09:40:58 pm »
I'm editing SFC 2.670 Community Edition. I don't think Plasma-X is in this game, unless Bonk and Strat and company were highly optimistic. I guess it may be a reference to the earliest days of SFC1 in which Plasma was extra fast, 40? Maybe there is a variable that is subtracted from 400.0f to get 360.0f, and thus we never see that particular 360.0f in the hex code...

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #32 on: December 30, 2014, 12:33:14 am »
Found the secondary limiters to ADD range. ADDs can fire at a range of 0 to 255 (Not that that's a good idea).
Found the data that determines Plasma Torpedo arming costs (F, G, S, EPT-G, EPT-R).
Found Phaser firing rate and automatic Tractor range (ship-to-ship).

Adam, can you post a screenshot of your Hex Editor showing the area that controls Plasma Speed?
Your data doesn't list any memory addresses and I don't know what the parentheses mean.

Edit: Nevermind. I figured out your data for EAW. Nice find, man! Searching for 360.0f did the trick. Plasma D,F,G,S,R all traveled at a leisurely speed of 20 in my ancient galaxy here.

Community Edition has SFBMode=0 in the sfc.ini file which may be the reason I can't set any custom torpedo speeds. It's either 32 or 36. Hmm...
« Last Edit: January 02, 2015, 10:16:06 am by TarMinyatur »

Offline Javora

  • America for Americans first.
  • Commander
  • *
  • Posts: 3003
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #33 on: December 30, 2014, 01:32:03 am »
I'm editing SFC 2.670 Community Edition. I don't think Plasma-X is in this game, unless Bonk and Strat and company were highly optimistic. I guess it may be a reference to the earliest days of SFC1 in which Plasma was extra fast, 40? Maybe there is a variable that is subtracted from 400.0f to get 360.0f, and thus we never see that particular 360.0f in the hex code...

None of the X weapons were in SFC II.  I remember Eric Bethke crowing about the new weapons features and X ships.  This would have been coded into OP after SFC II release.  I also remember that how a plasma round persuited a ship was fixed as well in OP.  I would think that code may have been ported over to missile as well.  IIRC one of the original coders on the SFC II put a comment line stating that it wasn't finished.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #34 on: December 30, 2014, 06:12:32 am »
:D :D :D :D :D :D :D :D :D :D :D :D :D :D

TAR, I LOVE YAH!!!

I was just thinking about the 250 torps back in SFC1 days  I loved it

I burst out laughing like a nut at 3 a.m. when a Kzinti Medium Cruiser fired wonderful slashes of Disruptor fire across my bow. Try 3200.0f instead of 12500.0f for their speed sometime. Press F9 and you're in a movie. (They still sometimes disappear.)

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #35 on: December 30, 2014, 07:13:55 am »
Corb, found what I was talking about..
It was the DisH range chart.

112   00 00 00 00   0
116   41 20 00 00   10
120   41 A0 00 00   20
124   41 F0 00 00   30
128   42 48 00 00   50
132   42 B4 00 00   90
136   43 20 00 00   160
140   43 66 00 00   230
144   43 9B 00 00   310
148   43 CD 00 00   410

The chart we currently have says 5-15 then 16-22 but the game has it as 5-9,10-15...  :crazy2: :crazy2: :crazy2:
But I cant say I care :angel:bc Im excited about the news of the speed being found :D :D


That's just a bunch of nonsense to me. Are you saying that the values change between these two fields? As long as the two fields that encompass 5-15 are consistant there is no change in gameplay effect. I have seen no evidence of change in to hit/damage over these ranges. It might need further testing though, and there is the matter of leaking damage which may account for that chart as it may be done on a different chart for that weapon.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #36 on: December 30, 2014, 07:52:17 am »
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


That looks a lot like the PHB chart structure, which is a Range of Effect type chart, where Dizzys are a To Hit/Damage weapon. I got my X-Weapon info from Dave Farrell. I suppose it could have been erroneous, but gameplay has not produced any reason to doubt it. I guess testing might be in order.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #37 on: December 30, 2014, 08:04:11 am »
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).

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #38 on: December 30, 2014, 08:09:41 am »
If you find the regular dizzy chart it may give us some insight as to what is really going on.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #39 on: December 30, 2014, 09:24:25 am »
Another thing I'd like verified is the OP cloak seeking weapon damage reduction chart. Dave said it was "SFB specs", but I had to assume that. We would need the % damage reductions for tractored and non-tractored ships.

It'll look something like this and when found SFC-CE/EAW can be brought up to specs:


_Cloaked Ship Status_ _Chance of Normal Damage_ _Chance of 1/2 Damage_ _Chance of 1/4 Damage_
 
 
     Non-Tractored                     33.3%                                       33.3%                               33.3%
 
 
 
       Tractored                           66.7%                                       33.3%                                  0%