R is for Role Playing Games

Traylix waited, he wasn’t nervous but he was pretty sure that something was about to go wrong; it always did. He glanced over to the prince and the two marines standing further down the alley. They all wore long, shapeless cloaks with the hoods up, as did he. Hopefully this subterfuge would deprive any would-be assassins an obvious target.

From up the street Traylix heard the sound of a horse and cart and out of the darkness came  two more cloaked figures, Datura and Winnowen. Behind them was a third figure leading a horse which pulled a cart loaded with barrels.

As they drew level Traylix asked quietly “The gold?”. “In the barrels” answered Datura excitedly.

The figure by the cart reached back, put on the cart’s brake and the stepped forward in a pool of light.

He was a noble looking man and he dropped to one knee, bowing in front of the marines and the prince. “My liege, it is so humbling to finally meet you” he said. The prince stepped forward and put out his signetted hand to be kissed. The noble leaned forward to kiss the prince’s hand and then suddenly leapt up, driving a concealed dagger into the prince’s chest. “The Emperor sends his regards!” the assassin spat as he savagely twisted and pulled the blade out of the prince’s falling body.

Traylix frantically backpedaled to buy himself time as the assassin turned and launched a flurry of blows. In the background Winnowen dragged the prince’s lifeless body out of the way and began casting his powerful healing magic in an attempt to save the prince.

Deadly bolts of magic launched from Datura’s fingers but seemed to wash harmlessly over the assassin. Finally Traylix was able to draw his weapons and counter attack. Boxed in by Traylix and the marines, the assassin tried to put up a  fight but was quickly cut down.

Breathing heavily Traylix and the marines took up guard. He heard coughing and retching over his shoulder and turned to see Winnowen sitting the prince up. He looked awful but alive.

To his left Daturua cursed. Traylix looked over to see that she had been searching the body of the assassin and had uncovered a mark branded into his chest. The Mark of Torquemada… no wonder Datura’s magic was ineffective.

Traylix peered into the dark but there was no sign of any other attackers and the brief fight appeared not to have attracted anyone’s attention.

Well, thought Traylix, that didn’t go too badly… and that was when the gunpowder hidden in the barrels on the wagon exploded and all hell broke loose….

That was a scene from my role playing game last Thursday. Role playing games are kinda of difficult thing to explain to someone. Probably the best way to explain it is, that it is like improv theater but without the audience (other then the other players).

I have been playing pen and paper RPGs since I was a teenager but fell out of the hobby in my twenties. A few years ago I decided to try start gaming again and convinced some of my friends to give it a go. I was somewhat surprised how enthusiastically a bunch of mid-thirty year old professionals took  to RPGing especially the girls (including my wife)!

So how does this thing work?

Well most pen and paper RPGs work as follows:

  1. One of the players takes on the job of the game master or story teller. It is their job to create the world and story in which the other players find themselves. It is the GM’s job to describe how the world reacts to what the players do. This is often the job I take on. It’s quite a bit of work but very rewarding.
  2. The other players each play a character in the story. It is their job to describe how their character reacts to the world around them. To guide them, each character has a defined set of strengths and weaknesses, skills, beliefs and personality quirks. These are all written down on a paper “character sheet”, hence the name: pen and paper RPGs. For instance Tralix is a Doreen (a kinda humanoid dolphin) he is a fantastic fighter and ship’s captain, but he has a loyalty quirk which means he often puts himself in danger to protect his crew and friends. Datura is a female Masaquani, she is somewhat obsessed with gold and suffers from extreme curiosity which gets her and her friends into lots of trouble. Lastly, Winnowen is Kraken (a humanoid squid) who is an powerful wind mage with a morbid fear of whales (it’s a long story).
  3. Some rules  are followed – There are hundreds of RPG rulesets. These basically provide a framework for telling the story. Trying to hit someone with a sword? The rules cover how that works. Want to jump between two buildings? The rules cover that. Fail to jump between two buildings? The rules cover what happens when you fall from a great height. The ruleset my group is currently using is called Savage Worlds.
  4. Lots of strangely shaped dice are rolled. These are used to add randomness to the game. Typically you roll dice when your character is trying to perform some sort of feat. The results of the roll, modified by the character’s abilities (or lack thereof) determine if that feat succeeds or not and affects how the story unfolds.
  5. A setting is used. These provide a world for the game master to weave the story in. The setting we are currently playing in is called 50 fathoms. It is a fantasy pirate setting (think Pirates of the Carribean) where the world is slowly being flooded by a witches curse. Of course it is the player’s mission to stop them. Many game masters create their own settings (I suspect we all think we are Tolkien or something).
  6. Pizza is consumed and fun is had

As I said it’s pretty hard to explain and is really something you need to experience. But take my word for it, it is heaps of fun.

Here is a short clip of a RPG gaming session from the Tabletop gameshow, hopefully it will give you a better idea of what goes on. Although I must admit my gaming group is not nearly as focused but that is how we role… see what I did there :)

YouTube Preview Image

 

P is for Productivity in New Zealand

It costs 40c to produce every dollar in New Zealand which, is pretty astounding figure. A report released this week by the New Zealand Productivity Commission tries to determine why New Zealand’s GDP per capita is generating over 20% below the OECD average when (based on it’s broad policy settings) it should be generating 20% above the OECD average.

It identifies a number of causes:

The country has good resources – investment in physical capital and average years of schooling are broadly consistent with other countries. Employment of low-skilled workers also plays only a minor role in New Zealand’s poor (measured) productivity performance.

Instead, over half of New Zealand’s productivity gap relative to the OECD average can be explained by weaknesses in our international connections. New Zealand firms face reduced access to large markets and limited participation in global value chains, where the transfer of advanced technologies now often occurs.

Most of the rest of the gap reflects underinvestment in “knowledge-based capital”. In particular, R&D undertaken by the business sector is among the lowest in the OECD, reducing the capacity for “frontier innovation” and the ability of firms to absorb new ideas developed elsewhere (“technological catch-up”). The quality of management in New Zealand is also low, which lowers the productivity gains from new technology.

The paper also outlines ideas for addressing these problems. It’s a good read. The 4 page summary PDF can be found here and the full paper (An International Perspective on the New Zealand Productivity Paradox) can be found here [PDF].

O is for Open Source I use (and create)

Today I thought I’d go through some of the Open Source software that I regularly use. The Open Source movement is a interesting one, basically it calls for the source code of software to be released alongside the software. This allows anyone who can (or needs to) to modify the software and pass these changes back to the community thus benefiting all.

Traditionally Open Source products have been less polished then commercial software but these days, many rival or even better their commercial counterparts and Open Source software powers much of the Internet and even the mobile devices that you use everyday.

I have a few Open Source projects knocking around. Probably the most successful of these  is CsvJdbc. This project is over 13 years old (I started it on the 9th January 2001), it has been downloaded tens of thousands of times and it is included in numerous other software packages (including commercial ones). Ohloh estimates that over 7 man years of effort has gone into the project, worth almost $380000 USD. Not bad for free software. Whilst I no longer actively work on the project, others have picked up where I left off and the project still thrives.

But enough about my projects, here are a list (in no particular order) of some of the Open Source software I use:

 Notepad++ is an awesome text editor. I use this multiple times during any given day. It has a huge number of plugins and add-ons to tackle any text editing task.

I have already blogged about Blender. If you are interested in 3D modelling and animation then check it out.

Inkscape is another great piece of software. It is basically a vector image editing software, similar to Adobe Illustrator. Along similar lines, Gimp is like Photoshop. It’s user interface can be a little confusing but it is a powerful application.

VLC is a great media player and FFmpeg is a swiss-army knife for video format conversion (be warned it uses the command line).

Both Firefox and Chrome web browsers are open source too. As is Android the operating system you find on many phones.

This blog is powered by a bunch of open source software including WordPress.

As a software developer I use tens of pieces of Open Source software to do my job. Including:

  • Putty – a SSH client
  • WinSCP – A graphical SCP client
  • Jetty – A web app server
  • Python – A programming language
  • Java – A programming language
  • jQuery – A JavaScript library for creating web applications
  • AngularJS – A JavaScript framework
  • Eclipse – An integrated development environment
  • MySql – A database
  • Apache – A web server
  • PHP – A programming language
  • Ubuntu – An operating system

Etcetera, etcetera… its pretty safe to say that without Open Source I would not be able to do my job and they way we use the Internet and computers would be very very different!

M is for Monkey – the evilest testing tool around

I do a heaps of Android development and whilst it appears straightforward there are quite a lot of subtleties, particularly when dealing with threads and UI updates, that generate all sorts of app crashes.

Unfortunately these race conditions are often very hard to reproduce. Thankfully (and evilly) we have the monkey testing tool. Set it loose and it frantically taps and swipes away, switching activities, causing mayhem and inevitably crashing your app.

Running monkey is really easy just, run the adb tool with the following parameters:

adb shell monkey -p your.package.name -v 500

Also make sure you run monkey on your app, on different versions of Android, especially if you use the support libraries which don’t always behave the same way on different OS versions. You will be surprised at what goes wrong.

Let loose the monkey and despair ☺

L is for Logo and wee little turtles

Logo was one of first programming languages (after BASIC) that I really learned in depth. The most famous aspect of Logo is its turtle graphics which simulates a tiny turtle to which you can give commands such as forward, backward, left turn and right turn. As the turtle moves on the screen it draws a line behind it.

With its graphical feedback, turtle graphics is an ideal way to introduce people to programming. Today I thought I’d go over some examples. I’m not going to use Logo but rather the Python programming language which has a turtle graphics module.

First steps, install Python and then launch IDLE (the Python installer should have created a short-cut). Now enter in the following (press Enter at the end of each line):

from turtle import *
showturtle()

You should see window with a black arrow in it. This is the turtle. Now type

forward(100)

The turtle should now move forward 100 turtle steps. Next enter the following lines:

right(90)
forward(100)
left(90)
forward(100)

The right and left commands turn the turtle the number of degrees you specify. It gets a little tedious to type these out the whole time so there is a shorthand. Try these commands:

bk(50)
fd(50)
rt(45)
lt(45)

Ok let’s try something more interesting. We are going to draw a square but first let’s clear the screen:

clearscreen()

Now the square:

fd(100)
rt(90)
fd(100)
rt(90)
fd(100)
rt(90)
fd(100)
rt(90)

Nice. But what if you want to draw lots of squares. It would get very boring typing out all those commands over and over again. Let’s tell the computer how to draw a square (note the indentation of the lines, these are important):

def sq():
    fd(100)
    rt(90)
    fd(100)
    rt(90)
    fd(100)
    rt(90)
    fd(100)
    rt(90)

Now we can just type:

sq()

to draw a square! Try this:

sq()
rt(5)
sq()
rt(5)
sq()

Shiny, we are getting a neat pattern forming… but once again it’s too tedious. So enter this:

clearscreen()
speed(0)
for i in range(6):
    sq()
    rt(60)

The speed command makes the turtle move faster so we don’t have to wait. The for statement gets the computer to repeat a set of commands and the range(6) command creates the numbers 0 to 5, which means that the commands sq() and rt(60) are repeated 6 times. Lets add a fd command in each iteration (step) of the loop:

clearscreen()
speed(0)
for i in range(72):
    sq()
    rt(5)
    fd(20)

And we get a donut type thing. Finally lets go crazy and write a new command called polyspi that calls itself!

def polyspi(angle,inc,side,times):
    if times > 0:
        fd(side)
        rt(angle)
        polyspi(angle,inc, (side + inc),(times - 1))

This is called recursion and because it changes it’s side and times values when it calls itself, we_ _can generate all sorts of interesting patterns such as:

clearscreen()
speed(0)
polyspi(90,5,50,50)

polyspi Example 1

or

clearscreen()
speed(0)
polyspi(95,1,50,100)

polyspi Example 2

or

clearscreen()
speed(0)
polyspi(117,3,25,200)

polyspi Example 3

To find out more check out the Python turtle documentation. Have fun!

K is for Kinect Fusion & 3D selfies

I’d thought I’d give the Kinect Fusion demos a try. Kinect Fusion allows you to take 3D scans of things by waving your Kinect around. It’s designed to work with the desktop/Windows version of the Kinect but I’d thought I’d give it a go with the Kinect from my old XBox 360.

Turns out it works pretty well. The resolution is pretty low but if you were using one of the new Kinect v2s things would be a lot cripser.

Here is a selfie (holding the Kinect at arms length):

YouTube Preview Image

And here is one of son number 1 (who did a fantastic job of sitting very very still):

YouTube Preview Image

You if you want to give it a try yourself you can download the Kinect SDK from here.

 

J is for Jasper – control anything with your voice

So I bought a Raspberry Pi a couple of months ago and I’ve been having all sorts of fun trying out different things. I’ve created a wifi packet sniffer to track mobile devices and turned it into an arcade game machine, all sorts of interesting things.

Jasper is going to be my next weekend project. It basically lets you build your own J.A.R.V.I.S (from the IronMan movies). Here is a video of it in action:

YouTube Preview Image

I’ll update this post once I’ve tried it out :)

 

 

I is for Insel – an fantasy setting I’m working on

Insel is a fantasy setting I’ve been working on for a role playing game. Imagine a island covered by a crowded, renaissance city surrounded by a vast ocean. In all of history no one who has left the island has ever come back.

Metal is plentiful and intricate “clockwork ” machines power the society. Food and “wood” is grown from fungus and giant mushrooms which are farmed in the many abandoned mine tunnels under the city. Fish is the primary source of protein.

The city is governed by a council of guilds and the powerful church. The church also runs the guard of the city who keep the peace and defend the city from creatures which occasionally rise from the depths or crawl out of the mines. However all is not right with Insel.

Lorenzo’s Tale is a short bit of fiction that I wrote to help solidify some of the concepts of the world. I hope you enjoy it.

“Lorenzo’s Tale”

Lorenzo squinted into the night sky as his coracle gently bobbed on the ocean. With just a stretch of his imagination he could make out The Winged Horse raring up to crush The Serpent, the stars of the constellations seemed weak and ill. Grandfather used to recount tales of a night sky filled with hundreds of stars that shone so bright you didn’t need a lantern to walk around at night! That must have been quite a sight, Lorenzo though to himself.

Shaking himself out of his reverie, Lorenzo checked his lines and nervously cast his eye across the small fleet of fishing coracles bobbing around him. The stars aren’t the only things to be disappearing he thought, the sea should be teeming with Shrike on their annual mating run but this year they seem to have completely disappeared.

In desperation, the fishing fleet had been forced to move further and further away from Insel and it’s protective shallows. Going this far out was mad, a shiver ran up Lorenzo’s spine. He lied to himself, pretending it was just from the cool night air and not the dull fear trying to claw its way out of his gut. Perhaps he should have listened to Mora and not gone out with the fleet tonight but the fish were critically important to the city. So important in fact that Guild Master Arvo came down to the docks with Demi-Bishop Ragner to see the fleet off. The Demi-Bishop’s sermon was riveting, his blessing comforting and Lorenzo had cast off in high spirits.

“Lorenzo,” a voice called across the waters. Lorenzo turned to see Zefron hailing him from a nearby coracle, “you catch anything?”. Lorenzo shook his head and shouted back “Nothing! How about you?”

“I…” yelled Zefron. A massive tentacle smashed into Zefron’s boat, a second grabbed Zefron, raising him up into the air and then slamming him violently into the surface, before pulling him under.

“Sweet Mother Mary!” Lorenzo gasped as he stood stunned, watching the wreckage of Zefron’s coracle. Panic took hold and he started to scream “Leviathan, Leviathan…”. Confused shouts and then frantic screams erupted throughout the fleet.

Lorenzo grabbed the crank handle of his coracle’s motor and started to crank for all his worth. The flywheel painfully spun up to speed, the gears meshed and his boat started to slowly move, building up speed. He turned it towards Insel and safety. ”Sweet Mother Mary” he prayed “please let me see Mora’s face again. Please, please please..”

Behind him the catch lights of the fleet winked out one by one and the screams died away.

H is for Hosted network

Windows 7 and above has a neat feature called hosted networking. This allows you to turn your laptop into a wireless access point. This is very useful if you want to share your laptop’s Internet connection with other wireless devices or (the reason I use it) for testing.

To set up a network open a command prompt and run the following commands

netsh wlan set hostednetwork mode=allow ssid=”GremlinsTestAP” key=”Pa$$w0rd”
netsh wlan start hostednetwork

This will create a wireless access point named GremlinsTestAP with a password of Pa$$w0rd

To shutdown the network run

netsh wlan stop hostednetwork

More detailed info can be found here: