Steve Jackson Games - Site Navigation
Home General Info Follow Us Search Illuminator Store Forums What's New Other Games Ogre GURPS Munchkin Our Games: Home

Go Back   Steve Jackson Games Forums > Roleplaying > GURPS

Reply
 
Thread Tools Display Modes
Old 03-30-2011, 04:21 AM   #1
panton41
 
panton41's Avatar
 
Join Date: Jul 2005
Location: Jeffersonville, Ind.
Default Re: [Spaceships] Getting started on a Java-based ship builder

The wheel turned on this quite a bit tonight when I realized a suggestion I got from Kuroshima (I think and I apologize if I'm wrong) about using a database suddenly made sense.

A GURPS Spaceship is simply an entity where many of the attributes are actually the primary key of items from a "master table" as well as more than a few stand-alone attributes. The "Master Table" would contain every item in the book(s) in one, large table along with attributes identifying different aspects of it (system type, progression, etc.). The Spaceship entity itself would include design switches and certain types of systems (mainly weapons and habitat) would have their own entity to allow more detail within them (weapon types, cabin types).

I'm using what I'm hoping will be a JavaDB server embedded into the application itself. It has the bonus of being both entire written in Java and being an "official" Oracle Java solution.

I've worked out a rough draft of an interface using Netbeans 6.9, which is my IDE of choice. I might see about migrating it, if possible, to Eclipse in order to try developing it for Android in the future but that's a long way off and might be a lot of headaches.

If Eric doesn't mind, I'd like some pointers, based off his spreadsheet experience, about how to structure various parts of it.

If anyone can suggest a CVS type place to upload this to I'll put it there if anyone else is interested in helping develop it.
__________________
The user formerly known as ciaran_skye.

__________________

Quirks: Doesn't proofread forum posts before clicking "Submit". [-1]

Quote:
"My mace speaks Goblin." Antoni Ten Monros
panton41 is offline   Reply With Quote
Old 03-30-2011, 12:54 PM   #2
Kuroshima
MIB
Pyramid Contributor
Mad Spaniard Rules Lawyer
 
Kuroshima's Avatar
 
Join Date: Aug 2004
Location: The ASS of the world, mainly Valencia, Spain (Europe)
Default Re: [Spaceships] Getting started on a Java-based ship builder

Quote:
Originally Posted by ciaran_skye View Post
The wheel turned on this quite a bit tonight when I realized a suggestion I got from Kuroshima (I think and I apologize if I'm wrong) about using a database suddenly made sense.

A GURPS Spaceship is simply an entity where many of the attributes are actually the primary key of items from a "master table" as well as more than a few stand-alone attributes. The "Master Table" would contain every item in the book(s) in one, large table along with attributes identifying different aspects of it (system type, progression, etc.). The Spaceship entity itself would include design switches and certain types of systems (mainly weapons and habitat) would have their own entity to allow more detail within them (weapon types, cabin types).

I'm using what I'm hoping will be a JavaDB server embedded into the application itself. It has the bonus of being both entire written in Java and being an "official" Oracle Java solution.

I've worked out a rough draft of an interface using Netbeans 6.9, which is my IDE of choice. I might see about migrating it, if possible, to Eclipse in order to try developing it for Android in the future but that's a long way off and might be a lot of headaches.

If Eric doesn't mind, I'd like some pointers, based off his spreadsheet experience, about how to structure various parts of it.

If anyone can suggest a CVS type place to upload this to I'll put it there if anyone else is interested in helping develop it.
Well, for maximum compatibility with 3rd party tools, I would use SQLite as the database backend. It embeds the whole database in a single file, and the library to handle it only weights a few hundred kb. It also has the advantage of being available under permisive licenses (the original is public domain, the Java versions I've seen are Apache-licensed).

The good thing about SQLite, on top of it being rather decent at SQL compliance, is how widespread is it's use. Hell, Firefox uses it to store it's bookmarks, history, etc etc, Thunderbird uses it for it's email databases,... You can find multiple 3rd party toos to acces the database, including Firefox plugins!

Finally, you don't need Dclipse for Android developpment, there's a netbeans plugin for it too, but it's not bundled with the SDL, you have to search for it yourself. (I don't like Eclipse). For GUI designing, there's DroidDraw.

If I had some free time, I would finally start learning how to use all this information...

EDIT: Hell, the native database format in Android is SQLite...
__________________
Antoni Ten
MIB3119
My GURPs character sheet
My stuff on e23

Last edited by Kuroshima; 03-30-2011 at 01:05 PM.
Kuroshima is offline   Reply With Quote
Old 03-30-2011, 02:53 PM   #3
panton41
 
panton41's Avatar
 
Join Date: Jul 2005
Location: Jeffersonville, Ind.
Default Re: [Spaceships] Getting started on a Java-based ship builder

I'm planning on looking into more database options and talking to one of my professors for idea. Great thing about going to university, I have access to an expert in Java and databases. (The same professor offered to share his homebrew with me after I graduate.)
__________________
The user formerly known as ciaran_skye.

__________________

Quirks: Doesn't proofread forum posts before clicking "Submit". [-1]

Quote:
"My mace speaks Goblin." Antoni Ten Monros
panton41 is offline   Reply With Quote
Old 03-31-2011, 04:41 PM   #4
ericbsmith
 
ericbsmith's Avatar
 
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
Default Re: [Spaceships] Getting started on a Java-based ship builder

Quote:
Originally Posted by ciaran_skye View Post
If Eric doesn't mind, I'd like some pointers, based off his spreadsheet experience, about how to structure various parts of it.
I'd be more than willing to chat when you actually start getting into it. As I've said, I really don't know Java nor do I know much about databases... though Excel can be very much like a database when used in certain ways (such as I've used in my sheet), and there are certainly some pointers I can give you in regards to setting up the database for the back end of the program. In fact one of the major reworks of my spreadsheet for v2.0 was a complete revamp of the back end "database" portion of the sheet to address what I found out was a major weakness in the sheet. Had I written it as an actual program using databases it would have been much easier to address that weakness, but at any rate it'll be easier for you if you avoid it altogether by making things more scalable in certain ways right from the start.
__________________
Eric B. Smith GURPS Data File Coordinator
GURPSLand
I shall pull the pin from this healing grenade and...
Kaboom-baya.
ericbsmith is offline   Reply With Quote
Old 03-31-2011, 08:28 PM   #5
panton41
 
panton41's Avatar
 
Join Date: Jul 2005
Location: Jeffersonville, Ind.
Default Re: [Spaceships] Getting started on a Java-based ship builder

On Kuroshima suggestion (over Yahoo) I'm going to go with SQL Lite and build the database backend first. My plan is to have a Spaceship entity built roughly like this:

Code:
Spaceship ID			INT
SM				INT
cost				CURRENCY
WS				INT
CS				INT
Front1				INT
...

Center1				INT
...

Rear1				INT
...
From there I'd have an attribute for every item in the vehicle block. There's also be BINARY attributes for the various design switches. I'd also do separate entities for weapon and habitat modules and probably even shoehorn in a way to do something similar to what Eric's done with mix-and-match weapon mounts. I might even put in a few other of Eric's house rules as an add-on data file from the main one.

Probably I'd make the data files be SQL commands and simply have it recreate the underlying database on every load, after asking while files to include. It might take a performance hit at load time, but make up for it by being a fresh database every time and a well-documented language to code new files in. Ditto and saving and loading spaceships.

Eric, I'm going to tear apart your 1.x spread sheet and possibly use it for the raw data files if it's possible to extract that information. If you can suggest ideas about what to put into it I'd be more than happy to take them.
__________________
The user formerly known as ciaran_skye.

__________________

Quirks: Doesn't proofread forum posts before clicking "Submit". [-1]

Quote:
"My mace speaks Goblin." Antoni Ten Monros

Last edited by panton41; 03-31-2011 at 08:36 PM.
panton41 is offline   Reply With Quote
Old 04-01-2011, 02:49 AM   #6
Puppetminion
 
Puppetminion's Avatar
 
Join Date: Aug 2005
Location: Brisbane, Australia
Default Re: [Spaceships] Getting started on a Java-based ship builder

Possible problem, if you hardcode in the locations adding smaller systems becomes very hard.
I've got a reasonably complete FileMaker implementation done, and what I did was split the spaceship over several tables.
Weapons, habitats, open spaces are all fairly obvious but more importantly I used a spaceship table (for SM and ship wide stuff) and a systems table, where basically an entry is <ship ID>, <location>, <system>; eg Viper, F1, Laminate Armour. So if C1 gets split I rename it C1.1 and then add C1.2 & C1.3 records, all with a -1 SM modifier.

Also means I only needed to do a lot of stuff once rather than 21 times.

Don't know if that helps, but I can hope :)
Puppetminion is offline   Reply With Quote
Reply

Tags
design, java, software, spaceships


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
Fnords are Off
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:25 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.