Traveller Store CotI Features New Posts Mark Forums Read Register


Go Back TravellerRPG.com > Citizens of the Imperium > General Traveller Discussions > Software Solutions

Software Solutions Discussions on Traveller related software.

Reply
 
Thread Tools Display Modes
  #1  
Old November 30th, 2017, 06:47 PM
robject's Avatar
robject robject is online now
Marquis
 
Join Date: Mar 2002
Posts: 14,041
Gallery : 9
Visit robject's Blog
robject has disabled reputation
Default ACS Compact Format

I'm designing a tight (=smallish) but human-readable format for Adventure-Class Ships.

It has four sections, each divided by a blank line.

(1) File header. This identifies the format and the creation date in a compact way.

(2) Ship header. This is the general profile of the ship, including hull, armor, and cost.

(3) Components. This is a variable number of line items describing the ship's components, one component per line. The component line itself is a fixed-field record:

- (a) Type. A single letter code indicating a (B)ridge, (C)rew, (D)rive, (F)uel, (L)ife support, (M)Computer,
(P)ayload, (S)ensor, (V)ehicle, or (W)eapon/Defense-related component.
- (b) Volume, in tons, rounded up. Numbers greater than 99 are coded.
- (c) Number of components represented.
- (d) TL of component, Target Number of component, and control points.
- (e) quality rating of component (default=00000).
- (f) short text description of component.

(4) Comments. This section of course is optional.


I'd like to compress the data even further by replacing the text descriptions with a code.

Example: a Safari Ship (appx 995 bytes).
Code:
ACSc1 20171130 

K-BA22-F C+1 D-5 106.6
Hull: SL   
Armor: KO 7

B 14 1 GK0 00000 Spacious Bridge 
C 2  4 GG0 00000 Crew Shared Fresher 
C 32 4 GG0 00000 Crew Lounge 
C 16 8 GG0 00000 Single Stateroom 
C 6  1 GG1 00000 Owner Suite 
C 12 2 GG0 00000 Luxury Suite 
D 1  1 DG1 000B2 Adv Maneuver Drive-2
D 4  1 DG1 00000 Adv PowerPlant-2 
D 5  1 DG1 525E4 Adv Jump Drive-2
F 6  1 996 00000 Fuel Processors
F 40 1 DD0 00000 Fuel
L 1  1 GG1 00000 Luxury LS (10) 
L 2  1 GG1 00000 Life support (80) 
L 1  1 GG0 00000 Life Support Adaptable 
M 0  1 DK1 635B2 Adv Computer Model/1bis std
P 2  1 GG1 00000 Air/Raft Cargo Lock 
P 6  1 DD0 00000 Cargo Hold Basic 
P 14 2 GG0 00000 Capture Tank 
S 0  1 GG1 00000 G Surf Activity Sensor 
S 0  1 GG1 00000 G Surf Life Detector 
S 1  1 GH1 00000 AR Ant EMS 
S 1  1 GH1 00000 AR Ant Visor 
S 0  1 GG1 00000 LR Surf Communicator 
V 4  1 AA0 00000 Air/Raft Enclosed 
V 20 1 EE0 00000 Launch 
V 1  1 GG1 00000 Launch Bracket 
W 0  1 DF1 742A4 Adv Vd T2 Beam Laser
__________________
Imperiallines magazine
My Helpful Stuff for Traveller5
IMTU tc+ t5++ 3i(+) au ls+ / OTU 44% an+ dt+ ge- j- jf+ n- pi+ pp+ tr+ tv- uwp+ xb+
Tools Link

Last edited by robject; November 30th, 2017 at 07:06 PM..
Reply With Quote
  #2  
Old November 30th, 2017, 08:01 PM
ShawnDriscoll's Avatar
ShawnDriscoll ShawnDriscoll is offline
Citizen: SOC-13
 
Join Date: Apr 2017
Posts: 943
Gallery : 0
ShawnDriscoll Citizen+ShawnDriscoll Citizen+
Default

Looks legit.
Reply With Quote
  #3  
Old December 1st, 2017, 12:29 AM
joshualevy joshualevy is offline
Citizen: SOC-7
 
Join Date: Jun 2009
Posts: 21
Gallery : 0
joshualevy Citizen
Default

What is the goal of this format?
When will it be used?

Joshua
Reply With Quote
  #4  
Old December 1st, 2017, 01:20 AM
robject's Avatar
robject robject is online now
Marquis
 
Join Date: Mar 2002
Posts: 14,041
Gallery : 9
Visit robject's Blog
robject has disabled reputation
Default

A less compact form of this file is currently output by my Shipyard program. Since the format is still in flux, I didn't write a reader for it yet: the Shipyard round-trips with YAML, JSON, and XML, all of which are significantly larger than the ACS format.

I was using a very, very compressed form of this in a BASIC program I was writing earlier this year. It's not enough: I want more customizability but still in a small file size that's still not difficult for BASIC to parse.

So mainly it's for portability between my applications: Shipyard can build any ACS and write it to D64 images; I'd like those images to be easy to parse in BASIC.
__________________
Imperiallines magazine
My Helpful Stuff for Traveller5
IMTU tc+ t5++ 3i(+) au ls+ / OTU 44% an+ dt+ ge- j- jf+ n- pi+ pp+ tr+ tv- uwp+ xb+
Tools Link
Reply With Quote
  #5  
Old December 1st, 2017, 04:28 AM
Matt123 Matt123 is offline
Citizen: SOC-14
 
Join Date: Jul 2005
Location: Auckland NZ
Posts: 1,150
Gallery : 0
Visit Matt123's Blog
Matt123 Citizen+Matt123 Citizen+
Default

Why not standardise on XML? Given compute and storage power available today I'm not sure I see the utility of a schema optimised for space. The ZX-81 has been retired and the WWW HTML is based on XML.

A standard XML format, given most (dare I say all) apps should be able to export an xml doc, might lead to better ship builder apps with designs able to be easily cross checked for accuracy and devs making the next app which might be related to trading or combat, knowing that ship design is largely sorted for some editions and will be compatible if say a T4 or T5 ship builder is developed.

Just a thought.
Cheers
__________________
Online CT Ship Designer
COTI thread for feedback
Reply With Quote
  #6  
Old December 1st, 2017, 05:39 AM
ShawnDriscoll's Avatar
ShawnDriscoll ShawnDriscoll is offline
Citizen: SOC-13
 
Join Date: Apr 2017
Posts: 943
Gallery : 0
ShawnDriscoll Citizen+ShawnDriscoll Citizen+
Default

The ACS format is much easier on the eyes. If one were to go XML, they might as well just go binary and be done with it, since only the computer needs to read the files anyway.
Reply With Quote
  #7  
Old December 1st, 2017, 08:27 AM
aramis's Avatar
aramis aramis is offline
Administrator
 
Join Date: May 2001
Location: Anchorage, AK, USofA
Posts: 29,653
Gallery : 56
Visit aramis's Blog
aramis has disabled reputation
Send a message via ICQ to aramis Send a message via AIM to aramis Send a message via Yahoo to aramis
Default

XML is useful for human editable machine readable data structures. Almost all currently available OS's have a free text editor which can edit XML files. (On android, it often cannot access them, but if you can access them, you can edit them.)

XML is thus useful for setting options, or creating human-edited templates. For example, an XML structure is a great extensible method of creating a human modifiable equipment list.

As a human readable format, however, it's long, single column, so space inefficient, or a group of paragraphs, which are hard to find tags in. (I say this as someone who still hand-codes their websites. XML is an outgrowth of HTML.)

The compact textual output, however, is easily human readable, and, thanks to monospace formatting, also machine readable by string slicing.

So, XML isn't quite always "better to use binary," but as an output format, its not a great choice.
__________________
~ Aramis
aramis.hostman.us /trav
Smith & Wesson: The Original Point and Click interface!

Archduke of Sylea (CORE 2118)
Duke of the Third Imperium (SPIN 0534)
Count Terra (SOLO 1827)
Count Gorod (REFT 1302)
Count of the Third Imperium (SPIN 2232)
Viscount of Adabicci (SPIN 1824)
Marquis of the Solomani Rim (SOLO 0606)
Marquis of the Third Imperium (SPIN 2410)
Baron of the Third Imperium (SPIN 2231)
Knight of the Iridium Throne (CORE 1434)
Sir William Hostman (OLDE 0512)
Sir William Hostman (DAGU 0622)
Knight of Deneb (REFT 2239)
Knight of Deneb (Spin 2532)
SEH w/Diamonds for Extreme Heroism - Battle of Boughene
MCG - Battle of Boughene
TAS: William Hostman (CORR 2506)
TAS: Bearer (DAIB 1326)
IMTU ct+ tm++ tne tg-- tt+ tmo+ t4- t20+ to ru+ ge+ 3i+ c+ jt au ls pi+ ta he+ st+
Wil Hostman 0602 C539857-9 S A724
OTU: 95% 3i an+ au+ br- cpu± dt± f+ fs++ ge± ih- inf± j± jf+ jm+ jt+ ls- n= nc+ pi+ pp-- tp+ tr+ tv- vi-- xb+-
Unless there is bold red text, presume my posts to be my personal material only.
Reply With Quote
  #8  
Old December 1st, 2017, 08:30 AM
coliver988's Avatar
coliver988 coliver988 is offline
Baron
 
Join Date: Dec 2003
Location: Asheville
Posts: 1,755
Gallery : 111
Visit coliver988's Blog
coliver988 Citizen++coliver988 Citizen++coliver988 Citizen++coliver988 Citizen++
Default

One advantage of XML is the extendible part. A spec can also be written so that you know your XML is a valid model with an XSD file that defines what is allowed and required.

And personally I find XML readable - with the appropriate names for the fields you know what that field is rather than having to know something from outside the document.

That being said, JSON is a bit more lean and still easy to read and is used more for public facing APIs probably (although most web frameworks, or at least the ones I have worked with, can return either one depending on the request without actually writing any code).

Side note: the ACA spec for the CCDA (continuous care document architecture - how different medical systems can transfer medical documents) has a large XSD file. I generated a class from that (there are tools) and it created a 225,000 line C# model. But there are a LOT of rules built in). Sadly there are two big parts for the spec: computer readable one and human, so that there is basically a duplicate of the pure XML in XHTML - they stick an HTML doc inside an XML doc....
__________________
Mostly lurking about...CT is still my favorite with T5 as a neat tool box to plunder.


Duke of The Solomani RimLANGELOS A4249A6-FLangelos Write Up Alpha
Baron, IpkurIpkur C564543-9Ipkur Write Up Alpha
Knight of the Third Imperium [x2]Rhylanor A434934-FIkuna E000410-A
MCG For Conspicuous GallantryThe Assault On Alellhttps://github.com/COliver988/Traveller
Travellers Aid Society 2798Dudid B510526-9http://traveller-ct.blogspot.com/
Reply With Quote
  #9  
Old December 1st, 2017, 12:43 PM
robject's Avatar
robject robject is online now
Marquis
 
Join Date: Mar 2002
Posts: 14,041
Gallery : 9
Visit robject's Blog
robject has disabled reputation
Default

"Easy on the eyes" always scores in my book, although I always tend to also compress data when it's a custom structure. I like the UWP.

For those few codgers who still believe in XML: note that yes, my app round-trips XML, and also round-trips JSON and YAML. Mainly because these formats, having been around for more than a decade, have LIBRARIES that will dump and parse for me already. It doesn't make sense NOT to support these sorts of things anymore.

ACS, on the other hand, is a compact format because it knows what Traveller needs, and doesn't have to encompass what any other structure might need. It's convention over configuration. It doesn't have to be a dictionary, so it's not.

Add to that the extra little kick that, yes, I want it to be so dang easy to parse that yacc or any of its children aren't necessary to write a parser for it (and yet it's still flexible enough to have one arbitrary-length line-oriented list in it).

There. There's my requirements, hence the format above.

Actually, I adjusted the writer last nite to nearly match the above output. The difference is that I left the hull and armor elements as part of the component list, and bumped out the fixed column widths for volume and quantity. I suspect there is still some tweaking to do, but I'm pretty happy with what's there. Now I have to write the reader.
__________________
Imperiallines magazine
My Helpful Stuff for Traveller5
IMTU tc+ t5++ 3i(+) au ls+ / OTU 44% an+ dt+ ge- j- jf+ n- pi+ pp+ tr+ tv- uwp+ xb+
Tools Link
Reply With Quote
  #10  
Old December 1st, 2017, 12:47 PM
robject's Avatar
robject robject is online now
Marquis
 
Join Date: Mar 2002
Posts: 14,041
Gallery : 9
Visit robject's Blog
robject has disabled reputation
Default

I'll make another comment. This ACS format descended from the Plain Old Ship Component List that we've all used at one time or another in one form or another. In one incarnation it looks like this:

Trader A-HS63 Broadsword MCr519.9

Disposition: In Service
Crew comfort: +0
Passenger demand: -5

Mercenary Cruiser (type F): Using an 800-ton hull, the mercenary cruiser is built to carry a company of lift infantry for corporate or government operations.


Code:
   Tons	 Component                          	  MCr	Notes
-------	 -----------------------------------	-----	--------------------
    800	 Streamlined Hull, lifters          	   50	S, lifters
      8	 Landing legs with pads             	    8	
      0	 Stealth Coating                    	    0	
     16	 Mod AV=64. 2 Kinetic Charged       	    0	R0
     16	 Mod AV=64. 2 Blast Charged         	    0	R0
      0	 Mod AV=32. 1 EMP Charged           	    0	R0
     80	 Plant Fuel (2 months)              	    0	2 months
    199	 Jump Fuel (3  parsecs)             	    0	3 parsec jump, at 66t per parsec
  20.13	 Adv PowerPlant V                   	   61	R6
  12.87	 Adv Maneuver Drive V               	   78	R6
  21.45	 Adv Jump Drive M                   	   65	R3
      9	 Complete Fuel Collection           	  6.5	50 t/hr
      0	 Adv AR Surf Stealth Mask           	  1.5	R0
      0	 2x LR Surf CommPlus                	    5	#2 
      0	 Adv DS Surf Communicator           	  3.5	R0
      0	 2x Mod DS Surf EMS                 	  3.4	#2 R0
      0	 Adv DS Surf Jammer                 	  3.5	R0
      0	 Adv DS Surf Neutrino Detector      	  3.5	R0
      0	 Adv Or Surf Field Sensor           	  1.6	R0
      0	 Adv DS Surf Scope                  	  3.5	R0
     50	 4x Ult AR Bay Missile              	 41.6	#4 R0
      8	 8x Magazine ( Bay Missiles )       	    0	#8 50 x Size-5
    1.2	 10x Ult D T4 Beam Laser ( Firmpoint	   24	#10 R0
   0.24	 2x Ult D T4 Sandcaster ( Firmpoint 	  3.2	#2 R0
      1	 2x Magazine ( Sandcaster )         	    0	#2 50 x Size-5
   0.75	 Ult B Nuclear Damper               	    4	R0
    0.5	 Ult B Meson Screen                 	    4	R0
   4.62	 Adv Computer Model/7 fib           	   78	R0
     60	 Lift Infantry Company              	    3	(70) 3 pl + O3 O2 R5 R3
      2	 2x Damage Control Lockers          	    2	#2 
      2	 2x Medical Low Berth               	    1	#2 
      2	 2x Emergency Low Berth             	    1	#2 10 individuals
      3	 3x Life Support Standard           	    3	#3 10 person-months
      6	 3x Life Support Long Term          	    6	#3 40 person-months
      2	 Counsellor                         	  0.2	
      4	 Surgery                            	    3	
     48	 Spacious Bridge                    	  2.7	6cc 12op 6ws
      4	 Captain's Quarters                 	  0.4	fresher + safe
      4	 XO's Quarters                      	  0.4	fresher + safe
     30	 15x Crew Stateroom ( Double )      	  1.5	#15 1 crew
      4	 4x Crew Common Freshers            	    4	#4 10 crew
     24	 Crew Lounge + Commons              	    0	
      4	 Briefing Room                      	  0.4	inc. 50 Kg safe
    0.5	 Air Lock                           	  0.1	
     12	 Fuel Storage - Lift Infantry       	    0	
     20	 Cargo Hold                         	    0	
      4	 Cargo Lock                         	  0.4	
     84	 14x Adv Grav Troop Carrier-16 ( 4dt	   42	#14 
     32	 4x Vehicle Lock                    	    0	#4
__________________
Imperiallines magazine
My Helpful Stuff for Traveller5
IMTU tc+ t5++ 3i(+) au ls+ / OTU 44% an+ dt+ ge- j- jf+ n- pi+ pp+ tr+ tv- uwp+ xb+
Tools Link
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Data Format robject Traveller 5 9 August 13th, 2014 09:49 AM
Format Preference Blue Ghost The Lone Star 7 August 31st, 2011 01:53 PM
File Format? Keklas Rekobah Imperial Interstellar Scout Service 2 May 3rd, 2011 10:49 AM
Compact radar tracks movement through a wall RainOfSteel Imperial Research Station 0 December 3rd, 2006 12:41 PM
New, compact .50 cal rifle Todg Ship's Locker 27 July 7th, 2006 08:36 PM

This website and its contents are copyright ©2010- Far Future Enterprises. All rights reserved. Traveller is a registered trademark of Far Future Enterprises .
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright (c) 2010-2013, Far Future Enterprises. All Rights Reserved.