• 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.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

StarBase v 0.22 source code and binary for Windows

simonh

SOC-12
StarBase version 0.22 is an overhaul of the Project Manager and the way rules files are handled. Instead of manually configuring a project with a new rules set, StarBase now does this for you. It has a rules_templates directory where you keep your rules sets, and when you create a new project it copies the rules set into the new project. There's also a new GUI for customising your new project.

I've created an Album of screenshots showing you what StarBase looks like and taking you step-by-step through populating the project with worlds and editing world details and links between worlds. There's a lot more to StarBase and I plan on uploading more step-by-step guides in future.

StarBase Screenshots

Starbase is available as a pre-built Windows executable:

Starbase 0.22 for Windows

StarBase 0.22 Manual

A big step for StarBase today. The project is now uploaded to Github. Many thanks to those of you that helped me out with this.

StarBase on Github

I've updated the documentation with information on what you need to run StarBase. Apart from Python it depends on a few third party modules. Bear in mind that if all you're interested in is customising a rules set, or implementing a rules set of your own, you don't need anything more than the StarBase executable distribution. For more information check out the manual.

Python 2.7
Pywin32 - Just for Windows
PySide-1.1 - Qt GUI framework bindings for Python
NetworkX – a network graph library

Optionally, if you wish to build the application as a Windows executable yourself, you will also need:

Py2exe
 
That last one is a gem. Py2exe. Thanks for posting this link. Now I can distribute my Python apps without the user having to figure out how to get "my" python onto their system.
 
That last one is a gem. Py2exe. Thanks for posting this link. Now I can distribute my Python apps without the user having to figure out how to get "my" python onto their system.

Py2exe is fantastic. IMHO the setup.py for StarBase is a fairly good example of some of it's features, such as including data files and such in a py2exe build.

I'm also very happy with the way it lets me include 'plugin' script files in the build that are loaded at runtime. Normally Py2exe only packages up python files that are imported by your application in the module headers. However I conditionally load some plugin scripts at runtime. I tell Py2exe to include these scripts in the build as data files, and then those scripts can be customised or swapped out by the user. So you get scriptability and moddability for your app without the user needing to install Python.

Simon Hibbs
 
Simonh,

I've been playing with Starbase and enjoying it very much. Great work and thank-you for sharing.

I noticed the data is stored in CSV files.

If I export, say, Solomani Rim data from a database I have into your format I am guessing it should pick it up easily. Is importing data really going to be that easy?
 
Simonh,

I've been playing with Starbase and enjoying it very much. Great work and thank-you for sharing.

I noticed the data is stored in CSV files.

If I export, say, Solomani Rim data from a database I have into your format I am guessing it should pick it up easily. Is importing data really going to be that easy?

Yes, that's by design. I wanted it to be as trivial as possible to read and write the native data formats using whatever tools you like. I did consider using a SQLite database or JSON files but CSV (well, some sort of delimited columnar format) is simply the format all data secretly wants to be in.

Do make sure you upgrade to 0.23 before creating your new project to import the data into, as there's a nasty bug in the OGL rules file for 0.22. It only affects world generation though, so if you're just importing data you should be ok. Still, best to be safe.

StarBase 0.23 download

In fact I just noticed I never got round to putting the attribute names in the header row of the worlds.csv file. I'll have to get that done.

You may need to do some processing on the hex co-ordinates of the worlds. They are stored in Starbase's internal co-ordinate grid, in which the top-left hex on the project map is row 0, column 0. This means that for the top-left sector in a project the StarBase co-ordinates of a world are the same as the sector co-ordinates, but you will need to offset the co-ordinates for worlds you want to go into other sectors in StarBase.

If you get what I mean.

I do intend to provide a SEC file import/export function at some point. This will be enabled by a 'SEC File Compatible' flag in the rules file, to indicate that the rules file is using UWP compatible attribute definitions. However if you are exporting from a database or spreadsheet, your easiest route will be to write directly to a worlds.csv file anyway.

StarBase doesn't do any range checking when it opens the worlds.csv file, so
you may need to check if you have any attribute values that are out of the range covered by the OGL rules file. I have tried to make sure the attribute ranges are wide enough, but I'm not familiar with the Solomani Rim data.

If you do have a problem, let me know and I'll amend the rules file to cover the range of values you need. A change like that is fairly trivial and safe because it won't break any existing projects out there.

I'm on holiday all next week, but I'd love to hear how this goes. Please do let me know. If you hit any snags I might be able to offer some advice, but won't be able to actually do anything until the week after.

Simon Hibbs
 
Hi Simon,

That worked great. The tip about the coordinates helped a lot. I have the roster of Soloman Rim planets loaded into your app.

All I did was pull the SEC file from the travellermap site and then adjust the columns in excel to match your format and voila.

I did not add any of the stellar info or PBG data yet. I notice you have a final column in your world data - is that for freeform base and stellar information?

I also noted a seperate file for info for every planet. Is that generated by the worlds.csv file or would I need to go in an edit each one of those planets?

Great stuff!
 
Simon - also - for the life of me I cannot get network links working. I have followed the manual and I get the appropriate window when I select two worlds but the system will not let me select a link. What could I be doing wrong?

I am running Windows 8 - in case that is relevant.

Edit - Update - the links work fine on my custom subsector. It is something to do with my imported Solomani Rim sector. Perhaps an issue writing to a file. I'll play around and see what I can find out.
 
Last edited:
Edit - Update - the links work fine on my custom subsector. It is something to do with my imported Solomani Rim sector. Perhaps an issue writing to a file. I'll play around and see what I can find out.

It depends how you created the project. The best way is to create it using StarBase and then substitute your new worlds file, making sure your world co-ordinates fit inside the extent of the project.

You can almost create a project from scratch, but the only file you can't generate yourself is the NetworkData.dat file. This is in a Python native data persistence format called a pickle file. Your best bet would be to copy one in from an empty project. I should really change the format to be editable. It's the one piece of data that at the moment is un-hackable.

Simon Hibbs
 
It depends how you created the project. The best way is to create it using StarBase and then substitute your new worlds file, making sure your world co-ordinates fit inside the extent of the project.

You can almost create a project from scratch, but the only file you can't generate yourself is the NetworkData.dat file. This is in a Python native data persistence format called a pickle file. Your best bet would be to copy one in from an empty project. I should really change the format to be editable. It's the one piece of data that at the moment is un-hackable.

Simon Hibbs

Thanks Simon.

I created a new project, one sector empty of worlds, and then copied and pasted the Solomani Rim data into the worlds csv. It worked great for the basic data (I'll worry about bases and gas giants etc until later). I've been able to customize the affiliations fine.

Links between these worlds do not work. If I create a new world on the fly (by right clicking) and link it to another manually created new world in the Solomani Rim project it works fine. Any planets I created by pasting into the worlds csv cannot get a network link.

I tried creating a systemdata.txt thinking that must be the issue but no dice.

I'll keep playing. Any suggestions? I love the app btw.

Edit and Update - I've played some more. It appears that the worlds.csv file is not written to until I "save the worlds". Which means when I create a new world manually you are writing some data somewhere temporarily. I can create network links to those worlds even though they are not anywhere on the worlds.csv. Is it possible the network link is looking for something in the program memory that will not exist if I create the world from the backdoor (by copying the file into worlds.csv)? Is that possible?
 
Last edited:
Ok, there is a problem. The app uses a network graph library of nodes and links internally to represent network links. It only creates a node in this data structure to represent a world when you create the world in the app. I need to add a bit of code that, when the worlds.csv file is read, checks the worlds are all in this data structure and creates nodes for them if they're not there. I won't be able to start on that until I'm back from holiday in a week's time.

In the meantime you can crate your project and just won't be able to create links. If you can live with that for a week, then when the new version comes out just upgrade and magically you should be able to create links. At least that's the plan.

In the meantime, if you are desperate there is a laborious manual workaround. Create you project with the worlds you want, open it and save everything. Now copy out the worlds.csv file. You don't need to close the app.

Now for each world you want to create a link for, delete it and then recreate it but don't bother fixing it's data. Save the project and quit StarBase.

Now swap back your worlds.csv file. Run Starbase and open the project. You should now be able to create links for the worlds you re-created. And because you swapped back in your worlds file their data should all be correct.

But that's a pain in the arse and who knows what might go wrong. I've not had a chance to check if it actually works, being on holiday and all that.

Simon Hibbs
 
Thanks for responding. I am just goofing around so in no hurry. Enjoy your vacation. I'll play around some more and see what Trouble I can cause.

Oh, while I have your attention, any advice on the last column in the world's CSV file? What can I use it import? Any particular format? Travel zone? Gas Giants?
 
The last column is basically a placeholder value for the system details.

The Traveller/OGL rules file generates details such as gas giants, trade codes, etc as a small text report which it drops into the description text field of the last attribute, so the attribute code value itself doesn't signify anything, it's always zero.

At the moment, if you want to put trade codes, gas giants, bases etc in you'll need to write them to the System_Data.txt file in each world's subdirectory. As data values they're not actually handled by Starbase at the moment.

I can change that, but the information would have to be generated and stored in a form that fits into the "Code Value + Description Text" way that Starbase represents world data. So it would mean adding more attributes and defining the code values they can have and the default, or generated description text that goes with them.

I hope that makes sense. I am open to extending the data model. For example I might add boolean attributes at some stage - attributes that a world either has or hasn't got. That would be a good way to represent trade codes. However I would like to do so in a way that is generic and not too closely tied to a single game's rules.

If you've not looked at the documentation yet, it does have a brief section in how this works that might be helpful.

Simon Hibbs
 
Ah ok cool. Thanks Simon. I am having a lot of fun with the program.

Incidentally I have been playing around with deleting systems and rebuilding them for the purposes of adding a network link. So far it works!

Enjoy your vacation.
 
Playing around with Starbase some more I noticed that I don't actually have to install Python or a compiler to customize the generation code.

I created a new project using the Mongoose open license rules and was able to tweak the code to add in the rule about starports rolls being 2D6 - 7 + population. I am also changing the words to better fit my planned TU.

Very nice.
 
Playing around with Starbase some more I noticed that I don't actually have to install Python or a compiler to customize the generation code.

I created a new project using the Mongoose open license rules and was able to tweak the code to add in the rule about starports rolls being 2D6 - 7 + population. I am also changing the words to better fit my planned TU.

Very nice.

It was very important to me that it be as easy as posible to customise the app, preferably without having to install anything special, and the world generation script was the obvious place to start. There is a section on how to work with rules scripts in the documentation, and the scripts that come with the app are extensively commented so I hope that helps.

In future I'd like the scripts to be able to provide a list of options to the app, which you can select in the GUI, to adjust world generation. For example this would be a way to implement the 'Hard SF' and 'Space Opera' variations on world generation in one rules script. Or in you case, perhaps offer the alternate starport rule as an option.

For now though, I'm trying to keep the rules scripts as simple and easy to work with as possible.

Simon Hibbs
 
Back
Top