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

0 Members and 1 Guest are viewing this topic.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #60 on: December 31, 2014, 08:58:40 pm »
shipstacking=1 is a clue in the sfc.ini under [3D].

Offline Javora

  • America for Americans first.
  • Commander
  • *
  • Posts: 3003
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #61 on: December 31, 2014, 09:46:57 pm »

Oh yes b4 I forget. The only reason I think reverse is possible is bc when I changed all the 310.0f values, my ship refused to go beyond 31.0 bc the speedometer was locked. But once the speedometer was unlocked it worked. So my thinking is if we can get the speed start (0) to shift to te right in the speedometer, just maybe when I press A beyond the 0, it will reverse. Hope that makes sense. Lol

My only concern is that the ships start each mission flying in reverse towards the edge of the sector.  However setting the speedometer to a negative value shouldn't be an issue.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #62 on: January 01, 2015, 04:21:21 pm »
Also, wanted to ask you, what we are doing with the exe; can it be done with missions scripts?
Yes. Objects (asteroids, planets, blackholes) can be added to the maps. Ships' starting positions can be changed. I don't know if more complicated stuff can be modified. The Fleet Mission Script Editor (FMSE) could do this for EAW, but not for OP or CE.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #63 on: January 01, 2015, 05:04:25 pm »
Yes, there is a way. You need Microsoft's Visual C++ 6.0 compiler to be associated with Taldren's Orion Pirates programming interface (API). A steep learning curve awaits you (assuming you can obtain the old & expensive C++ 6.0 software.)

With Community Edition, making mission scripts should be at no cost because you use Visual Studio Express 2012 (maybe 2013 too?), a free download. There is an API for Community Edition...somewhere. It isn't currently available on Dynaverse.

Hex Editing of the mission scripts in OP might do the trick. Turning a 00 to a 01 to enable something is simple. But finding that specific byte is not a piece of cake.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #64 on: January 01, 2015, 05:15:53 pm »
You are welcome, Adam.

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.

Read it like 4x, my hangover may be interfering with my absorption of this data.  :huh:

Change the CD CC CC 3E (0.4f) to 00 00 20 40 (2.5f) and you'lll definitely understand what's going on in the game. Accelerate slowly while turning. You'll notice that you can essentially do a continuous HET at a speed of 3.00 to 3.99. But when you reach a speed of 4, regular maneuverability returns.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #65 on: January 02, 2015, 12:32:38 am »
Fixed the Hydran UI for Plasma Torpedoes tonight.

Had to Hex Edit sprites.q3 and add new entries to aaStrings.txt and quicktips.txt.

aaStrings:
|HH_a6_plas_nor|~F:hydran7~normal
|HH_a6_plas_envx|~F:hydran7~enveloping

quicktips:
|A6_PLASMA_OFFLINExx|Turn OFF these Plasma Torpedoes
|A6_PLASMA_NORMALxxxx|Turn ON these Plasma Torpedoes
|A6_PLASMA_ENVELO|Arm in Hellbore Mode
|A6_PLASMA_DEFENSI|Arm in Shotgun Mode

The Hex Edit required renaming the internal identifiers to match the UI data.

HH_a6_plas_***

1st occurence: def -> off
2nd: env -> nor
3rd: norm -> envx
4th: off -> def

...and then renaming the internal quicktips to match the byte spacing (and thus the use of x's as fillers and the truncated words).

Very confusing, but worth the effort. Gorn vessels serving in the Hydran fleet have working controls. They are still in an unconventional order, but they are accurate and so are the tips.

(A much easier approach is to ignore the erroneous quicktips and simply edit aaStrings.txt, inverting the order of the descriptions.)


Offline FPF-DieHard

  • DDO Junkie
  • Captain
  • *
  • Posts: 9461
Re: Hex Editing of Starfleet executables
« Reply #66 on: January 02, 2015, 02:15:21 pm »
Wow.

This is awesome, if not 10 years too late!!!  :)
Who'd thunk that Star-castling was the root of all evil . . .


Offline Nemesis

  • Captain Kayn
  • Global Moderator
  • Commodore
  • *
  • Posts: 13070
Re: Hex Editing of Starfleet executables
« Reply #67 on: January 02, 2015, 02:23:20 pm »
while searching for the damn phaser colors lol I ran into this tid bit

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

it must mean something, at first glance I thought move cost, but its missing, 0.33, 0.25 etc etc

Whatcha think Tar

Shield or life support costs?
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 JanB

  • Lt. Junior Grade
  • *
  • Posts: 103
Re: Hex Editing of Starfleet executables
« Reply #68 on: January 02, 2015, 02:34:43 pm »
My 2 cents for SFC3 hex editing... In SFC3.exe I found the location of the shuttle hardcoding, I could change the names listed there, so for example I could make the Klingons use the ship called "Ferengi Shuttle" (so for mods like DW that swap the Borg for the Dominion having a shuttle called "Dominion Shuttle" is possible), but it won't let you add more shuttles, so you can't add shuttles for the Ferengi and Species 8472, at least when I tried it the shuttles of all the races disappear. Oh, very important: SFC3.exe uses a checksum, when you change the number of characters when editing you have to compensate by adding or removing null characters ("00" in hex format, "." in text format). I couldn't find stuff like weapon hit probabilities. In Sprites.q3 there are a lot of references to .bmp files that are not in the textures folder, so they must be the hardcoded bitmaps. Unfortunately they seem to be encoded: I can't find any headers which would allow me to isolate the images.

It really sucks that even after 13 years no tools have been released. Whose bright idea was it in the first place to hard code shuttles, the race icons and half of the Romulan disruptor texture?

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #69 on: January 02, 2015, 03:52:57 pm »
while searching for the damn phaser colors lol I ran into this tid



1.5
1
0.75
0.5

Any ideas, Tar?

Hmm, too general to fit any SFB system. I'd just be guessing. Any clues nearby? Set the 4.0f to 40.0f and see what changes in the game.

I fixed the buttons on the Lyran's Fusion panel. It is nice that we can edit sprites.q3 without crashing the game.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #70 on: January 02, 2015, 04:07:17 pm »
while searching for the damn phaser colors lol I ran into this tid bit

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

it must mean something, at first glance I thought move cost, but its missing, 0.33, 0.25 etc etc

Whatcha think Tar

Shield or life support costs?

I found the shield activation costs yesterday as "06 04 02 01". That's for size class 1, 2, 3, and 4 respectively. I'm trying to fix the misreporting (i.e doubling) of them in "Other" energy. I'll need to find the instruction that adds a value to itself (or multiplies it by two). The good news is that a ship doesn't actually pay double. It's an annoying bug from eons ago that nobody fixed.

Life Support costs would be 2?, 1.5, 1, 0.5 for the four largest size classes. PF's (size 5) don't pay life support, IIRC.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #71 on: January 02, 2015, 04:42:23 pm »
I know nothing about the compressed data in sprites. I can, however, see references to entries in aaStrings.txt and quicktips.txt.
I think the Starfleet.exe handles combat colors and textures (like disruptor-burst.bmp and red-plasma.bmp) all on its own.

Sprites.q3 sends requests to the aaStrings and quicktips assets. I can rearrange them as long as I maintain the byte lengths. Frankly, I'm running out of interest with sprites and UI's, now that I've fixed the Lyran Fusions and the Hydran Plasma. I'm looking at the references for Romulan Photons, so that I can perhaps fix the Overload and Proximity buttons.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #72 on: January 02, 2015, 06:16:35 pm »
I have repaired the Romulan Photons.

The sprites file had incorrectly inserted PPDStatus (instead of PhotonStatus) within the Romulan Photon section. No wonder they didn't work properly! I could only overwite the bad data as "PhotonSta" so I therefore shortened the one reference found in Starfleet2CE to "PhotonSta" as well. Fired up the game and here's a screen shot...

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #73 on: January 02, 2015, 06:47:54 pm »
There are three parts to the Romulan Photon UI Fix.

Part1: Open the sprites.q3 and find the four PPDStatus references within the Romulan Photon section. (You've already done that, Adam.)

Manually overwrite the word "PPDStatus" with "PhotonSta". (Don't do a find-and-replace. There are others that we don't want to modify yet.)
« Last Edit: January 03, 2015, 12:10:59 am by TarMinyatur »

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #74 on: January 02, 2015, 06:56:18 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


Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #75 on: January 02, 2015, 06:58:28 pm »
Part 2: We need to replace all occurences of "Starfleet.PhotonStatus" with "Starfleet.PhotonSta" 00 00 00. Those zero bytes keep everything in order. They are essential. They are not periods. They are nulls. 22 bytes in total.

53 74 61 72 66 6C 65 65 74 2E 50 68 6F 74 6F 6E 53 74 61 00 00 00

I used the find-and-replace tool to do this 23 times in the sprites file, confirming each modification so something unexpected didn't get overwritten. (No surprises here.)


Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #76 on: January 02, 2015, 07:07:10 pm »
Part 3: Romulan Photon Fix.

Now we need to open Starfleet2CE/OP.exe and find the function named PhotonStatus. There is only one. There are similar names such as PhotonStatus1, PhotonStatus2, etc. But we don't want to modify them.

Rename "PhotonStatus" to "PhotonSta" 00 00 00. Again, remember to insert null bytes for each missing letter. Don't use periods.

50 68 6F 74 6F 6E 53 74 61 00 00 00

These three parts together should enable the Overload and Proximity modes for Photons while using the Romulan UI.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #77 on: January 02, 2015, 07:18:21 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.

Offline Javora

  • America for Americans first.
  • Commander
  • *
  • Posts: 3003
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #78 on: January 02, 2015, 07:26:12 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?

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #79 on: January 02, 2015, 07:56:40 pm »
It seems to me to be two different projects. It would seem simpler to try to correct the stuff in OP rather than trying to convert CE into OP, that is, without having someone go directly into the source code, which doesn't seem like it's going to happen. Mapping the entire structure the way you guys are having to go about it will take much time.