AndersI wrote:DaleStan wrote:Not entirely off topic,
this still applies; 2v.dat has had variable 46 (*checks*) since it entered version control.
Where is it? I don't see any 2v.dat when browsing svn.ttdpatch.net with TortoiseSVN. Have I mangled my settings to hide it?
Well, it's kinda there. It entered version control in that the file that contains its data (data.cpp) entered version control. The file itself (which is generated by NFORenum) can be provided. Sorry for the misleading clues.
It sounds like you might be interested, though that may change when you see what is/isn't found in 2v.dat.
Anyway, the format of 2v.dat is:
- The byte 0D. (If not 0D, the format below does not apply.)
- Any single byte. (Larger values mean newer data. This byte is unsigned, but the distinction has not yet been significant.)
- A byte indicating the number features for which this file contains data.
- A byte indicating the maximum valid value for the <operation> in advanced variational action 2s.
- A string of byte pairs <varible><width> for each global variable. Exception: 60+x variables have byte triples (<variable><width><maxparam>) instead. This is terminated by "FF F0".
- For each feature: (Repeat reading this at most $THIRD_BYTE times. Feature 08 is co-opted for town variables.)
- - A byte indicating the feature for 82/86/8A varactions on this feature (ie for feature 09 (indu tiles) this byte is 0A (industries)
- - A string of byte-pairs/byte-triples, as for the global variables. Terminator is "FF F0" or "<First invalid 80+x variable> 80" (e.g. For canals, this is 84 80, and for industry tiles, with no 80+x variables, this is "80 80".)
The high bit of <width> is always set, for hysterical raisins. The low nibble contains a value 0..4, indicating 0..4 bytes of useful data.
This is the second most complicated data file, by the way. Only 0.dat is worse. If you're familiar with C/C++ (And have a sturdy sanity. My code can be ... interesting, to put it in terms that can be repeated in polite company.) searching for "myfopen(name)" will point you to the reading code for name.dat. _datname is the data that file contains. GetCheckFOO means read a FOO, little endian, and ensure that you didn't hit end-of-file in the process.