Talk:SOLDIER.DAT (TFTD)

From UFOpaedia
Revision as of 03:44, 12 November 2008 by Zombie (talk | contribs) (Mention about pixel lengths)
Jump to navigation Jump to search

Hi Zombie. I've just checked and the maximum length of an Aquanaut name that can be entered in-game is 19 characters. 20 bytes including a null-terminating byte? It would also be good to hack the name and see if it's possible to display more than 19 characters, I'll try that next. Spike 14:49, 10 November 2008 (CST)

Actually you can enter 21 characters within the game. There is room to hex edit the name up to 27 characters (doesn't need to be null terminated, the final 27th character shows up just fine). The name is the reason why EU's and TFTD's file sizes differ (68 vs. 70 bytes). The programmers gave TFTD 2 more characters to play around with. I'm using the Collector's Edition by the way. --Zombie 15:46, 10 November 2008 (CST)


Interesting. I'm using the Steam version which is also CE I think. Looks like the character name input in-game is limited to some maximum pixel width, or 21 bytes, whichever is less. E.g. use all capital Ws for the name and you only get to enter 14 bytes. Use digit 1 (narrowest character?) or lower case a and you can enter 21 bytes.

I could hex edit 26 + null and it displayed, but overwrote the next column in the Aquanaut display - probably why there is a pixel width limit. I didn't try non null terminated. That's also interesting as it suggests they may be storing the string length somewhere, which could be one of the Unknown records. Spike 04:15, 11 November 2008 (CST)

Ah, I was using lowercase letters to fill the string - that's why I had 21 characters. Apparently the game uses the BIGLETS.DAT character set for editing soldier names. Each character block is 16x16 pixels, but the game doesn't use whitespace. This limits the max height to something like 13 pixels. For the capital letter W, you can have 14 characters total in the display, and that breaks down to 13 pixels wide for a total string length of 182 pixels. For the capital letter I you can put 21 of them in the display. Each letter is 4 pixels wide for a total width of 84 pixels. The max display width possible without wraparound is 21 large characters (such as W or M) which works out to 273 pixels.
For the Aquanaut listing screen, it uses the SMALLSET.DAT character set so things are a little different there. To prevent the name from running into the rank field, the max length is 19 large letters such as W or M. Effective length is around 115 pixels. Surprisingly, the biggest characters in the smallset list is the number sign or the asterisk. Those fill the entire field, and the game actually overwrites part of one character on to the next one so instead of 8 pixels, it breaks down to a little over 6. The programmers should have changed those characters to include a 1-pixel whitespace buffer to prevent overwriting, but maybe that would have mage the character look strange. Eh, whatever. --Zombie 21:44, 11 November 2008 (CST)