View unanswered posts | View active topics It is currently Wed May 06, 2026 9:19 pm



Reply to topic  [ 38 posts ]  Go to page 1, 2, 3  Next
 Accessing data files 
Author Message
Corporal

Joined: Mon Feb 23, 2004 3:00 am
Posts: 6
Location: United Kingdom
Unread post 
Is there anyway of directly accessing and altering the data files that a game uses to store information in eg. twuser.dat, twship.dat, twmap.dat? I’m assuming they are some kind of database structure.

I would like to start experimenting with a form of web-interfacing. It would mainly be semi-automatic user management to being with, but if I manage to get that working as well as I’d like, who knows…

Any info form anyone that’s already played around with something similar would be more than welcome [:)].

Cheers, wardyboy.


Tue Mar 09, 2004 9:24 am
Profile
Commander

Joined: Thu Feb 20, 2003 3:00 am
Posts: 1529
Location: USA
Unread post 
In general, any tampering with the .dat files while the game is running makes the file go corrupt.


Tue Mar 09, 2004 6:52 pm
Profile ICQ
Corporal

Joined: Mon Feb 23, 2004 3:00 am
Posts: 6
Location: United Kingdom
Unread post 
Bugger, oh well [:D]

It was just a thought because I remember that you could get “add-on” type programs for the door TW that players accessed from the BBS, things that meant you could store unused turns at the end of a day, or an unlimited bank account for credits etc etc.

I presume these programs read/wrote directly to the .dat files for the information. Mind you, the player was out of the game at that point, so there would have been no conflict of file accessing problems.



But your post makes it sound like you can actually directly access these files, even if doing so while the game is live may cause problems. Is this true (cause that’s what I’m really interested in), or am I misreading?

Cheers.


Thu Mar 11, 2004 11:49 am
Profile
Commander

Joined: Thu Feb 20, 2003 3:00 am
Posts: 1529
Location: USA
Unread post 
I know some people who have made limited modification to the ship dat file. The person you really want to talk to about this is Mad Hatter, he's the only person I know that has actually modified dat files.


Thu Mar 11, 2004 8:41 pm
Profile ICQ
Lance Corporal

Joined: Thu Feb 17, 2005 3:00 am
Posts: 4
Location: USA
Unread post 
It has been a year since this post. Has anyone answered this question?

_________________
>Taersious<


Thu Mar 10, 2005 5:42 pm
Profile ICQ YIM WWW
Warrant Officer

Joined: Sun Dec 12, 2004 3:00 am
Posts: 97
Location: USA
Unread post 
You are better off writing scripts to make game mods through tedit as the file structure can change from one version to the next. Besides, reverse engineering the file structure is prohibited by the license agreemnet.


Thu Mar 10, 2005 8:03 pm
Profile ICQ
Lieutenant J.G.

Joined: Fri Apr 05, 2002 3:00 am
Posts: 332
Location: USA
Unread post 
Obviously writing to the data files while the game is running is a recipe for disaster, but I'd like to know the file formats for *reading* data for a custom program to calculate various statistics such as trader strength in interesting ways. There's no reasonable way to use tedit to gather a player's total assets, for example. Just iterating through all 20000 sectors using > on the sector screen would take about an hour, not including parsing the gathered data.

twsect.dat is very simple, but the real key to polling any useful information seems to be in twindex.ndx, since twsect.dat doesn't seem to have any ownership information (who owns the various contents of a sector), but I suspect twindex.ndx does. Very frustrating for anyone trying to write any add-ons for sysops. Why is this frowned upon?

_________________
Creator of the TWGS Data Access Library
http://twgs.xiuhtec.com


Thu Jun 16, 2005 7:48 am
Profile ICQ YIM
Lieutenant J.G.

Joined: Wed Oct 15, 2003 2:00 am
Posts: 437
Location: USA
Unread post 
I do not know that it is frowned on. On the other hand, I don't believe TW was written with this in mind, hence making it more difficult. I would guess the authors aren't interested in that area, hence didn't add a lot of support to assist.


Thu Jun 16, 2005 9:45 am
Profile ICQ YIM
Lieutenant J.G.

Joined: Fri Apr 05, 2002 3:00 am
Posts: 332
Location: USA
Unread post 
Well, not actively supporting such things is one thing. Actively detering them by forbiding figuring the format out yourself in the license agreement (as Mantis stated above) is another. I actually can't even find the license agreement anywhere (heh, I guess you get one chance to read it, at install?) but if that really is in there, I've technically already violated the agreement by spending a few hours looking over the files for clues.

I've made some progress, but TWINDEX.NDX seems to be the key to what I need to know, and is very difficult for me to figure out. The rest of the files are just databases of fixed format records and are thus very easy to solve. I could finish decoding twsect.dat, twship.dat, twport.dat, twuser.dat, and twcorp.dat in another few hours, but the big gotcha is that those files don't seem to contain ownership data. twsect.dat has # of figs in each sector, for example, but not who they belong to, so it's useless info for trying to write an asset calculator without unlocking the NDX file with that part of the information in it.

_________________
Creator of the TWGS Data Access Library
http://twgs.xiuhtec.com


Thu Jun 16, 2005 9:58 am
Profile ICQ YIM
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
If you are trying to discern the total assets of players / corps, this can be done from a script (like TWX) that uses TEdit. It can cycle through sectors, planets, ships, and users to accumulate this data. I'm sure that this is simpler than trying to decipher the various files. Also, the TEdit method is completely game safe.

+EP+

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Thu Jun 16, 2005 1:21 pm
Profile WWW
Lieutenant J.G.

Joined: Fri Apr 05, 2002 3:00 am
Posts: 332
Location: USA
Unread post 
Cycling through sectors in a 20000-sector game would take quite a long time. A read-only direct access of the data files would be just as safe and nearly-instantaneous, allowing for more interesting and up-to-date reporting. Once the file formats were known, it would be no less simple, either.

_________________
Creator of the TWGS Data Access Library
http://twgs.xiuhtec.com


Thu Jun 16, 2005 4:45 pm
Profile ICQ YIM
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
Well, only one of these solutions is available now. I whole-heartedly agree that parsing the file would be faster. But even I'm not that bored [:P]

+EP+

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Thu Jun 16, 2005 10:40 pm
Profile WWW
Lieutenant J.G.

Joined: Fri Apr 05, 2002 3:00 am
Posts: 332
Location: USA
Unread post 
Apparently I am. Spent 6 hours last night working on decyphering the index file and will probably spend another 6 today. I'm making a lot of progress, but I'm a little worried if there are really explicit legal issues with what I'm doing. I'd like to at least know it's not going to get me into any trouble, even if it can't be officially supported.

If I work out the formats and my actions are at least condoned, I plan on writing a class interface and compiling a library to share with the community for others to use in creating server-side third-party tools. But I'm getting way ahead of myself there. [:)] Wish me luck.

_________________
Creator of the TWGS Data Access Library
http://twgs.xiuhtec.com


Thu Jun 16, 2005 11:02 pm
Profile ICQ YIM
Commander

Joined: Thu Feb 20, 2003 3:00 am
Posts: 1529
Location: USA
Unread post 
I emailed John about it. I'll let you know what he says.


Fri Jun 17, 2005 12:42 am
Profile ICQ
Lieutenant J.G.

Joined: Fri Apr 05, 2002 3:00 am
Posts: 332
Location: USA
Unread post 
Thanks, Kemper. I actually dropped him a note already as well, so we'll see what he says. My note was mostly regarding v4 and only briefly touched upon the file format issue so your message might garner a more thorough response.

_________________
Creator of the TWGS Data Access Library
http://twgs.xiuhtec.com


Fri Jun 17, 2005 2:05 am
Profile ICQ YIM
Display posts from previous:  Sort by  
Reply to topic   [ 38 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: No registered users and 36 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.