www.ClassicTW.com
https://classictw.com/

TW2002 DAT File Structure question
https://classictw.com/viewtopic.php?f=14&t=34914
Page 1 of 1

Author:  ctsurv553 [ Fri Jul 22, 2016 7:24 pm ]
Post subject:  TW2002 DAT File Structure question

Hi, I am trying to write some BASIC programs (for Sysop use only) that perform various manipulations of the game DAT files that are not included in the Game Editors. There are a couple of items that I can't seem to find. In particular:
The location of the bytes that specify ownership of Sector figs and mines. I have analysed the structure of the twsect.dat file, and have found the bytes for the quantity of sector figs, and whether they are Defensive, Toll, or Offensive, but have not been able to figure out where in the DAT files the Ownership of sector figs is defined. I have some long running 30K sector games that are becoming more and more cluttered with Rogue Mercenary (abandoned) figs, and would like to create a basic program that switches ownership of these figs to a Player or a Corp. But there's thousands of sectors with these abandoned Rogue figs, too many to manually change them one at a time with the Editor.

I have looked around the Internet for some documentation of the game's DAT file structures, but the only such info I have found is for very old versions of the game that obviously don't apply to TWGS v 3.34b which I am running. Thanks!

Author:  Micro [ Tue Jul 26, 2016 3:36 pm ]
Post subject:  Re: TW2002 DAT File Structure question

Accessing these files directly is not recommended, especially if you are "Manipulating" the data. I used to have the actual structures, but I can't find them.

I highly recommend that you have your program telnet into the admin port, and use tedit instead.

Author:  The Mad Hatter [ Sun Jan 29, 2017 10:26 pm ]
Post subject:  Re: TW2002 DAT File Structure question

Micro wrote:
Accessing these files directly is not recommended, especially if you are "Manipulating" the data. I used to have the actual structures, but I can't find them.

I highly recommend that you have your program telnet into the admin port, and use tedit instead.


That's a joke. Didn't you read what you replied too?

Author:  The Mad Hatter [ Sun Jan 29, 2017 10:36 pm ]
Post subject:  Re: TW2002 DAT File Structure question

ctsurv553 wrote:
Hi, I am trying to write some BASIC programs (for Sysop use only) that perform various manipulations of the game DAT files that are not included in the Game Editors. There are a couple of items that I can't seem to find. In particular:
The location of the bytes that specify ownership of Sector figs and mines. I have analysed the structure of the twsect.dat file, and have found the bytes for the quantity of sector figs, and whether they are Defensive, Toll, or Offensive, but have not been able to figure out where in the DAT files the Ownership of sector figs is defined. I have some long running 30K sector games that are becoming more and more cluttered with Rogue Mercenary (abandoned) figs, and would like to create a basic program that switches ownership of these figs to a Player or a Corp. But there's thousands of sectors with these abandoned Rogue figs, too many to manually change them one at a time with the Editor.

I have looked around the Internet for some documentation of the game's DAT file structures, but the only such info I have found is for very old versions of the game that obviously don't apply to TWGS v 3.34b which I am running. Thanks!


I used to have all that stuff documented, but that was 8-10 years back when I was still masochistically running Windows. I gave up on hacking TW when I moved to Linux and Mac OSX.

I can look, and see if I still have the doc files I wrote up somewhere. Give me a couple of days, I have a bunch of backup drives to check.

Author:  LoneStar [ Wed Feb 01, 2017 1:27 am ]
Post subject:  Re: TW2002 DAT File Structure question

This is what I would do:

Lay 50,000 fighters in Sector 20,000 and assign them to corp 1, save the dat file to another folder (call it Corp1.Dat), and then reassign those same figs to corp 2, and copy the dat file to: Corp2.dat …for added data I would do same, but for players 'not' on a Corp. I have a suspicion (based on my limited experience in Normalizing DataBases), that the Byte you're looking for might be a index-number into the players database.

Then compare each DAT in a Hex Editor.

If you've done the above already check the modified Last Dates for the files in the TWGS Subfolders; there maybe a support file with an indexed list of Sector content/data (?).

Author:  Kavanagh [ Fri Feb 03, 2017 12:10 pm ]
Post subject:  Re: TW2002 DAT File Structure question

An old utility, hdiff.exe, will compare two files and list the differences - text, hex, no matter. Low overhead, 16K. I cant attach an exe, anyone wants it, PM me an email address. I used use it years ago for a CIM comparator hunter with Telix DOS shell, when we had lots of pepl online same time.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/