07-03-2010, 05:30 PM | #1 | |
Join Date: Jul 2005
Location: Jeffersonville, Ind.
|
[Spaceships] Getting started on a Java-based ship builder
I'm thinking about starting work on a Java-based designer based on GURPS Spaceships. I'd probably do it in stages with a data-import subsystem working first, then the back-end for the actual assembly (using a console-driven interface) then finally a GUI front end.
I'm thinking rather than the XML-based import I discussed earlier I'll use tab-delineated plain text and instead of recreating the tables in Spaceships I will recreate its mathematical underpinnings (namely the 1-3-10 and 2-3-5-7-10-15 based cycles) and generate the data from that information. Doing that would allow ships of arbitrary size. Tab, Carriage Return and EoF characters will be "keywords" in the data file format and there's be escape characters for comments. The back-end would be anchored with a 21-field array that contains a binary data type (to say if the system has been filled) and a data type that represents the systems themselves. There would also be a linked-list to represent the additional options (like gravity, stealth, etc.). There would be a method that would go through both the systems array and options linked-list and add up everything to display price, workstations, etc. Saving the ships will also be tab deliminated plain text, but include the data files used and be more like a list of the internal ID numbers for the systems rather than anything usefully readable. Loading would be more or less the reverse of saving. There would also be an export feature that would output it in more readable format. My initial goal would be to get Spaceships 1 implemented and some of the user-friendly features of Eric B. Smith's spreadsheet (like being able to declare what each "cabin" and weapon mount contains). I'd consider that minimum, with a console-based interface, the "1.0.x" level of finished. Adding the systems and options presented in later books would probably be simply redesigning/adding data files if needed. Spaceships 3 would warrant a 1.1.x version due to adding hex-based stats and 1.2.x for Spaceships 7 because of larger and smaller systems being added. After than a 2.0 GUI build would be made for a more user-friendly interface that would cover everything in the console builds. I would include house rule data files, starting with the ones from Eric Smith since I've found them pretty useful and common-sense. Any others would simply have to be created based off of the data file template. Finally, the rational for Java is twofold. One, it's pretty well cross-platform and would work on Windows, Linux, Macintosh and probably a decent number of Java-enabled smartphones. And Two, it's the language I know best and "good enough" for such a simple project. Due to issues with SJ Games IP being involved I'd rather not open source the program outright, though the source code would be freely available to anyone who wants it. (Maybe use the GPL on the source-code and let the data files be handled by SJ Games copyright. If anyone official wants to comment about the best way to handle this feel free. After all of that, is anyone interested in helping with this. I have a feeling it would probably only take a few weeks to hammer out a working console-based beta and maybe a 1.0 release before the end of the year, assuming school doesn't kill the progress.
__________________
The user formerly known as ciaran_skye. __________________ Quirks: Doesn't proofread forum posts before clicking "Submit". [-1] Quote:
|
|
07-03-2010, 05:51 PM | #2 | |
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
|
Re: [Spaceships] Getting started on a Java-based ship builder
Quote:
__________________
Eric B. Smith GURPS Data File Coordinator GURPSLand I shall pull the pin from this healing grenade and... Kaboom-baya. |
|
07-03-2010, 06:00 PM | #3 |
Join Date: Aug 2004
Location: The ASS of the world, mainly Valencia, Spain (Europe)
|
Re: [Spaceships] Getting started on a Java-based ship builder
Personally, I would not chain myself to the file format. Tab Separated Values is not the best format for data storage, but it's easy to parse and read, it's a good preliminary format. Do things right, and use proper layer separation between data, business and presentation layers, so you can change the data layer later on, to something more sophisticated. This, I like from your project plan, because you tart with the data, and then slowly move to the upper layers.
As for how to store the systems (and remember, I have just a passing acquaintance with the spaceships system from forum posts and the Vorkosigan book), I would move away from static arrays. Java collections are quite good. I would design the Spaceship object as having 5 vectors (front, central, and real hull, core and systems that don't require slots). Give them the appropriate type via inheritance and interfaces (So a system that can be placed into any location would be a class mySystem extends abstractSystem implements frontHullSystem, centralHullSystem, rearHullSystem, coreSystem). Give your spaceship object appropriate methods to make sure that every system can only be assigned to the proper location (so addFrontHullSystem(frontHullSystem system)). Modularize. Use version control, even if you're working alone. |
07-03-2010, 06:45 PM | #4 | ||||
Join Date: Jul 2005
Location: Jeffersonville, Ind.
|
Re: [Spaceships] Getting started on a Java-based ship builder
Quote:
Quote:
Quote:
The reason for using the array for the internal systems is there are only 21 possible locations, of which 20 are used.Locations 0-6 would be "Front", 7-13 are"Center" and 14-20 are "Rear" and Location 6, 13 and 20 would be Core. There would be a method to see how many core systems are used and allow no more than 2 at a time. Also, these numbers would be set in a data file as well in case anyone wanted to implement house rules for more systems (and probably allow Spaceships 7 to be done easier).
__________________
The user formerly known as ciaran_skye. __________________ Quirks: Doesn't proofread forum posts before clicking "Submit". [-1] Quote:
Last edited by panton41; 07-03-2010 at 06:51 PM. |
||||
07-03-2010, 06:56 PM | #5 | |
Join Date: May 2008
Location: CA
|
Re: [Spaceships] Getting started on a Java-based ship builder
Quote:
Using vectors or lists instead of static arrays is probably a good idea - it'll certainly help when dealing with Smaller or Larger systems later on. No need to have a Core vector, though - just include that in the Front/Central/Rear vectors, since a Core system is still considered part of those sections. As for data files, tab delineated files are perfectly adequate unless you want to get fancy and put all sorts of complicated bits in the data files rather than hard coding them into the program. It would probably be best to hard code various 'base' system types into the program (things like Generic Armor, Generic Factory, or Generic Reaction Drive) and then have the data file specify what generic system each system is and the specifics of it. |
|
07-03-2010, 07:31 PM | #6 | |
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
|
Re: [Spaceships] Getting started on a Java-based ship builder
Quote:
It's not a huge issue to just follow the standard progressions; it's mainly an issue because you need to be able to introduce some systems at some SM's that don't follow the standard progressions, or that have their own progressions. Incidentally, all of the information from the systems tables in Spaceships (and several other books) is already laid out in my spreadsheet. There's no need for you to go about recreating most of that work.
__________________
Eric B. Smith GURPS Data File Coordinator GURPSLand I shall pull the pin from this healing grenade and... Kaboom-baya. |
|
07-03-2010, 07:53 PM | #7 | |
Join Date: May 2008
Location: CA
|
Re: [Spaceships] Getting started on a Java-based ship builder
Quote:
There are some specific SMs and systems where things break down - the most egregious is probably the SM+6 Habitat module - but those can easily be taken care of with specific snippets of code. |
|
07-03-2010, 08:23 PM | #8 | |||
Join Date: Jul 2005
Location: Jeffersonville, Ind.
|
Re: [Spaceships] Getting started on a Java-based ship builder
Quote:
Like I said before, I'd rather hard code as little as practical and throw off as much functionality as possible to the data files but I suppose there are some minimums of what can be done like that. I'll probably dissect Eric's spreadsheet to see what all can be done like that, but I'd rather have a single System object type rather than an Armor object, Powerplant object, etc. On the second thought, a single System object type extended to be a ArmorSystem, PowerSystem, etc. would be more elegant and flexible. How many different major system types are there to do like that? Chances are I'd eventually want to implement your arbitrary sized ship as an option simply because about the only easy way to do it is in software and it would fill a major hole in the Spaceships system. It would be great if Mr. Pulver could help verify some number to give it a semi-official blessing. Quote:
At some point I'm still going to have to analyze each entry in the entire series with a microscope so I'll find the non-standard progressions and flag them for special consideration. There's probably still a progression to them that can be used so I'll figure that out when I get to it. If the standard progressions work for all but a handful of systems I'll focus on that first. Edit: Just saw Langley's reply to Eric, I'll look into it, but the above is probably still true.
__________________
The user formerly known as ciaran_skye. __________________ Quirks: Doesn't proofread forum posts before clicking "Submit". [-1] Quote:
|
|||
07-03-2010, 08:37 PM | #9 | |
Join Date: May 2008
Location: CA
|
Re: [Spaceships] Getting started on a Java-based ship builder
Quote:
|
|
07-03-2010, 08:56 PM | #10 | ||
Join Date: Jul 2005
Location: Jeffersonville, Ind.
|
Re: [Spaceships] Getting started on a Java-based ship builder
Quote:
__________________
The user formerly known as ciaran_skye. __________________ Quirks: Doesn't proofread forum posts before clicking "Submit". [-1] Quote:
|
||
Tags |
design, java, software, spaceships |
|
|