Tank Ammo!


  • Please log in to reply
13 replies to this topic

#1 Shortstop4313

Shortstop4313

    Squaddie

  • Members
  • Pip
  • 34 posts

Posted 31 March 2010 - 06:18 PM

Hello Everyone,

Using the handy-dandy executable worksheet, and modifying it for the Windows version with the broke out 'Tactical.exe' I've been doing a lot of work to make HWP a lot more scary for both the Human and the Alien side.  I felt this needed to be done, especially with the Reapers, since they are so laughable to fight.  They are all but worthless, even on the higher levels of difficulty.

However, I've run into a small issue: Ammo for the cannon tank.  Does anyone know where the damage and number of shots is stored?  I've edited the turret in the Ufo Defense.Exe to change the values, but I'm having problems changing the damage and the number of shots.

1) I can't find the number of shots for ammo reliably. It's not in Obdata.dat and I can't seem to find it (searching for just '1e' is like trying to sort hay) in the two EXEs.
2) Changing the damage in the UFO Defense.EXE does not change the damage in the game, seemingly.  Testing with Tactical.exe now.

Can anyone HBO?

#2 Bomb Bloke

Bomb Bloke

    The Smily Admin

  • Admin
  • PipPipPipPipPip
  • 4,625 posts
  • Gender:Male
  • Location:Tasmania (AU)

Posted 31 March 2010 - 11:02 PM

View PostShortstop4313, on 1st April 2010, 5:18am, said:

1) I can't find the number of shots for ammo reliably. It's not in Obdata.dat and I can't seem to find it (searching for just '1e' is like trying to sort hay) in the two EXEs.
It's in the GeoScape EXE segment. Afraid I can't be more specific then that.

View PostShortstop4313, on 1st April 2010, 5:18am, said:

2) Changing the damage in the UFO Defense.EXE does not change the damage in the game, seemingly.  Testing with Tactical.exe now.
It's in the Tactical EXE segment.

The original DOS game used two EXEs, one for the GeoScape display, one for the Tactical display.

The Windows version (CE) used one single EXE, which handled both the GeoScape and the Tactical systems. This can be "split" into two EXEs like the DOS version. When using the split executables (eg via XcomUtil), you're not using the "combined" EXE at all. Likewise, when using the combined EXE (which is usually called something like "UFO Defense.exe"), you're not using the split executables.
BB's X-Com Projects Page - X-Com Games At GamersGate
You're just jealous 'cause the voices only talk to me :P
We love Tammy! :)

#3 Shortstop4313

Shortstop4313

    Squaddie

  • Members
  • Pip
  • 34 posts

Posted 01 April 2010 - 11:19 AM

View PostBomb Bloke, on 31st March 2010, 6:02pm, said:

It's in the GeoScape EXE segment. Afraid I can't be more specific then that.

That's good enough, Mr. Bloke.  At least I know where to look now.



View PostBomb Bloke, on 31st March 2010, 6:02pm, said:

It's in the Tactical EXE segment.

The original DOS game used two EXEs, one for the GeoScape display, one for the Tactical display.

The Windows version (CE) used one single EXE, which handled both the GeoScape and the Tactical systems. This can be "split" into two EXEs like the DOS version. When using the split executables (eg via XcomUtil), you're not using the "combined" EXE at all. Likewise, when using the combined EXE (which is usually called something like "UFO Defense.exe"), you're not using the split executables.

I've used X-com util in the past, so that makes perfect sense.  I appreciate pointing me in the right direction.  If I happen to find the offset, I'll pass along info about what I changed and what the bits around it looked like.

#4 Tycho

Tycho

    Lieutenant

  • Project Staff
  • PipPipPipPip
  • 703 posts
  • Gender:Male

Posted 08 February 2012 - 12:57 AM

View PostShortstop4313, on 1st April 2010, 8:19pm, said:

That's good enough, Mr. Bloke. At least I know where to look now.





I've used X-com util in the past, so that makes perfect sense. I appreciate pointing me in the right direction. If I happen to find the offset, I'll pass along info about what I changed and what the bits around it looked like.

The main problem with modifying tank ammo is there are several areas that need to be adjusted in order to avoid inventory problems.  There is one field in GEOSCAPE that sets the amount of ammo for the turrent in UNITREF.DAT. Another set of fields check to ensure you have enough ammo to load it onto a plane and then deduct the correct amount from base stores or add that amount to base stores when the tank is unloaded.  Yet another field handles the post-battle craft reload which returns all unused ammo to the base and then attempts to re-equip the tank back to the plane.  Finally, there is a duplicate set of fields in the same area of code (possibly for a base defense post-battle, but I am not sure on that). As part of this post-battle algorithm, there is a bit-shift that must be adjusted if you exceed 31 for the amout of ammo and adjusted again if you were to go over 63.

If you use the DOS version, the code is pretty clear.  In the CE version, they obfuscated a lot of the values.

You can't adjust the rocket tank without also adjusting the FBL tank at the same time.  (Not without adding new code to handle them seperately.)

#5 ForsakenXI

ForsakenXI

    Squaddie

  • Members
  • Pip
  • 7 posts

Posted 25 February 2012 - 09:03 PM

http://www.ufopaedia...le=TACTICAL.EXE

#6 Tycho

Tycho

    Lieutenant

  • Project Staff
  • PipPipPipPip
  • 703 posts
  • Gender:Male

Posted 26 February 2012 - 03:22 PM

View PostForsakenXI, on 26th February 2012, 6:03am, said:


TACTICAL stores the details about the amount of damage, the type of damage, and the TU cost and Accuracy on each attack type for the turrents.   It is GEOSCAPE which sets the amount of ammo for each tank in UNITREF.DAT.
In DOS1.4 the addresses are 4ED2A (AP), 4ED30 (rocket and FBL), and 4ED36 (beams). In my version of CE, the address for the cannon ammo is at 44ED27.

Changes the areas will change the amount in battlescape but altering ONLY these areas will cause a host of inventory problems as one has to alter the code for adding a subtracting the appropriate amounts from base inventory when adding or removing tanks from crafts and post-combat.

#7 Tycho

Tycho

    Lieutenant

  • Project Staff
  • PipPipPipPip
  • 703 posts
  • Gender:Male

Posted 13 April 2012 - 04:29 PM

http://www.ufopaedia...Tank.2FChaingun

#8 Ros

Ros

    Squaddie

  • Members
  • Pip
  • 48 posts
  • Gender:Male
  • Location:Poland

Posted 25 December 2015 - 04:02 PM

Feeling like an archeologist digging out almost 4 year old topic but anyway...

View PostTycho, on 26 February 2012 - 03:22 PM, said:

TACTICAL stores the details about the amount of damage, the type of damage, and the TU cost and Accuracy on each attack type for the turrets.
I want to make some changes to SWS stats mentioned above in my TFTD Windows CE version. I've found the right offsets, made the changes but some of them don't seem to appear in game.
For example "amount of damage" for Displacer P.W.T which I set to 200 (same as Disruptor Pulse Launcher) in Ufopedia is still 140.
It's the same problem as author of the topic found editing UFO Defense:

View PostShortstop4313, on 31 March 2010 - 06:18 PM, said:

2) Changing the damage in the UFO Defense.EXE does not change the damage in the game, seemingly.  Testing with Tactical.exe now.

I've done other changes in TFTD .exe (X-COM subs and USO's stats) and game accepted them without problem. Anyone got an idea why this time it's otherwise??

#9 Tycho

Tycho

    Lieutenant

  • Project Staff
  • PipPipPipPip
  • 703 posts
  • Gender:Male

Posted 25 December 2015 - 04:13 PM

View PostRos, on 25 December 2015 - 04:02 PM, said:

Feeling like an archeologist digging out almost 4 year old topic but anyway...


I want to make some changes to SWS stats mentioned above in my TFTD Windows CE version. I've found the right offsets, made the changes but some of them don't seem to appear in game.
For example "amount of damage" for Displacer P.W.T which I set to 200 (same as Disruptor Pulse Launcher) in Ufopedia is still 140.
It's the same problem as author of the topic found editing UFO Defense:


I've done other changes in TFTD .exe (X-COM subs and USO's stats) and game accepted them without problem. Anyone got an idea why this time it's otherwise??

This is because there is another set of data just used for the in-game UFOpaedia, since the game was originally two separate programs.

#10 Ros

Ros

    Squaddie

  • Members
  • Pip
  • 48 posts
  • Gender:Male
  • Location:Poland

Posted 25 December 2015 - 05:32 PM

View PostTycho, on 25 December 2015 - 04:13 PM, said:

This is because there is another set of data just used for the in-game UFOpaedia, since the game was originally two separate programs.
So it's somewhere in TFTD main .exe? Do You know in which offsets?

#11 Tycho

Tycho

    Lieutenant

  • Project Staff
  • PipPipPipPip
  • 703 posts
  • Gender:Male

Posted 26 December 2015 - 07:52 AM

View PostRos, on 25 December 2015 - 05:32 PM, said:

So it's somewhere in TFTD main .exe? Do You know in which offsets?

the table starts at offset 0x48B564

#12 Ros

Ros

    Squaddie

  • Members
  • Pip
  • 48 posts
  • Gender:Male
  • Location:Poland

Posted 26 December 2015 - 10:24 AM

Thanks Tycho! You're the man :-)

One more thing. You wrote that when changing the amount of tank turret ammo there are couple of fields in Geoscape.exe / Main .exe (for CE version) that'll need to be changed as well.
These are just specific offsets? Is there any list of them?

#13 Tycho

Tycho

    Lieutenant

  • Project Staff
  • PipPipPipPip
  • 703 posts
  • Gender:Male

Posted 26 December 2015 - 11:34 AM

View PostRos, on 26 December 2015 - 10:24 AM, said:

Thanks Tycho! You're the man :-)

One more thing. You wrote that when changing the amount of tank turret ammo there are couple of fields in Geoscape.exe / Main .exe (for CE version) that'll need to be changed as well.
These are just specific offsets? Is there any list of them?

it's not just a few offsets, you would have to change the checks and then the calculations.  The entire routine that handles checking ammo and swapping it between the tank and base is hard coded to the existing values of each turrent.  Changing this for just one tank was the biggest problem I had, and that was in EU.  I've never looked at that code in TFTD.

#14 Ros

Ros

    Squaddie

  • Members
  • Pip
  • 48 posts
  • Gender:Male
  • Location:Poland

Posted 26 December 2015 - 12:22 PM

Sounds very complicated to me and my nonexistent coding skills.

View PostTycho, on 26 December 2015 - 11:34 AM, said:

it's not just a few offsets, you would have to change the checks and then the calculations.  The entire routine that handles checking ammo and swapping it between the tank and base is hard coded to the existing values of each turrent.  Changing this for just one tank was the biggest problem I had, and that was in EU.  I've never looked at that code in TFTD.
But You've managed overrode that code modding the Gauss Tank in TFTDextender?
BTW, sorry for all those questions but I'm just curious as I admire very much both Your modding skills and amount of work in EU and TFTD.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users