GAMEON

Hands-on experiment building microservices and cloud native applications
View project on GitHub
There are lots of new technologies and application patterns associated with microservices. If you're like us, learning from reading someone's sample just isn't enough. Game On! is a throwback text adventure game whose purpose is to give intrepid developers who like to experiment "something to build". This blog describes our own misadventures as we do the same.

sample scala room

tl;dr

Day 0

So for me 2017/18 is going to include adventures in polyglot.

This will include but will not be only restricted to Kotlin,Prolog, Erlang, Racket, Haskell, Closure, Scala

Day 1

Decide on tooling.

Learn to stop hating and love regexes

scala> sample
res69: String =
roomHello,<roomId>,{
    "username": "username",
    "userId": "<userId>",
    "version": 1|2
}

scala> pattern
res70: scala.util.matching.Regex = (?s)(\w+),([^,]*),(.*)

scala> val pattern(target,id,payload) = sample
target: String = roomHello
id: String = <roomId>
payload: String =
{
    "username": "username",
    "userId": "<userId>",
    "version": 1|2
}

`

Room on a chip

Game On! is a fun little text adventure written using a Microservice architecture. It’s also extensible, allowing users to write their own ‘Rooms’ (locations within the text adventure world), that run as Microservices, in the cloud, on their own systems, etc.

I’ve played with Arduino’s and Raspberry Pi’s, and similar for quite some time. I tried having an Arduino read data from a Floppy Drive, which was fun, and ultimately led to a crazy floppy disk autoloader. From there, I ended up moving on from Arduino to the Maple, then from there to a Teensy 3.0, and most recently, a rather fun little collection of boards based around a Chip known as the ESP8266

esp8266 board

There are some nice things about one of the ESP8266 boards I had (Witty Cloud / GizWits):

  • you program it using the Arduino API,
  • it has built in WiFi, 4MB of flash to store your code, 64k of instruction ram, and 96k of data ram to play with.
  • it runs at 80mhz or so
  • it has an LED light that can change color
  • it has a light sensor

That’s pretty impressive for something that costs around 5$ shipped.

When you know there are Arduino JSON libraries, and Arduino WebSocket libraries that can run on it, you start wondering: is it possible to host a Room for Game On on an ESP8266 ?

I had a spare moment at a weekend, so decided to find out! =)

Swift and Watson Conversation Service

Thanks to @jkingoliver, we have a new advanced adventure combining Swift with Watson! This room uses the Watson Conversation Service to create a sandwich shop.

Go play!

Local development with vagrant

Setting up the core game services locally can be a tricky business. If you don’t fancy installing our core game services and dependencies on your most favorite dev box, have a look at our Vagrant project, which will set up a virtual machine ready for local development.

Go play!

Using JSR-107 Caching in Java-based rooms

Caching is one of those awkward bits of function you can totally avoid adding when first creating a bit of code. Everything will work just fine during your initial testing, but worries start to creep in when you start to consider what happens when running at scale: will remote services be invoked too frequently? And what happens to session data when processes are added or removed to accommodate changes in load?

There are many Caching libraries for Java, ranging from simple in memory thread safe caches, to distributed transactional remote based services. In this new two-part walkthrough, we’ll go through using Redis as a backing store for JSR-107 caching via the Redisson library.

We also have a new chronicle relating our experience using Redis in the game core:

Go play!

What's the weather like?

@rstephenrrtx has published a new chronicle relating his experience building a room that checks the weather using IBM Weather Company’s REST APIs:

Using Watson Alchemy Data API to create a News room

@bradleyap has published a new chronicle relating his experience using the Watson Alchemy Data API to create a news room:

Adding items (and interest) to your room

Finally! An adventure dedicated solely to making your room more awesome and interesting. This adventure focuses solely on game protocol and how to enhance your room implementation.

Go play!

Creating a room from scratch

Curious how to write your own room from scratch without a fork/clone? We’ve got your back, intrepid explorer, behold this adventure written just for you:

Go play!

Game On! at OSCon London 2016

Kate and I took Game On! to OSCon London! We spoke about our experiences building the game, and Kate created a new room in Java from scratch and showed the game finding the room, and coping as the service recycled in response to updates.

We met all kinds of nice people, including Casey West, Dawn Foster, and Lorna Mitchell.

_93A5673

Here we are on stage!

_93A5318