In addition to translating DURF to Finnish, I found myself working on another RPG-related project. And again, it involved a lot of interesting side quests to get it done.

Traveller is an older science-fiction role-playing game, the first edition was published in 1977. It’s been since revised in multiple different editions. A facsimile version of the 1981 edition of the first three books1 are available for free on DriveThruRPG. The game has been said to have inspired both the TV shows Firefly and The Expanse.

As an older game, it has a lot of simulationist stuff and the core rulebooks even involve square roots!2 Its character generation (chargen) procedure is a mini-game in its own right, and quite lethal at that.

So, I decided to implement both the character generation from Book 13 and the world generation from Book 3… in TypeScript. I’ve never really used TypeScript before, but I’ve come to appreciate type hinting and as my target was the web browser, something that compiles down to Javascript felt like a good choice4.

You can find the character and world generators here. The source code for the site is on GitHub. My unique angle to these generators was to try to match the style of the forms in the rulebooks. However, there are some neat details going on beyond the surface as well.

The rulebooks have burecrautic and official looking forms for many things, and I aimed to replicate those on the web. Fortunately modern CSS has Grids, which made this way easier than it would have been in the olden days with tables. For some font geekery, I tracked down the fonts that were used in the original books (Optima and Univers5) but these were a bit too expensive6 for a hobby project to use. Fortunately, these fonts were part of PostScript Core fonts and so for the open source GhostScript project, there were free(-ish) metric-compatible fonts available (respectively, URW Classico and URW Classic Sans). The two original fonts are so popular that there would have been many passable alternatives to choose from7.

When you generate things, you usually need names for those things. For the character names, I took the obvious route and took datasets of the most common first and last names in English. Both US and Royal Navy have a lot of ships whose names probably work for spaceships as well8, so I scraped Wikipedia for those. For planet names just picking names from a list sounded a bit too lazy, so for added randomness and a nice side quest, I used Markov chains9 to generate new names. The dataset for those are the “canonical” star system names in Classic Traveller universe, which fortunately were available on the Traveller RPG wiki10.

For the world generation, I also took the opportunity to familiarize myself with SVG11. The game uses a hexagonal grid for its subsectors and there’s an excellent resource for all things hexagonal at Red Blob Games. Otherwise, Traveller uses simple shapes for its maps, which were quite easy to draw with the SVG basic shapes.

The generators are not fully there yet, there are some bugs and some missing details. For example, the world generation is missing communication routes between systems. According to the rulebook these are left for the GM to figure out, so there’s no clear procedure for them. So, first, some heuristic would need to be defined.

This was a fun project, and it touched many fun technical topics I’ve wanted to explore, like Markov chains. It was also great to make something for the web again.