Difference between revisions of "SOLDIER.DAT"

From UFOpaedia
Jump to navigation Jump to search
m (Lotta small fixes; moved .hsl to its own page)
Line 98: Line 98:
  
 
''[[User:MikeTheRed|MikeTheRed]] - Was that a joke? Who put the 2 in there, lol''
 
''[[User:MikeTheRed|MikeTheRed]] - Was that a joke? Who put the 2 in there, lol''
 +
''[[User:Tenculat_Commander|Gurluas]] - I did to encourage research.''
  
 
<b>68 / 43</b> <i>(0-3)</i>: Appearance (for loadout, no armor): 0=blonde, 1=brown hair, 2=Oriental, 3=African, 4=???.
 
<b>68 / 43</b> <i>(0-3)</i>: Appearance (for loadout, no armor): 0=blonde, 1=brown hair, 2=Oriental, 3=African, 4=???.

Revision as of 08:09, 24 September 2005

General Notes

SOLDIER.DAT has a fixed structure of 250 entries of 68 bytes each. (Only a maximum of 250 soldiers can be had.) Thus it is always 17,000 bytes long (250x68).

In several places it uses Intel little-endian "Words". These are two-byte values with the low byte first, high byte second. Thus they can count to values greater than 255 (to 65,536). Sometimes they are "signed" however (8000h, when the highest bit is set), which makes the maximum positive value 32,767. It's of no concern in an ordinary game, but may be to hackers. "Signed" is noted below where applicable.

Values are presented according to byte count (1 to 68) followed by the equivalent hex offset (00 to 43) in bold, followed by the normal (non-hacked) range of values in italics. Most fields can be hacked up to FF, but sometimes it can make for weirdness!

Structure

1-2 / 00-01 (0-5, FFFF): Word set to Rank or FFFF if soldier is dead (or slot not yet used). These values are actually pointers within a text file, so if you change it to 6 it will say "Units in Entrance" as your rank. Strange stuff. Ranks are:

0 Recruit
1 Squaddie
2 Sargeant (SGT)
3 Captain (CPT)
4 Colonel (COL)
5 Commander (CDR)
6 Units in Entrance
7 Units in Target Exit

3 / 02 (various, FF): Base the soldier is at, using reference values from LOC.DAT. First base is always 0 (first entry in LOC.DAT). Value of FF means the soldier is being transferred.

5-6 / 04-05 (various, FFFF): Craft soldier is assigned to, using values from LOC.DAT. FFFF means not assigned to a craft.

7-8 / 06-07 (FFFF): Unknown. Presumed Word. Only ever seen to be FFFF.

9-10 / 08-09 (0+): Number of missions. Signed Word.

11-12 / 0A-0B (0+): Number of kills. Signed Word.

13-14 / 0C-0D (0+): Wound recovery days. Signed Word.

15-16 / 0E-0F (20+): Morale value (morale hit if this guy dies). Presumed to be a signed Word. Is equal to 20 + Missions + Rank Bonus, as follows:

 0  Recruit
 0? Squaddie (not yet tested)
 1  SGT
 3  CPT
 6  COL
10  CDR

Note: Hex-editing Missions or Rank and performing a combat (while not touching this field) does not cause this field to reflect the edited values. This field simply adds 1 for each mission and a delta for rank bonus. IOW, although it uses the equation shown above, it's not actually computed from Missions and Rank, per se.

17-41 / 10-28 (Text): Name, 25 characters long. Only approx. 21 characters can be entered when editing the field within the game's Soldier display, but longer names can be hex edited and will be seen in the game. Almost any keyboard character can be entered (including within the game) because they are stored directly instead of going through Windows objects. Remainders of names are retained if a new soldier in a slot has a shorter name than the previous soldier. The end of the current name is denoted by a null character (00).

42 / 29 (various): Always 0 except for existing soldiers being transferred, in which case it equals the LOC.DAT value for destination base. New hirees on their way to a base will also have this set to 0, so if Byte 3 is set to FF and this byte is 0, you can't tell (from these two bytes alone) if it's an existing soldier going to your first base (LOC.DAT=0), or a new recruit going to any base. But the game knows where they're going, presumably via TRANSFER.DAT.

43 / 2A (50-60): Initial TUs.

44 / 2B (25-40): Initial Health.

45 / 2C (40-70): Initial Stamina.

46 / 2D (30-60): Initial Reaction.

47 / 2E (20-40): Initial Strength.

48 / 2F (40-70): Initial Firing Accuracy.

49 / 30 (50-80): Initial Throwing Accuracy.

50 / 31 (20-40): Initial Melee / Close Combat Accuracy. See Note 1.

51 / 32 (0-100): Psi Strength.

53 / 34 (5-10): Initial Bravery. Computed as 110-(10*ThisByte). E.g. if ThisByte=9, Bravery=20. So the lower this byte is, the better your Bravery is. Initial Bravery can be 10-60, and it only uses increments of 10.

52 / 33 (0-105++): Current Psi Skill. 0 = has not yet had any Psi Lab training. See Note 2.

54 / 35 (0-31): Increase in TUs. (Max total TUs possible (initial+increase) is 81. See Note 2.)

55 / 36 (0-36): Increase in Health. (Max total 61)

56 / 37 (0-61): Increase in Stamina. (Max total 101)

57 / 38 (0-75?): Increase in Reaction. (Max total 105?) [ MikeTheRed- Reaction needs testing - it is not 80 (as the wiki says) and even increases at 90 - must be 100 or 120 - I'll test it when I can, if you don't beat me to it! ]

58 / 39 (0-51): Increase in Strength. (Max total 71) Note that very high (hacked) values can cause "unable to throw here", presumably because the arc would intercept the "ceiling" of the battlescape. See throwing distance for more on Strength versus Throwing.

59 / 3A (0-85): Increase in Firing Accuracy. (Max total 125)

60 / 3B (0-75): Increase in Throwing Accuracy. (Max total 125)

61 / 3C (0-105): Increase in Melee/Close Combat Accuracy. (Max total 125) See Note 1.

62 / 3D (0-10): Increase in Bravery (multiply by 10). (Max total 10; 110 Bravery)

63 / 3E (0-3): Armor. 0=None, 1=Personal Armor, 2=Power Armor, 3=Flying Suit.

Can be hacked to: 4=Sectoid, 5=Snakeman, 6=Ethereal, 7=Muton, 8=Floater, 9=Celatid, 10=Silacoid, 11=Chryssalid. (Higher values are civilians and parts of big units.) NOTE: These are not real aliens, just skins... more research must be done e.g. on appearance and gender to make real aliens.

64 / 3F (0-24?): Most-recent month's Psi Lab training increase. Largest values for newly trained (16-24).

65 / 40 (0,1): In Psi Lab training.

66 / 41 (0,1): Promotion flag (as of most recent combat). Reset as of next combat.

67 / 42 (0,1): 0=Male, 1=Female. 2=???

MikeTheRed - Was that a joke? Who put the 2 in there, lol Gurluas - I did to encourage research.

68 / 43 (0-3): Appearance (for loadout, no armor): 0=blonde, 1=brown hair, 2=Oriental, 3=African, 4=???.

Notes

1) Melee a.k.a. Close Combat Accuracy is a somewhat abandoned skill. It does not appear in display screens, but Byte 61 does increase when the stun rod is used. Also, secondary skills will increase when you do this, as they do for other primary skills. Finally, it has a cap of 120 (Bytes 50+61). Given its placement in this file, then, it is presumed that this is a third 'accuracy' skill related to stun-rod use, with Byte 50 being the initial value and Byte 61 being the increase.

2) The possible values for skill increases (in a non-hacked game) depend both on the cap for each skill and on each soldiers' initial value. Thus the max possible value shown in the 'increase' range is for soldiers who started with the minimum initial skill, and got the max possible cap 'overflow'. Primary skills can have up to five over the target cap (if the player gets +6 from a combat when at Cap-1), and secondary skills can have up to one over the target cap (if they get +2 when at Cap-1). Also, Psi Skill is not truly capped - although soldiers cease to get combat increases once at or above 100, it will continue to increase by 2-3 each month the soldier stays in Psi Training.

3) Be careful of making total skill value (initial + increase) greater than 160 (A0h). This will make your skill bar wrap around the screen.

4) As can be seen, Armor is the only thing that 'stays with' a soldier. Yes, it's lost if you fire someone wearing it!

For More Information