The short answer is nothing. I realised that such a broadly scoped project was far too much for a half hour a day train journey.

I started coming up with ideas for indcht, outlining what subsystems would be required - database, authentication, real-time message distribution, session management, caching and so on. The thing is that each of those is complex and even using a library like passport for authentication still leaves a lot of work to join it all together. In the end indcht just has too much scope.

So I regrouped and instead focused on one interesting part and then moved on to look at smaller-scope things that might take a few weeks at a time.

TL;DR

Instead of indcht I built:

  • A couple of Microsoft Orleans .NET core projects that represent a real-time group chat with connected client sessions.
  • A static-site generated version of my CV using metalsmith
  • A CV builder that takes markdown and a CV layout described in React with server-side rendering to produce a static CV
  • The start of a colour-by-numbers game built with pixi.js

After deciding that building indcht was just too much of a mountain to climb - I didn’t want to spend the next year spending my half-hour train journeys slowly climbing to the summit - I took one small part of that and looked at leveraging an interesting technology to solve it.

A while ago I had read about Halo 5 and how the team used a new technology out of Microsoft research labs to scale the multiplayer experience to thousands of simultaneous players. That technology was later open-sourced and called Microsoft Orleans. You can find a good description of what it is and how it works on that site, but simply it’s a distributed actor framework designed for high scalability.

Since I develop on a ~2011 macbook air I haven’t got a whole lot of horse-power to be running full bells-and-whistles development environments so I turned to Visual Studio code with .net core and the beta version of Microsoft Orleans. The idea is simple - create a representation of group chat rooms in Orleans as a Grain and connect multiple clients to it in order to exchange messages.

As Orleans was quite young at the time, and in beta, the documentation was actually out-of-date so it took a bit of time just getting it running - fortunately the github issues had details of what changes were needed to the getting started templates to actually make it work. Once it was running it was really simple to create a Grain representing a chat room. I’m not going to use this summary to describe the ins and outs of Orleans, but a Grain is basically the core representation of a virtual actor in Orleans and its lifecycle is controlled by the Orleans platform. Anyway, it was fun to play with .net core and use Microsoft Orleans. In fact I took what I learned and during development days at MindLink with a fellow developer, Niccolo Terreri, we built a more substantial group chat platform based on Microsoft Orleans.

After that I changed my focus onto other things, such as creating a CV using metalsmith - a static site generator - and then creating my own CV generator using React components and server-side rendering. The main reason I chose to do this was because the last time I updated my CV was over 2 years ago and it needed a refresh. There was a lot of noise around markdown or JSON Resume as a nice and more maintainable alternative to using word documents or latex for CVs.

I really need to clean up my implementation of a react CV generator, I plan on getting back to that soon to publish it on github. It is working, but it’s pretty ugly trying to figure out the best way to support any kind of CV design. I think that I may make the required source more structured - like use JSON Resume as the format the React views render and convert the markdown into that. At the moment it’s a custom definition that then is turned into JSON Resume or a static site depending on what you want. I used TypeScript and created a simple pipeline transformation engine to take markdown and assets and turn it into a data structure that is passed as props to a React component representing the CV layout. Leveraging server-side rendering the React component is saved to HTML and the associated assets copied over to an output folder. Turning that into a pdf is simple, either manually through Chrome or using a command-line utility.

I then felt like I needed a break from CVs and React and turned to games. My wife really enjoys this colour-by-numbers game in the iTunes App Store that has a free and paid tier. The paid tier is extortionate (~£20 per month) and I was trying to figure out why it has such a high cost. The concept is simple enough, the gameplay not hugely complex. However, I think the artwork is probably moderated, if not completely hand-built by paid artists. I’m pretty sure that you can get good-enough results with an automated algorithmic approach, maybe with community moderation. My idea is this:

  1. Use a royalty-free image source (multiple sources probably) that have an API that offers search and categorisation
  2. Periodically search for new source images,
  3. For each image
    1. shrink it to something reasonable (64x64/128x128)
    2. Quantize the image to a maximum of 32 colours
    3. Process the quantized image to produce a format that can then be modelled by the game engine

None of that process is out-of-reach of current technology, there’s also a lot of room for improving the quality with machine learning. The cost of such a system should be quite low too - perhaps even possible to perform on a raspberry pi zero… hmm…

Anyhow, I wanted to get a UX in place first and chose to use pixi.js after trying phaser and finding it awkward to use. I’m not too hot with graphics, which is one of the reasons I wanted to start there, so I will describe my progress in another post.

Hopefully that answers the question of what I’ve been doing on my train journeys instead of indcht!