Jump to content

TFTD: Zrbite location in USO's


Maurice76

Recommended Posts

While exploring the GeoScape.exe and finding Craft Loadouts and Alien Stats of its crew, I also stumbled on something else: the location where the game places the Zrbite. In my game (DOS v1.0 TFTD), starting from address 689E9h, there are 17 strings of 6 bytes each. Writing them out, we get:

 

06 45 100 2 2 3

07 45 100 3 10 3

08 45 100 8 5 3

08 45 100 8 3 3

09 45 100 3 9 2

09 45 100 3 10 2

10 45 100 12 8 3

10 45 100 14 9 3

10 45 100 14 6 2

10 45 100 15 5 2

11 45 100 2 17 3

11 45 100 3 16 3

11 45 100 12 3 3

11 45 100 12 26 3

12 45 100 2 11 3

12 45 100 2 8 3

12 45 100 3 10 3

 

The first column of these refers to the type of USO, according to this table on the UFOPedia site. The second column holds the item ID to be placed. Item ID 45 is Zrbite. The value in the third column is used to compare against a random value between 0 and 99. I suspect it has something to do with damaged USO's, where the value of 100 is lowered - and therefore, has the odds of having the Zrbite destroyed, but I am not certain. Columns four, five and six are the Y-, X- and Z-coordinates respectively.

 

Note that the Zrbite of the Escort is placed just outside the USO, as it misses the Ion Beam Accelerator in that ship by 1 in the Y-direction. Also, both Zrbite units of the Heavy Cruiser should be moved 1 spot further in the Y-direction to be placed under an Ion Beam Accelerator, too.

 

It's arguable whether or not the Zrbite of the Cruiser is placed correctly, as it's not placed under an Ion Beam Accelerator, but rather in the pointy tail of the vessel under one of the grey orb objects. When the Cruiser is damaged, the Ion Beam Accelerators are gone, after all, not its tail section.

 

P.S.: the game also places Zrbite in one of the Colony Stage 2 Map blocks, but that location is not embedded in the .exe at the location of the USOs. I've found the place in the exe where it gets added; I'll work that one out tomorrow evening, it's getting too late now to do it right now.

Link to comment
Share on other sites

As promised, here an update on where the game places the Zrbite within the Alien Colony Stage 2 mission. As it is placing items (including those held by units, be they X-Com or Alien), it keeps track of the number of items already present ingame. Surprisingly, it will skip placing the Zrbite if there are already 180 or more items ingame, despite there being enough room in the OBPOS.DAT for 200 items. I'm not sure if it simply reserves the last 20 spots for something else further down in the code, I didn't dig that far.

 

First check against this value is made at address 46376h and when placing the second piece, it is checked against the value at address 463B3h. Both equal B4h, which is 180 in decimals.

 

It scans the GeoData.Dat array to find the module with value 0Fh (15), which corresponds to the module with the Synomium Device on the ground floor. The address with this value is at 46344h. Once it has found it, it will place two stacks of Zrbite within the module, depending the item limitations. The first one is placed at (14, 14, 1), which is directly below the Ion Beam Accelerator in the lower right of the room, in the section closest to the wall. Address 46388h holds the value 01h, which is the Z-coordinate, while 4638Dh holds the value 0Eh, which is used for both the X and Y coordinate of the chunk of Zrbite.

 

The second one is (likely erronously) placed at (10, 4, 1), which is below the Alien Implanter near the top right corner of the module. Much more likely is that it should have been placed at (4, 10, 1), which would place it below a section of Ion Beam Accelerator which is exactly diametrically opposed to the location of the other chunk of Zrbite when considering the Ion Beam Accelerator configuration of that room. The address 463BCh holds the value 0Ah (10 in decimals), which is assigned to the X coordinate, address 463CAh holds the value 04h, which is assigned to the Y coordinate and finally, address 463CFh holds the value 01h, which is assigned to the Z-coordinate.

 

The item IDs that are placed there are located at address 4637Eh and 463C8h, both containing the value 2Dh (45 in decimals), which is the ID for the Zrbite item.

 

Note that internally, the floors are numbered from 0 for the top floor to 3 for the bottom floor; ingame, this is shown exactly opposite, which has the ground floor as floor 0. The above Z-coordinate refers to the internal coordinate system, not the ingame coordinate system.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...