• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.

StarBase 0.25 with experimental SEC file import

simonh

SOC-12
Here's the link for the Windows exe:

StarBase 0.25 for Windows

I have only tested this with a couple of SEC files. I have no idea how many variants of the SEC file there are or how compatible it might be with them or not. Hence I'm declaring this highly experimental functionality. Please test this using fresh projects first, back up your working project before importing anything, etc.

Having said that, it worked fine on my test files and the resulting saved projects seem well formed. If you have any problems, please post me copies of your SEC files, or links to them for further testing.

This will only work on projects that use the D6 OGL rules set, otherwise you'll probably get a broken mess. I am considering strategies to check rules file compatibility with SEC file data but at the moment there is no safety catch. To access the functionality switch to Sector selection mode, select a sector, right click to call up the context menu and click on 'Import SEC File'. Select the file and off you go. It looks in the file for allegiances it doesn't have and imports those as well. It also imports the subsector names.

If the sector already contains worlds, you can get yourself into a mess. Please ONLY do this on sectors that are completely empty.

Please give me whatever feedback you have, even if it's just 'worked ok for me'. Ideally I'd love to have as much feedback about working imports as failed ones. Details of the sector, a link to the SEC file, etc. I'd be fascinated to see what files people are using and what's in them to see if I can add any further functionality or improve the import quality.

Best regards,

Simon Hibbs
 
Thanks, Simon, I look forward to trying this out. :)

It is awesome to have a programmer so responsive to user requests!
 
Looks like there are a lot more variations on SEC file formats out there than I thought.

Since travellermap.com is comprehensively awesome, and provides an API for downloading SEC files in second survey format by default, I think that's the one I really need to support. It also appears to be the most up to date SEC variant.

This is what I love about standards, there are so many to choose from. I know, maybe I should examine all these standards and produce a definitive one that StarBase works with. I'm sure that'll solve all these format proliferation problems!

Simon Hibbs
 
travellermap.com/doc/fileformats.html may help. If not let's fix it!

I had a file import issue last week because the fixed-width fields on the file that I downloaded for Daibei sector were different from the field-widths on the file that I had downloaded for Reavers' Deep. The difference in field-width was in the system name field (IIRC), which then threw off everything after that. It was pretty easy to adjust my import query to work w the second file, so my own problem is already taken care of, but I thought you would want to know.
 
I think what I'll do is upload a sample SEC file SB can handle. It looks like a lot of SEC file variants should be editable to match it without too much hassle as most of the differences are just down to things like the number of columns of the name field.

Meanwhile I'll look at making the SEC file parsing logic a bit more generic and adapt it to support Second Survey format. That may take a few weeks though as holidays will get in the way. Paradoxically I tend to have less time to work on this during holidays than when I'm working.

Simon Hibbs
 
Joshua and I -- and others no doubt -- have worked on regular expressions that can parse the most common UWP lines. Joshua has examples up on Travellermap, and I have code checked into CPAN under the Games::Traveller:: root.

The key is to anchor the expression between the HEX+UWP, and the PBG+Allegiance. And you'll have to detect the old Book 3 format separately, if you care to bother with it (I usually don't).

From there you can split out the trade and travel codes, and stellar data.

Untested sample. The bolded regions are the HEX+UWP, and the PBG+Allegiance, respectively.

/^(.*)\s*(\d\d\d\d)\s([ABCDEXFGHY]......-.)\s\s?(\w+)?\s+(\w.+)?\s*([AR])?\s(\d\d\d)\s(\w\w)\s(.*)/;

(I may have the Base Code separation slightly wrong. Others will correct me.)

\1: World name, if any, otherwise empty
\2: Hex (required)
\3: UWP (required)
\4: Base codes, if any, otherwise empty
\5: Trade codes, if any, otherwise empty
\6: TAS travel code, if any, otherwise empty
\7: PBG (required)
\8: Two-letter Allegiance (required)
\9: Stellar data, if any, otherwise empty


Rumor has it that the "new" UWP line has two minor improvements that make parsing a bit easier: it has a dash (-) when there are no bases, and a dash (-) when there is no TAS Travel code advisory (i.e. a "green" TAS code). So we can expect to find something there. E.G.

Code:
Fubar's World 1910 A788899-C - Ri Ag Cp - 123 Im G0 V Whatever
 
Here's the sample SEC file as promised.

Spinward Marches SEC

I'll have a look at the regex method, that looks interesting. Python has built in regex support, I'm not sure how perl compatible it is but I've used regexes before so I should be able to adapt as required.

Simon Hibbs
 
Back
Top