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

0 Members and 2 Guests are viewing this topic.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #220 on: January 30, 2015, 02:56:48 pm »
Corbomite, I would indeed like to maintain the long-range capabilities of all Phasers. Yes, once in a while they can be useful against bare hull. But I don't know how to allow a Player to fire at range 15, yet prohibit the AI from doing so. Figuring that out may take months or longer. In the meantime, would you sacrifice that average Ph-3 damage of 0.16 to gain better AI performance?

In my opinion, the AI is greatly improved with optimized phaser charts. The game is much more fun for me to play. Not for one second do I miss the weak outer brackets. I can no longer bear to see another Hydran vessel get whacked in the nose by a missile when it's supposedly protected by Gatlings. (I won't modify the Ph-1 or Ph-2 in 2.671.)

As soon as I learn how to modify AI behavior directly, I'll do so, and restore the Ph-3/G to historical specs for veteran Players. Starfleet2CE.exe has 43,000 functions -- it takes time to examine them...

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #221 on: January 30, 2015, 05:10:45 pm »
If the PD routines could be modified w/o hampering the live fire options of phasers, then I say go for it.

I found the function that determines the range of PD. It has two branches based on the threat: Plasma and Non-plasma. I can set the max PD range for each Phaser type to any range bracket, including the null byte after the 6th Ph-3/G bracket.

None of these has an effect on manually fired Phasers.

I also found the global limiter. So if you want to disable all PD, you can do so by changing its value to 0. The default is 1000.0f, which should be sufficient for just about any mod.
« Last Edit: January 31, 2015, 03:22:17 am by TarMinyatur »

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #222 on: January 30, 2015, 08:58:47 pm »
See, that wasn't so hard after all.  ;) ;D

No really, good find there. I'm sure you'll figure it out at some point.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #223 on: January 30, 2015, 09:45:02 pm »
Ooooh please keep us updated, very interesting and exciting news. Once you have gathered both branches I'd love to learn how to manipulate the ranges in which the PD phasers fire.
The PD code is a mess! With good luck, I found a distant puny function that overruled the changes I made in the obvious PD function.

It seems that fighters are grouped with missiles afterall. It's pretty neat to see your Ph-1's automatically pick off drones and fighters from range 4.9. It's also great to see them ignore Plasma. When I sort out the PD variables, I'll certainly share the info.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #224 on: January 30, 2015, 10:24:45 pm »
PS, I forgot to mention the Mauler recharging mess, when you reinforce shields its difficult to recharge batteries and fire the mauler again.Anything in there that would help the recharge

To really fix that you would have to be able to place Batteries in the power priorities list so players could manipulate them like other power systems. They are currently at the bottom of the list and unmanipulatable. Maybe linking them with the phaser capacitor might work, or completetly break the game, who knows.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #225 on: January 30, 2015, 10:35:28 pm »
Oh, it's from SFB, but in SFB you have about a thousand fold more minute control over power than you do in SFC. You can place small increments of power anywhere you like or put most all of it into one thing if you want. You can do partial overloads and use both General and Specific shield reinforcement at the same time. You can charge batteries and weapons and have both kinds of reinforcement up just by dividing it the way you like. There are no sliders. You fill out an Energy Allocation form at the start of each turn and all of that energy is at your discretion. You can even opt not to power life support and kill your crew.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #226 on: January 30, 2015, 10:47:20 pm »
Batteries don't work right in SFC anyway. A favored tactic of dizzy users was to charge regular warheads and when they got into striking range to use the batteries to OL some or all of them at the last minute. You can't do that in SFC. Instead you will slow down or lose power to other systems and have to wait for the HP to get to full again. The only thing I have been able to use Batts for (other than the Mauler) was some short EW points until they run dry, which isn't usually very long or to charge a Probe.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #227 on: January 31, 2015, 12:44:17 am »
Just did a battle against a F-BCF...

I am finally no longer annoyed by point-defense! I set my phasers to ignore plasma but to attack missiles and shuttles. How often does the BCF unload its psuedo-F torp just when you really need your PD to kill missiles or a nearby scatterpack? I can give the PD hotkey a well deserved break.

I'd like to allow the player to discriminate between shuttles and missiles, but for now they are in the same group. I'll look at Orion Pirates tomorrow, Adam.

Starfleet2CE.exe:

177DFC: 6B D2 [00] // Ph-1 PD vs Plasma. Change the 00 to 2E to disable.
177E11: 6B C0 [00] // Ph-2 PD vs Plasma. Change the 00 to 17 to disable.
177E26: 6B C9 [00] // Ph-3 PD vs Plasma. Change the 00 to 07 to disable.
177E3B: 6B D2 [00] // Ph-G PD vs Plasma. Change the 00 to 07 to disable.
177E50: 6B C0 [00] // Ph-4 PD vs Plasma. Change the 00 to EB to disable.

[00] means the 1st bracket (range 0.99)
[01] means the 2nd bracket (range 1.99)
[02] means the 3rd bracket (range 2.99) -- but it is overruled by an external function

You can still press spacebar to target plasma (like an R-torp that's nipping on your heels) and fire at it with your phasers.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #228 on: January 31, 2015, 09:50:22 am »
I'm a little lost. Just why exactly is PD vs plasma bad?

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #229 on: January 31, 2015, 10:24:26 am »
Well, that's kind of what the point of that type of assault is. There is no way to determine if the torp is real or not without letting it hit. They programmed the AI to never doubt that the torp is real since it is too stupid to understand plasma defense tactics. Therefore it always drops a WW if it has one and will always fire PD phasers at a torp. Turning it off will also force players to adopt only one strategy against plasma or have to go through the bother of manually targeting a torp and taking their attention off of the enemy. You can castle vs plasma if you know what to do and know when to stop. No plasma PD would make this much harder.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #230 on: January 31, 2015, 11:06:53 am »
If you think that letting the AI take a face full of plasma is better than reducing damage, then it's your mod, so go for it. Chances are it's going to lose some of those phasers to damage and never get to fire them.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #231 on: January 31, 2015, 11:30:25 am »
Modding things as you like is part of the fun of messing with things, but always look at it as an entire system and consider what the changes will do to all aspects of play. It sounds like you are doing this so have at it.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #232 on: January 31, 2015, 12:13:12 pm »
I'm a little lost. Just why exactly is PD vs plasma bad?
Back in the Starlance days, Croc or Zorlord and I would fight 2v2's against teams consisting of a K-D5D and an R-SPA or similar. Of course our opponents knew that PD doesn't ignore plasma. So at critical moments, the R-SPA would send in a pseudo torp. We all knew it was a fake torp, but it gave the initiative to the D5D/SPA. If you turned off PD, you could get a face full of large drones. If you kept PD on, you could get a face full of large drones as your phasers fired at the torpedo. Our opponents were exploiting the unrefined PD, rather than using a brilliant tactic. If I want to get whacked by plasma, shouldn't I have that choice? Should I use my PD phasers to take out 6 drones or weaken that plasma (if it's real) by about 7?

I welcome the duty of manually firing at Plasma. There usually aren't too many of them flying around at any given time. Shooting down six drones at typical game speeds is almost impossible.

In my opinion, the battles are more engaging if the AI ignores plasma. One PPT doesn't grant you a free pass. The AI needs a lot of work...especially in power management, as you've mentioned, Corbomite.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #233 on: January 31, 2015, 05:43:28 pm »
Adam, I checked out StarfleetOP.exe for PD. The code is different from CE -- more compact, cleaner, but harder to read.

Look at this possibly PD-related function with IDA:

.text:004E36F4                 fld     [ebp+var_4]
.text:004E36F7                 fsub    ds:flt_7962F8   ; 10.0f
.text:004E36FD                 fst     [ebp+var_4]
.text:004E3700                 fcomp   ds:flt_7962FC   ; 20.0f
.text:004E3706                 fnstsw  ax
.text:004E3708                 sahf
.text:004E3709                 jnb     short loc_4E371D
.text:004E370B                 mov     [ebp+var_4], 41A00000h ; 20.0f
.text:004E3712                 jmp     short loc_4E371D

This is a large function, referring to all Phaser types. That 10.0f above may be the general PD engagement range. That 20.0f may be for Phaser-3/G against missiles. It could be completely unrelated. Both floats are shared with other systems. The 41A00000h isn't shared with anything, it's an immediate value.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #234 on: January 31, 2015, 10:41:00 pm »
Adam, I'd bet anything done in CE can be done in OP. It will take time to figure it out. To find the master range limiters for manually fired Phasers in OP, search for 150.0f, 500.0f, 750.0f, and 1000.0f in the same subroutine.

I've decided to not put optimized Phaser charts in the first unofficial patch. With them, I'm concerned that the game might be too difficult for newer players. I've been battling the AI (as if I were a novice -- no hotkeys, no ECM priority, no trac & pack) in a K-D6D with 4 reloads of Type-I missiles. I don't easily defeat a L-CA. It is so damn refreshing to see the AI protect itself. The Tiger's six Ph-3's and tractors can resist a missile bombardment. I tried to kill a H-DE+ from afar...it is impossible with Type-I missiles, as it should be.

Look for 2.671 tomorrow!

Look for 2.672 with optimized Phaser charts (and more) by the end of the week.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #235 on: February 01, 2015, 03:29:51 am »
I'm a little lost. Just why exactly is PD vs plasma bad?
Back in the Starlance days, Croc or Zorlord and I would fight 2v2's against teams consisting of a K-D5D and an R-SPA or similar. Of course our opponents knew that PD doesn't ignore plasma. So at critical moments, the R-SPA would send in a pseudo torp. We all knew it was a fake torp, but it gave the initiative to the D5D/SPA. If you turned off PD, you could get a face full of large drones. If you kept PD on, you could get a face full of large drones as your phasers fired at the torpedo. Our opponents were exploiting the unrefined PD, rather than using a brilliant tactic. If I want to get whacked by plasma, shouldn't I have that choice? Should I use my PD phasers to take out 6 drones or weaken that plasma (if it's real) by about 7?

I welcome the duty of manually firing at Plasma. There usually aren't too many of them flying around at any given time. Shooting down six drones at typical game speeds is almost impossible.

In my opinion, the battles are more engaging if the AI ignores plasma. One PPT doesn't grant you a free pass. The AI needs a lot of work...especially in power management, as you've mentioned, Corbomite.


At lot of how you react is up to the situation and the options you possess and you are removing some of those options. Again, it's your work so you may do as you like, but Drones can be WW, tractored and mined, as well as out run. Plasma is not so forgiving.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #236 on: February 01, 2015, 04:37:27 am »
Another thing is that IIRC the AI in OP is different from the AI in EAW after Dave did some patching. The AI in OP many times actively avoids you after you damage them, so them retreating from plasma actually happens and those points against the warhead can matter.

Offline JanB

  • Lt. Junior Grade
  • *
  • Posts: 103
Re: Hex Editing of Starfleet executables
« Reply #237 on: February 01, 2015, 08:27:23 am »
Another thing that irks me is the transport distance. The standard orbit is like btwn 9/10 but transport is 5. Either the distance should be increase allow for 10.0 transport or the distance in orbit has to be reduce. Why should I nearly have to have a collision with a planet to transport a diplomat. Seems quite weird since all the shows can orbit and transport at the same time.

Why not just get rid of collisions? In SFC3 you can turn off collisions with planets in the defaultcore file (set the attribute of planet classes to "ship" instead of "ship:Planet"). At least in my mod all the missions that have planets in them still function properly after this change. For starbases the collision depends on an object being classed as "SB" (which is a hull class/type, not an attribute) and sadly base assault missions don't function properly without this classification. Anyway, hopefully this gives you guys a clue about how and where collisions are handled in SFC2.

Offline JanB

  • Lt. Junior Grade
  • *
  • Posts: 103
Re: Hex Editing of Starfleet executables
« Reply #238 on: February 01, 2015, 12:47:56 pm »
Well, I don't want to touch the planet, shouldn't be that way, just a slight tweaking in transporting distance and the tweaking with vertical distances when hovering over a target. Eventually it'll be found. Im in no rush, small potatoes at the moment.

It should be a 51.0f value ( 00 00 4C 42 ). With non-solid planets you don't have to influence capturing dynamics and you'll lose fewer AI0allies to collisions, but it's your mod, you should choose how to change things.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #239 on: February 01, 2015, 01:52:49 pm »
Well Tar did say the initial release will be vanilla so no major personal changes just the needed ones. And then the alternate releases will be optional. I say we give it a try and see if the challenge will appeal to us.
It's good to get out of your comfort zone every now and then and spice it up. Now that some tactics might not work; it may intrigue you to develop new ones or relying on others. Nothing to lose. And you'll still have a copy of the vanilla release.  ;)

Well, I don't want to turn this into a tactics discussion, but based on what Tar offered up as an example of why it needed changing, I can think of at least three things that could be done to fix that problem that are severely less radical than changing the game code:

1) Have a WW ready.
2) Move faster.
3) Both of these things.


As a corollary if the situation involved a tractor beam:

1) Don't get tractored.