• 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.

World generator program for Cepheus Engine/Traveller

Golan2072

SOC-14 1K
Admin Award
Marquis
I wrote a new, far better (IMHO) version of my old Classic Traveller world generator program, this time using the OGL Cepheus Engine rules. The worlds and files it produces are compatible with all 2d6 OGL Sci-Fi games and essentially with most versions of Traveller.

It uses Python 3 (installed on many systems nowadays) and has an old-school text UI. It can either generate one world or an old-type SEC file used by many Traveller-related applications.

Feel free to use, adapt to your own use, improve, and of course - comment.

Get it HERE!
 
Thanks mate.

I'm blatantly stealing your dice function. I personally didn't make the leap of logic to just pass dice sides and number of rolls to a generic function...had individual functions for each D type.:eek:

For the pseudo-hex thing (love the label) I just use a list. Saves on all the elifs etc.

Again, thanks. Good work.
 
A world generator is a great project to complete in any language and yours looks very nicely designed. It's always interesting to see how other people tackle a problem. I’ve never got round to implementing SEC file output in any of mine.

Simon Hibbs
 
simonh, nice code! Would you guys consider a team project to integrate the best of both programs? With the release of CE it seems like there's a time for open source explosion! Of course, it'd be even cooler to let the user have an option of what type of data to produce; CT, T5, CE, MgT, short form or SQL/NoSQL.
 
simonh, nice code! Would you guys consider a team project to integrate the best of both programs? With the release of CE it seems like there's a time for open source explosion! Of course, it'd be even cooler to let the user have an option of what type of data to produce; CT, T5, CE, MgT, short form or SQL/NoSQL.

Absolutely, I'd love to work on something collaboratively. In fact I specifically wrote StarBase (see sig) to easily accept plug-in world generation scripts to customize the application. The full source is up on GitHub.

I've not done any work on StarBase for a few years, but I am working on a similar mapping application on iOS after a bit of a hiatus. I'm using Pythonista. The world generation script I'm using is exactly the one on GitHub, but the iOS app currently doesn't have a save system so an adaptation of yours that uses SEC file format for persistence would be very attractive if I can use a clean calling interface from the rest of the app. There would be a lot of issues to unpick there though because for a mapping app saving or exporting the world data is only one piece of the persistence puzzle.

Simon Hibbs
 
Very cool.

I think there are some options to generate Winderz executables so that someone wouldn't need Python installed. Of course, having a reason to learn more Go wouldn't hurt, either. :p
 
Very cool.

I think there are some options to generate Winderz executables so that someone wouldn't need Python installed. Of course, having a reason to learn more Go wouldn't hurt, either. :p

That's exactly what I did for StarBase. There's a download of a windows executable package available from the link in my sig. The executable package is also capable of loading python source script files at run time to customize the list of world attributes and the world generation process. It's all described in the word file StarBase_Introduction_0.23.doc in the download or in the source repository.

Simon Hibbs
 
Thanks mate.
You're welcome :)

I'm blatantly stealing your dice function. I personally didn't make the leap of logic to just pass dice sides and number of rolls to a generic function...had individual functions for each D type.:eek:
Enjoy! Open Source FTW!

For the pseudo-hex thing (love the label) I just use a list. Saves on all the elifs etc.
I was originally thinking of learning Dictionaries for this (I'll learn them anyway), but now that I think of it, a list would be perfect!

Again, thanks. Good work.
Thanks!

A world generator is a great project to complete in any language and yours looks very nicely designed.
Thanks! I also think I learned much from the many mistakes of my old script...

I’ve never got round to implementing SEC file output in any of mine.
Feel free to use my code :)

simonh, nice code! Would you guys consider a team project to integrate the best of both programs? With the release of CE it seems like there's a time for open source explosion! Of course, it'd be even cooler to let the user have an option of what type of data to produce; CT, T5, CE, MgT, short form or SQL/NoSQL.
I would really love if someone will help me with the UI, as right now I can only write an old-school text UI. I will eventually teach myself tkinter (Windows UI) and Django (web integration), but right now I would be glad with help in this area.
 
tkinter is horrible, trust me. For Python I think the best cross platform GUI toolkits are probably WxWidgets and Qt. I've tried both starting with WxWidgets but moving on to Qt (first using PyQt then PySide) which I found to be far superior in every way.

For PySide there are plenty of examples provided with it and online tutorials to get you started. It works very well on Windows and Linux but I've always had problems getting it to work well on OSX though I haven't had a go in a few years so that may have changed.

Simon Hibbs
 
I'd say go with TKinter as it's in the Standard Library, I believe. However, your text based menu system isn't bad, just needs a more automatic refresh.
 
I'm trying to wrap my head around GUI development, with both tkinter and PySide I don't "grok" it yet. Will have to learn other parts of Python first.

How simple is web development (Django? Flask?) for Python?
 
If the goal was to end up on the web I'd do PHP or Javascript. Things like Django are a lot of overkill for something like this.
 
So what's the best method to give this a non-textual UI?

Sort of depends where you want to end up. How tech savvy do you want to require of the users? Most Windows computers do not have python installed, so a self-contained executable would be useful. Then find out which of the GUI modules (Tkinter, Wx, etc) do the self-contained thing best. Then try a little with the ones simonh pointed out and see which one works best for you.

However, if you want it on the web, then hang with web stuff. Make sense?
 
There's probably an Oracle plugin from Python. Of course, who wants to use it when you have MariaDB, SQLite, and MongoDB at hand?

Both golan2072 and simonh are writing good clean code, so if you know any language you can probably figure out most of it.
 
Oh, I thought you meant Oracle as in database connections. I don't use GUI IDEs, though I've heard good things about eclipse.

Are you in the GitHub Makhidkarun group? If not, holler at me or tjoneslo and we'll set you up.
 
One thing at a time. :)

Recommend working on OOP and seeing how simonh did his stuff.
 
Back
Top