It is currently Fri Nov 24, 2017 3:18 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: GPL to N3/NL
PostPosted: Sun Nov 17, 2013 10:13 am 
Offline
Tirechanger
Tirechanger

Joined: Wed Feb 06, 2008 11:54 am
Posts: 33
I know there isn't much of activity here but I'll ask anyway...

I want to decompile gpl tracks to N3/NL :

I convert the gpl track to N3/NL with GPLtoN3 --- works fine

My car is then in the middle of nowhere, so I want to read dlong dlat infos.

So I "reverse engine" N3/NL track.trk with TRKSG to get .sg, file is usable by SGE/SFE.

This particular point doesn't work, the TRKSG bat file says : "GPL trk file version not 3000"

I'm stuck here, I have no idea what 3000 version is, I don't know what to do...

If someone has a solution, feel free to help. :toast:

TIA


Top
 Profile  
 
 Post subject: Re: GPL to N3/NL
PostPosted: Mon Nov 18, 2013 10:46 pm 
Offline
Legendary Driver
Legendary Driver
User avatar

Joined: Sun May 15, 2005 3:13 pm
Posts: 1667
It has been a long time since I've worked with TRK files. The value you refer to seems to be valid only for GPL TRK's. When you converted it to N3, it changed the value to match that engine's. I may have the version documentation somewhere. Somewhere. Maybe.

Anyway, here is a page that describes the GPL file format . P. Flack is a name I haven't seen in a long time.

_________________
"You need to believe in things that aren't true. How else can they become?"-- Death, Hogfather

"And now there remains only one final question. Have you been naughty or nice?"-- Death, Hogfather


Top
 Profile  
 
 Post subject: Re: GPL to N3/NL
PostPosted: Tue Nov 19, 2013 1:00 am 
Offline
Tirechanger
Tirechanger

Joined: Wed Feb 06, 2008 11:54 am
Posts: 33
Thanks for the link traveller.

I tried to change the header data with an hexadecimal editor, unfortunately it doesn't work... file type or file size error. :dunno:

This is frustrating, tracks are converted, but I can't drive ! :banghead:

I converted the game watkins glen with success to sg, it's just the newer tracks I can't do anything... for now.


Top
 Profile  
 
 Post subject: Re: GPL to N3/NL
PostPosted: Tue Nov 19, 2013 11:06 pm 
Offline
Legendary Driver
Legendary Driver
User avatar

Joined: Sun May 15, 2005 3:13 pm
Posts: 1667
Here is some old code of mine from way back-- 2000 and 2001 are the dates on the files.

I believe this first bit is for GPL:

Code:
Type TDataDesignator=array[0..3] of Char;
       TDATDirectory=Packed Record
                              Five:Word;
                              FileLength,FileLengthCopy:Integer;
                              FileName:Packed Array[0..12] of Char;
                              FileLocation:Integer;
                            End;
       TDATHeader=Packed Record
                           NumberOfFiles:Word;
                           Directory:Packed Array[0..3999] of TDATDirectory;
                         End;
       TTRKHeader=record
                    DataDesignator:TDataDesignator;
                    VersionNumber:Integer;
                    TrackLength:Integer;
                    TracesPerSegment:Integer;
                    NumberOfSegments:Integer;
                    SurfaceDataLength:Integer;
                    SegmentDataLength:Integer;
                    SectorTraceValues:array[0..15] of Integer;
                  end;
       TSegment=record
                 SegmentType:Integer;
                 SegmentStart:Integer;
                 SegmentLength:Integer;
                 SegmentHeading:Integer;
                 Zero:Integer;
                 Value1:Integer; {X-Coordinate of Origin of Turn}
                 Value2:Integer; {Y-Coordinate of Origin of Turn}
                 Value3:Integer; {Arc Angle of Turn}
                 Value4:Integer;
                 Value5:Integer;
                 TraceDataOffset:Integer;
                 NumberOfSurfaces:Integer;
                 SurfaceDataOffset:Integer;
               end;
       TSurfaceData=record
                      SurfaceStart:Integer;
                      SurfaceEnd:Integer;
                      SurfaceType:Integer;
                      Value1:Integer;
                      SurfaceHeight:Integer;
                      Value2:Integer;
                      Zero1,Zero2:Integer;
                 end;
       TTraceData=record
                    Delta1:Integer;
                    Delta2:Integer;
                    Delta3:Integer;
                    InitialTraceHeight:Integer;
                    CheckSum1:Integer; {Should=3*Delta1}
                    CheckSum2:Integer; {Should=2*Delta2}
                    Value1:Integer; {X in Straight, Radius in Turn}
                    Value2:Integer; {Y in Straight, Unread in Turn}
                  end;


I believe this bit is for N3, though I'm not sure. I don't have any files on my current machine to check.

Code:
  Type TDataDesignator=array[0..3] of Char;
       TDATDirectory=Packed Record
                              Five:Word;
                              FileLength,FileLengthCopy:Integer;
                              FileName:Packed Array[0..12] of Char;
                              FileLocation:Integer;
                            End;
       TDATHeader=Packed Record
                           NumberOfFiles:Word;
                           Directory:Packed Array[0..999] of TDATDirectory;
                         End;
       TTRKHeader=record
                    DataDesignator:TDataDesignator;
                    VersionNumber:Integer;
                    TrackLength:Integer;
                    TracesPerSegment:Integer;
                    NumberOfSegments:Integer;
                    SurfaceDataLength:Integer;
                    SegmentDataLength:Integer;
                    SectorTraceValues:array[0..9] of Integer;
                  end;
       THeader=record
                 SegmentType:Integer;
                 SegmentStart:Integer;
                 SegmentLength:Integer;
                 CenterLineAngle:Integer;
                 Value1:Integer; {X-Coordinate of Origin of Turn}
                 Value2:Integer; {Y-Coordinate of Origin of Turn}
                 Value3:Integer; {Arc Angle of Turn}
                 Value4:Integer;
                 Value5:Integer;
                 TraceDataOffset:Integer;
                 NumberOfSurfaces:Integer;
                 SurfaceDataOffset:Integer;
                 NumberOfWalls:Integer;
               end;
       TWallData=record
                   WallType:Integer;
                   WallStart:Integer;
                   WallEnd:Integer;
                   Value1:Integer;
                   Value2:Integer;
                 end;
       TTraceData=record
                    Delta1:Integer;
                    Delta2:Integer;
                    Delta3:Integer;
                    InitialTraceHeight:Integer;
                    CheckSum1:Integer; {Should=3*Delta1}
                    CheckSum2:Integer; {Should=2*Delta2}
                    Value1:Integer; {X in Straight, Radius in Turn}
                    Value2:Integer; {Y in Straight, Unread in Turn}
                  end;
       TSurfaceData=record
                      Start:Integer;
                      EndPoint:Integer;
                      SurfaceType:Integer;
                    end;
       TSegment=record
                  Header:THeader;
                  WallData:Array[0..19] of TWallData;
                end;

_________________
"You need to believe in things that aren't true. How else can they become?"-- Death, Hogfather

"And now there remains only one final question. Have you been naughty or nice?"-- Death, Hogfather


Top
 Profile  
 
 Post subject: Re: GPL to N3/NL
PostPosted: Fri Nov 22, 2013 1:31 pm 
Offline
Tirechanger
Tirechanger

Joined: Wed Feb 06, 2008 11:54 am
Posts: 33
Thanks for digging this out, unfortunately I don't know how to use it properly. :neutral:


Top
 Profile  
 
 Post subject: Re: GPL to N3/NL
PostPosted: Fri Nov 22, 2013 10:28 pm 
Offline
Legendary Driver
Legendary Driver
User avatar

Joined: Sun May 15, 2005 3:13 pm
Posts: 1667
It shows that the difference in the structure between the two versions-- why just changing the version number doesn't work. The last time I worked with any TRK files was six or seven years ago. So, I've pretty much forgotten everything. Unfortunately, the source code to my most sophisticated TRK program was lost in a hard drive crash about ten years ago. That program read any TRK file, so it had all of the information well documented in the code.

_________________
"You need to believe in things that aren't true. How else can they become?"-- Death, Hogfather

"And now there remains only one final question. Have you been naughty or nice?"-- Death, Hogfather


Top
 Profile  
 
 Post subject: Re: GPL to N3/NL
PostPosted: Fri Nov 22, 2013 11:33 pm 
Offline
Tirechanger
Tirechanger

Joined: Wed Feb 06, 2008 11:54 am
Posts: 33
That's too bad... :sad:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
Powered by phpBB® Forum Software © phpBB Group