James Randall Musings on software development, business and technology.
TS-Trek

The game can be played online and you can find the source code on GitHub.

I have a long and storied (well, storied to me - anyone reading this drivel is probably thinking get over yourself) history with the classic mainframe game Star Trek. I first played it on the BBC Micro in the early 1980s - there are loads of versions but I suspect I played the Acornsoft version Galaxy (pictured here). I don’t really remember but I’m guessing Acornsoft just because I remember having quite a few of their games in the house in the early days of the BBC…

I truly loved Star Trek as a kid (still do - but not the new garbage, my love ends with DS9, slight soft spot for Voyager) and so I lapped this stuff up back then.

The next version I clearly remember playing is on the PC. I downloaded EGA Trek from a BBS probably around 1990 on a 2400bps modem. Yes. Bits per second. We did NOT have fibre to the door!

I loved this game. Absolutely loved it. It was a little easier to play than the original text based games and the graphics, although primitive, added loads to the experience.

However I’d always been more interested in coding than gaming and around the same time I’d been learning C, first on my BBC (I had a BBC until well past their prime), and then on an Amstrad PC 1512 with Turbo C (version 1.5 I believe). I was also deeply into Star Trek: The Next Generation and so decided to create my own version. I think, think, that just before I started it I somehow managed to get hold of an 80386 PC. My parents must have bought it. I know at some point I sold my BBC for something PC related but I, again think, that was to upgrade the 386 to an 80486.

In any case… enter…. MouseTrek!

MouseTrek

I think I started working on the first version in 1990 and at the time Graphical User Interfaces and mice were all the rage. They were new to most of us, Mac’s were very rarely seen in the UK (I can’t remember ever seeing one in the UK in the 1980s and early 1990s), and Windows 1.x and 2.x didn’t really ship with PCs. Not the ones I came across anyway. However I’d been looking on in envy at the Acorn Archimedes and Gem shipped with the PC 1512 and so I’d experienced the power of this crazy new WIMP stuff.

I think I had Windows 3.0 on the 386 PC but nobody really created games for that back then and my recollection is that even if I wanted to that prior to Microsoft Quick C for Windows the compilers that supported that were rather expensive and out of newspaper round territory. So DOS was the obvious choice. Only choice really.

Probably seems odd to someone today but WIMP was the AI of the late 1980s and early 1990s. You couldn’t escape the term. It was a new way of thinking about computing to most of us and so I decided that my spin on the game should try and take things forward a step and make use of this newfangled technology. In 2025 as I write this its probably hard to wrap your head around, I’m struggling, but back then their weren’t really frameworks for this stuff and so my first hurdle was getting a mouse and basic UI working. It all had to be written from scratch - including interacting with the mouse (good old Int86 as I recall).

So yeah, it was quite a bit of work. I can’t actually remember how long it took - I was still at school (be about 14 years old I think) so it was all done around school and other people using the family computer.

Sadly somewhere along the way I lost the source code - I found it, weirdly without the mouse code - I think I might have written that as a lib, about 15 years back then promptly lost it again. I’ve also lost the executable of the “released” version but I did manage to find my “work in progress version 2”, which I started work on in 1992, and for which I’d added missions and, taking inspiration from The Best of Both Worlds, the ability to do the same trick with the deflectors. Sadly its not really very balanced and the missions get in the way. But you can play it online in DosBox here .

In some ways I owe my career to this game - 2 years later I sent the source code on a 3.5" floppy disc to a business that had advertised for a developer in the local newspaper and I got the job. The pay was truly dreadful (I was paid less than I was paid for cleaning warehouses, and less than what in the UK we would now call the “minimum wage” even adjusting for inflation) but I had an absolute blast working on a scripting engine (I didn’t know it was a scripting engine but thats what we’d call it now), a graphics engine for the PC and code to run on an embedded device pretty much as the only developer. Seriously. It was a very different time (and I think one of the things we’ve lost along the way is the belief that tiny teams, even solo developers, can get a lot done - they could then and they can now).

Padd Trek

Ok. So now we need to spin forward to 2011(ish). In between MouseTrek and 2011 I’d created, but not finished, multiple versions of the game as I’d come to use it as a tool for learning and experimenting with various programming languages. I think the closest one I came to completing was a version for Windows 3.1 that was written directly against the API (ahh the message loop, WM_* messages, you probably had to be there…) using Microsoft QuickC for Windows which was (I think) the first affordable compiler for Windows that actually ran in Windows. I could be misremembering but before then I seem to remember having to use Microsoft C in DOS.

Other versions I recall working on are versions in Visual Basic, maybe one in Delphi and one in Ruby. I’m also pretty sure I got a fair way through one in C++ aimed at KDE on Linux - but the details of that are vague to say the least. In any case none of these got completed and didn’t and don’t feel slightly bad about - completing was never the point.

In any case in 2011 I’d got myself an iPad. I’d already written a few apps for the iPhone and wanted to have a go at something for the iPad. The name, if you’re a Star Trek fan, is a bit of a pun: the game is for the iPad and on Star Trek they would carry arounmd PADDs. Hence: Padd Trek. Unfortunately the source code situation for this is as bad as for MouseTrek. I’ve lost it. At the time I was quite short on cash and I seem to remember having to close my first paid GitHub account as a result and it wasn’t open source. Details are vague. Wasn’t a great period of my life to be honest. I recall popping it onto a hard drive but I don’t seem able to locate it any longer.

And its also no longer playable - I pulled it from the App Store as it just became a pain updating it to support the ever expanding range of devices that Apple was releasing. Screen sizes. Retina displays. It just got all a bit painful. It was written in Objective-C using AppKit and I think I started it before they began to introduce more usable layout systems so it was all a bit awkward.

I do remember it didn’t take that long to create and it saw quite a lot of downloads - I think it was a free download. I added iPhone support to it too, pictured below - though I think in retrospect this is the straw that broke the camels back in terms of my ability to maintain it.

TS-Trek

For whatever reason I recently (at the time of writing) got the urge to build another version of this game: using TypeScript, React and Zustand. I had in mind a quite stylised black and white version of things with strong splashes of colour in key places like weapons and to indicate danger.

So yeah. What can you say. I wrote it again! It was fairly straightforward to write. I hadn’t used Zustand before, and I’d structure things a little differently next time I used it, but it worked great. Really nice state management solution. I’m quite pleased with some of the special effects - the starship and fullscreen explosions in particular. And I like the warping animation too.

Epilogue

I’ve continued to dabble with versions of the game since Padd Trek. I got someway through one in C#, I had a go at a version using F# and Fable and eventually ended up writing this version here, imaginatively called TS Trek because its written in TypeScript.