GEOSCAPE.EXE

From UFOpaedia
Jump to navigation Jump to search

The "Geoscape" program that handles base management and aircraft, a.k.a. XCOM outside of tactical combat. TACTICAL.EXE handles combat.

NOTE: In the WinCE version, GEOSCAPE and TACTICAL are one executable, "UFO Defense.exe". Due to this confusion (what wiki pages place things on, when they're practically identical), currently GEOSCAPE, TACTICAL, and UFO Defense information appear here. (Unless and until someone wants to break everything up... then again, having highly related stuff in one place is a good thing.)

XCOM: UFO Defense (U.S. DOS) version 1.4

  • Is 382,957 bytes long for the virgin 1.4 executable
  • Has alien statistics starting at (non-offset) byte 379,729. There are 33 records of 39 bytes each. No alien names, though.
  • If you have installed XcomUtil, it may alter the length of GEOSCAPE. Does anybody have a modified version, so we can put the length here? --MikeTheRed

XCOM Windows Collector's Edition

  • Variously called the Win CE or Gold version on the wiki
  • Is 495,616 bytes long
  • Starting at byte 648, reads:
XCOM: UFO Defense Gold Edition
This awesome game was compiled on Sep  8 1999 at 08:57:11
Copyright - 1999 Hasbro Interactive/MicroProse Software
Party on dude.
  • If you install XcomUtil, it separates your UFO Defense.exe into GEOSCAPE and TACTICAL executables. They are almost identical copies of UFO Defense.exe, however they start at the right place when run. This allows the game to closely mimick the Dos version by having its main loop run in a batch file.
  • Has alien statistics starting at (non-offset) byte 480,145. There are 33 records of 39 bytes each. No alien names, though.
  • Has tank & inbuilt alien weapon stats at byte 447,868 (see below)

Alien Stats

This section is for the structure of the alien stats, as found in GEOSCAPE. For actual data and additional information, see the alien statistics page. Also see Zombie's excellent alien stats page at StrategyCore. (Have YOU made your StratCore and XCOMUFO accounts yet?)

Alien stats are found as 33 records of 39 bytes each, in all versions of X-COM. They are identical in all versions. This data actually represents the "core" alien stats; modifiers are used to determine the final stats relative to game difficulty level. (In most, but not all, cases, the core stats are the same as the Beginner level stats.)

Alien stats start in each version of X-COM at the following location. This is a byte count, not an offset; with counts, the first byte in the file is byte 1:

Version        Location
DOS 1.4         379,729  (GEOSCAPE.EXE)  
WinCE Gold      480,145  (UFO Defense.exe)
Playstation     501,212
TFTD            486,930

Alien names are not actually found in Geoscape; it just has 33 strings of data... the alien each string applies to has been inferred by matching against aliens in the game.

The 39 bytes correspond to the following values. For the below, statements also apply to TFTD, since it's relevant to understanding the bytes:

0: Race

1: Rank

2: Unknown - Always 0

3: Can Fly

4: TUs

5: Health

6: Energy

7: Reactions

8: Strength

9: Firing Accuracy

10: Throwing Accuracy

11: Melee Accuracy

12: Armor - Front

13: Armor - Left Side

14: Armor - Right Side

15: Armor - Rear

16: Armor - Underside

17: Unknown - Always 0

18: Energy Recharge

19: Unknown - Always 0

20: Unknown - Always 1

21: Unknown - Always 0

22: Equals Unitref[48] and [52], whatever they are (see below)

23: Equals Unitref[48] and [52], whatever they are (see below)

These Unitref bytes ([48] and [52]) and now Geoscape Core values have long stumped us hardcore X-Commies. The two bytes always equal the same value for a given alien, including all aliens of the same race (the N's below). And, they're the same between Geoscape and Unitref. Clearly it must be important (or a goof!), but exactly what it is, who knows. Although this page is for X-COM, I've included TFTD in the hopes it helps folks - but it's been so long since I've played TFTD, I can't remember those units at all.

How's this for a thought?...

Dimension   Byte(s)

       X     22

       Y     23

       Z     24  (top when standing)
             25  (top when kneeling)
             26  (bottom)

Maybe they represent the "size in profile" ("width"), affecting likelihood to hit. A game could be tried with a target 20 squares away, set 22 and 23 alternately to 5 or 2 (or 1 or 0?), and see if it affects the successful shots percentage. 0 or even 1 might break the game, though.

Also, how do these values (2 to 5) correlate with the "pixel drawings" of units? I can't seem to find that info at the moment... aren't units and tiles defined as something like 16x16x28? If so, then perhaps the values (2 to 5) are multiplied by 3 or something to get their final "width" for bullet interception?? --MikeTheRed 05:20, 17 September 2006 (PDT)

In any event, here's a summary of bytes [22] and [23], in the hopes we can figure it out. They're always identical for a given race, and [22] always equals [23].

                 X-COM                            TFTD

         Value   Alien           N        Value   Alien           N

           2     Sectoid         6          2     Aquatoid        6   
                                                  Bio-Drone       1 
           3     Celatid         1                Tentaculat      1   
                 Chryssalid      1
                 Civilian        2          3     Calcinite       1   
                 Ethereal        3                Civilian        2   
                 Floater         6                Deep_One        1   
                 Muton           3                Gill_Man        4   
                 Snakeman        5                Tasoth          2   

           4     Cyberdisc       1          4     Coelacant       1   
                 Hovertank       1                Displacer       1   
                 Reaper          1                Hallucinoid     1   
                 Sectopod        1                Lobster_Man     5   
                 Tank            1                Triscene        1   
                                                  Xarquid         1 
           5     Silacoid        1  

24: Standing Height

25: Kneeling Height

26: Floating Height

27: Damage Modifiers

Zombie, what do you mean by Damage Modifiers? A look-up table? Or a bit field? Here's a bit field table; I don't see a correlation with the Modifiers... also note there are 11 unique DM configurations (not counting soldiers)... how can that be described by 8 bits (and actually only 4 are used)?:

Game   [27]   8    7    6    5    4    3    2    1    Race         N

XCOM     1    -    -    -    -    -    -    -    1    Celatid      1
         9    -    -    -    -    1    -    -    1    Chryssalid   1
         1    -    -    -    -    -    -    -    1    Civilian     2
        12    -    -    -    -    1    1    -    -    Cyberdisc    1
         6    -    -    -    -    -    1    1    -    Ethereal     3
         1    -    -    -    -    -    -    -    1    Floater      6
         4    -    -    -    -    -    1    -    -    Hovertank    1
         7    -    -    -    -    -    1    1    1    Muton        3
        10    -    -    -    -    1    -    1    -    Reaper       1
         1    -    -    -    -    -    -    -    1    Sectoid      6
        11    -    -    -    -    1    -    1    1    Sectopod     1
         8    -    -    -    -    1    -    -    -    Silacoid     1
         5    -    -    -    -    -    1    -    1    Snakeman     5
         4    -    -    -    -    -    1    -    -    Tank         1

TFTD     1    -    -    -    -    -    -    -    1    Aquatoid     6
        11    -    -    -    -    1    -    1    1    Bio-Drone    1
         8    -    -    -    -    1    -    -    -    Calcinite    1
         1    -    -    -    -    -    -    -    1    Civilian     2
         4    -    -    -    -    -    1    -    -    Coelacanth   1
         5    -    -    -    -    -    1    -    1    Deep_One     1
         4    -    -    -    -    -    1    -    -    Displacer    1
         6    -    -    -    -    -    1    1    -    Gill_Man     4
        12    -    -    -    -    1    1    -    -    Hallucinoid  1
        10    -    -    -    -    1    -    1    -    Lobster_Man  5
         7    -    -    -    -    -    1    1    1    Tasoth       2
         9    -    -    -    -    1    -    -    1    Tentaculat   1
        13    -    -    -    -    1    1    -    1    Triscene     1
        11    -    -    -    -    1    -    1    1    Xarquid      1

Alternatively, here's a value summarization. I don't see a good correlation with the DMs:

        [27]   Race           N             [27]   Race           N

               X-COM                              TFTD

          1    Celatid        1              1    Aquatoid       6
               Civilian       2                   Civilian       2
               Floater        6
               Sectoid        6              4    Coelacanth     1
                                                  Displacer      1
          4    Hovertank      1
               Tank           1              5    Deep_One       1

          5    Snakeman       5              6    Gill_Man       4

          6    Ethereal       3              7    Tasoth         2

          7    Muton          3              8    Calcinite      1

          8    Silacoid       1              9    Tentaculat     1

          9    Chryssalid     1             10    Lobster_Man    5

         10    Reaper         1             11    Bio-Drone      1
                                                  Xarquid        1
         11    Sectopod       1
                                            12    Hallucinoid    1
         12    Cyberdisc      1
                                            13    Triscene       1

28: Psi Skill

29: Psi Strength

30: Bravery (encoded)

31: Motion scanner size

32: 1 for Cyberdisc, 0 for all others including TFTD... isn't "Explodes"; the TFTD Bio-Drone also explodes...

I edited the Cyberdisc's field to 0 and checked to see if it exploded. It still did. Obviously this field is for something else. I'll work on this some more. --Zombie 20:15, 15 September 2006 (PDT)

33: Unknown - Always 0

34: Corpse type

35: Big unit (2x2)

36: Victory point score

37: Aggression

38: Intelligence


Note: The fields that are always 0 or 1 could be modified to at least see where they appear in Unitref (fingers crossed). This may reveal what some of them are for (maybe they change during gameplay). --MikeTheRed

This data was just put together working heavily with Zombie and his great SC alien stats page.

Weapon Stats

The following info is for the WinCE version (UFO Defense.exe), but presumably is identical in other versions. It is probably in TACTICAL.EXE for the DOS version.

For WinCE, the tank and inbuilt alien weapon stats start at byte 447,868. These are 8 records of 20 bytes each. They're all stored in 16-bit (2 byte) words.

0: Damage type

1: Damage

2: Firing costs, etc.

Hmm... Ethereal, can you turn this into the usual offset structure? I'm not sure I'll get it right. (20 words must be 10 fields, but I see only 9 for the RTL example) --MikeTheRed 18:22, 15 September 2006 (PDT)

For example, the rocket tank's launcher will have values of: 2 (high explosive), 12 (default ammo), 85 (damage), 55, 45, 0 (aimed, snap, and auto costs), 115, 75, 0 (aimed, snap, and auto accuracies), etc.

Weapons are in this order:

Tank/Cannon
Tank/Rocket Launcher
Tank/Laser
Hovertank/Plasma
Hovertank/Launcher
Celatid
Cyberdisc
Sectopod