Tuesday, 10 December 2013

I made a game...

...That sadly doesn't have zombies in it. I announced on here a few months ago that I had left my gainful employment in order to pursue a career in development. The result of my first such attempt is called Save the Village and is out now on Google play. This is the link.

If you have an android device, please download it. It's free!

Wednesday, 27 November 2013

Some thoughts on national economics

I've been thinking recently about how to design an economic system that might actually work for both a nation and it's citizens. It's too early/late to do this with any real form or structure, but some of the ideas have been floating around in my head whilst I was trying to sleep so I thought I may as well get them down.

The problems are apparently legion in the UK. Our productive base is too low, our skill set is limited and the government coffers are bare so it is impossible to drive investment (or so the thinking goes) from a national level. Now the last is a particular issue for me as I personally believe in relatively high amount of nationalised industry and infrastructure being essential if a nation is to work for all of its citizens. As such a lot of my thinking is around taxation, and how to raise this (and all government income) to provide for the level of service I think would be desirable.

With that said, the first thing I would do would be to introduce a tax cut for some of the highest paid. Don't worry, I've not just suddenly turned into a conservative. The elimination of the personal allowance strikes me as unfair and hides a large marginal tax rate, so I would get rid of that in the aim of simplifying the tax code. This would be followed by a reinstatement of the 50% threshold at £150k. I've not run the numbers on this, but expect it would be largely neutral in terms of revenue. I believe there would be scope to increase the high earnings threshold further than this (there have been some studies recently that suggest the peak of the Laffer curve is anywhere between 55% and over 80% depending on if the additional salary drawn is a form of rent-seeking) and would point out to those against such an argument to the link between the UK's economic performance in the last three years and FTSE executive pay.

Land is a fixed commodity in the UK, and any use or ownership of it should be (in my opinion) taxed. While this concept may cause a lot of people to flinch, it is something that already happens via council tax and business rates. One issue with those though is that the rates are localised and (in the domestic case) the scale is effectively regressive accounting for a higher proportion of the living costs of those of limited means compared to those earning more. An LVT based on the land's rental value will aid this. There would probably have to be some safeguards in place for the elderly who now lived in houses where the tax was unaffordable. This could come (for example) in the government paying for the tax via an inflation linked loan, repayable when the house was sold or the occupant died.

There would be a system of penalty for idle ownership of multiple homes, or of land that was viable for development that remained undeveloped. In the former case, things like private rental would have to be accounted for as a protection. A suggestion would be to have to prove that the property was occupied via private rent for at least 180 days via rental invoices or contracts. Where this condition wasn't met the rate of tax on that property would be doubled, or at least increased by a percentage. There (for me) is no room for the government to force land-owners to develop, but the tax system is not just there as a means of raising income, but also for providing incentives for behaviour (bear this in mind as I continue). Thus, the longer idle undeveloped land is held the rate of tax would increase on a sliding scale.

Also on property, I would get rid of stamp duty for property sales and instead charge capital gains tax on the profits made from the sale of every property. This would function as a counter-cyclical brake on the housing market. If prices were rising too fast, the disincentive of CGT would cool it slightly. In a slow market there would be no tax levied on house sales which should stop the market drying up entirely.

Now to corporations, companies and employment. There are a lot of conflicting arguments about this, and they are often all couched in terms of absolutes. The problem is that the economy is made up of lots of companies of varying sizes who would be affected in very different ways by the same arrangement. But as the range is continuous, it would be impossible to tailor a two tier system without harshly punishing people close to the divide. For example, an argument against the minimum wage (and one I have some sympathy with) is that a small cafe in the North-East may become nonviable if they have to pay all staff a calculated living wage based on national averages. However not having a reasonable minimum wage enables those that provide capital to exploit those that provide labour where there is a labour surplus.

It's a difficult square to circle. How to allow smaller businesses to stay afloat in tough times, while ensuring those that can exploit weaknesses and loopholes in the economy pay a far share of tax. Instead of looking at an raising an absolute minimum wage, perhaps it would be better to leave that as it is, and instead look at enforcing payment ratios onto large companies. This would mean that if the ratio between the annual salary (after bonuses perks and the like) of the highest paid executive was more than a certain multiple of the lowest paid in the company, that company would be penalised through the tax system.

You may well be asking how this is possible, given that the complicated tax arrangements of the largest corporations means they pay as little as a tenth of a percent of earnings in tax. Dealing with that is also essential, but probably beyond the scope of this post. Instead I would propose a 'fine' of a tenth of a percent of UK turnover (defined, for example, as a transaction where at least one of the parties was domiciled in the UK) for every multiple above the limit. The highest paid in this scenario would be the highest paid in the company full stop. For this exercise we would only be looking at the lowest paid in this country. So if the multiple limit was 100x (for the sake of argument) and the true multiple was 110x, then the company would be 'fined' 1% of it's UK turnover, regardless of their P&L figures.

That isn't exactly the problem solved in it's entirety, but it is as far as I'm willing to write tonight. A further night of insomnia in the future may lead be to add to this via another post.

Friday, 20 September 2013

The long hard stretch to the finish

As I noted last week, I am currently developing a game for Android. The concept for the game (Save the Village) is a relatively simple one, catch the fireballs as they descend the screen lest the village below burst into flames. While the graphics are, shall we be polite and say simplistic, the gameplay is actually fairly compelling. This isn't me saying so myself per se, but friends and family who have given the development code a go are often compelled to have another go or two before handing it back.

One problem though in doing all this for the first time is that it can be insanely easy to underestimate the amount of time left in development. I have a to-do list stored via the quite impressive Wunderlist, which I use to keep track of my progress. What I don't see though is the number of dependencies that the little tasks I'm setting are creating in turn. It can occasionally feel a little demoralising, I've felt like I'm a fortnight away from finishing for the last three weeks! Hopefully this stretch is actually the last stretch. I'll post something over the weekend about the game itself (rather than my travails) for anyone that wants to see it.

Friday, 13 September 2013

2 Lines

I posted a couple of days back about how I'm trying to become a games developer. At the time I was feeling pretty good about the whole thing. Well, as it goes I'm still feeling pretty good about the whole thing, but I have been bashing my head against a brick wall with an issue for the last couple of days.
So the game works, it does everything it needs to in terms of playability. OK the difficulty needs balancing, but I'm happy to say that's coded in such a way that they take only seconds to write (play testing is the awkward thing). So all of my screen transitions up to the game work, the main menu, the pause menu (placeholder graphics, but meh) all good. All I need is a local high score screen and I'm pretty much good to go.

So as ever I think about the components needed to do it correctly:
  • SavedPreference object for holding the score? Check.
  • Sorting function to determine which high score has been achieved? Check
  • Text box for the player to type their name? ...
Ah. Adding text itself isn't an issue* but adding text that an end user can interact with is. So days, literally (not the new meaning *glowers*) spent trying to work out how I could get an editable text box to pop up in front of the user so they can enter their name. Repeated goes at typing very very similar lines of code in slightly different files led me to understanding less and less of what I was reading. My desperation for a resolution sent my commenting and back-up policies out the window.

And then, this morning, a breakthrough! A new view up on screen (floating, as it were, on top of the main screen) from which it will be simple to add one of the Android widgets. Except, well it wasn't. Again. And now the errors that were being thrown were miles out of my comfort zone, null pointer exceptions are fine, but these errors felt like dissertations on multi-threading.

Back to the internet, to the Android documentation, to stackoverflow.com. After a little while trying to find similar issues, I new I needed to add a looper and a handler. But how do they talk? What exactly do I need to do?

Finally out of desperation I took the first part of the code and just stuck it in the one thread I know I have running:

//Some other stuff
 And it worked!

I'm still not entirely sure how the handling is being done, or if I'm just being hideously obtuse. For now though I'm just going to take it as a win, and leave the thinking for when I'm more likely to cope with it.

*For those interested in this sort of thing, the game framework is based on Mario Zechner's book 'beginning android games' which I discovered through the tutorials at kilobolt.com. The framework uses a surface view to render all the goings on to a single bitmap, which is then scaled and drawn to the resolution of the device.
This works brilliantly but adding additional 'View' components isn't the simplest thing in the world, at least to a novice like me.

Thursday, 12 September 2013


I guess I'm what you'd traditionally term a 'bit of a geek'. I enjoy physics, video games, statistics, understand how to read weather charts, and until recently spent a lot of my spare time learning how to program. 'Until recently' as I now spend most of my time doing that.

For all that though, I do break with the exaggerated American high school stereotype in that I'm quite a sports fan, most of all football. It's actually quite a weird one to explain when someone points out the dichotomy of finding the pacing of most TV dramas to be so slow as to be unwatchable (and TV in the main to be a fools errand) yet enjoying watching 22 blokes run after a bit of leather for 90 minutes, while very little happens.

Tuesday, 10 September 2013

Into the unknown

So today I wanted to spill my mind about the last 6 weeks or so. I was going to do that yesterday, but my brain was crazy melted by the wonder of Sharknado so I wrote about that instead (seriously if you haven't seen it get some mates round and give it a whirl).
So anyway before I get hit by another wave of B C D-movie delirium...

Anyone that knows me reasonably well in person will know that I started this summer as an advancing data-quality BA at a quite well known investment bank. The money was good, I'd been promoted in the winter and had been managing a team of three since the year before. Those of you who know me from my online persona only may be a little surprised to hear this, as I am quite an outspoken 'lefty'.  Still bills gotta be paid and all that, I got a call just after getting married (with the previous company I worked for having gone broke) that there was an opening and I would be a good fit. Here we are three years later.

That was how I started the summer. I am now 'unemployed' and am in the comfort of my own home during the traditional 9-5. So what happened? Well first and foremost, this isn't some 'woe is me tale', I resigned and left in late July . But why?

Sharknado: the drinking game

I was planning to write something moderately self absorbed on here this evening, tracking the last couple of months of my life, plans for the future, all that jazz. That's going to have to take a back seat though, for today I arrived (late, as ever) to the party they call Sharknado.

Sunday, 8 September 2013

Just something....

It's weird talking into the abyss. Twitter, Blogger, Facebook. All these words and thoughts that spill (mostly on twitter in my case) onto social media, forums and the like that have barely even been committed to your own thoughts before they are part of the global conversation.
Talking on the internet is as if everyone is attendant at a giant party, but instead of hanging with the two people they turned up with (and *that* guy who thinks his every utterance is the funniest thing but strangely only you will listen to) everyone slinks over to a space and just talks. Some people talk loudly or compellingly enough to drag people closer and start a conversation, others provocatively enough to start an argument.
Then there are some that arrived late. That could only get a space on the dancefloor where the music is blaring so loud that they can't be heard anyway. Still they talk though, you know, just in case. Or even some that have an apparently handy spot by the bar, but are talking the most inane bollocks that all the drinks are being served in the other room.
Personally, I try and get involved, occasionally. Or I play the 'wallflower'. Watch, listen, try and learn. But there's no record of the thoughts of someone who just watched. Does there need to be a record?

Monday, 6 May 2013

Anarchy - the flawed ideal

I saw a comment on twitter today that I felt needed a reply, however at the time I was in no position to do so and anyway it's the sort of reply that stretches the ability of 140 characters. The comment was as follows:

... remove the gov and we don't have the problems and remove capitalism and we r free..
(Name and pic removed at composers request)

Bang, there you go, government and capitalism gone, sorted. I assume from that point on we are all free to play tennis or something like all those middle class families that smile just a bit too much in commercials. I feel pretty comfortable to state that the assertion is wrong but in this post I'm not going to spend time on the capitalism issue, which is a full dissertation on its own, and instead look into what may happen if we didn't have a government. Just to make it a light-hearted I'm going to borrow a little from the style of the brilliant what-if over on xkcd.

So one day we wake up and there's no government anymore. No-one is quite sure what has happened or how, but the government has simply ceased to be. Everything else is as before but the entire organisational machine of government  has disappeared, no councils, no parliament, just Nick Robinson looking blankly at the palace of Westminster sure there was a reason he went there, but clueless as to what it was.

For a while things continue as normal, people habitually pay their taxes, even though it's to no one, everyone turns up for work when one day the company that owns the electricity contract for a council gets no payment on a bill. The following week, all the streets in the town go dark every night leading to confusion and a slight increase in opportunistic and sometimes violent crime.

Similar minor administrative things happen up and down the country, people lose their jobs and head down the job-centre only to find that there is no-one to authorize the payment. Railways halfway through building stop because no-one is sorting the funding. potholes on main roads aren't prioritised for repair causing more accidents.

In one little pocket though a group of citizens have spotted the problem and are at great pains to sort it out as fairly as possible. It's only a small town so posters went up for everyone to meet in the town hall one day. There they decide that each evening they would meet, discuss the town's collective business that needed to be done that day and all vote on who should do what, and which issues should take priority. It's tiring, but it works so they keep at it.

Word gets out to the neighbouring town and a few others who adopt a similar system, though in the first town attendance is dwindling, not by much, but noticeably with some who realise that things will be sorted anyway. But still the system spreads and word gets round about issues that effect groups of towns rather than single ones. Of course this will need to be discussed, but no town has a room big enough. After some thought at one evening's meeting it is decided that each town should send a few representatives and the attendees can discuss on behalf of everyone in their town.

The meeting goes swimmingly (this is rather an idealised scenario, but all of the other thought experiments I did with anarchy left quite a lot of people dead) and more towns are picking up on the process and inviting all inhabitants to discuss. In the home-towns of the early adopters though, less than half of people are turning up to make the decisions and everything is still getting done.

One bright spark somewhere decides, why not formalize this? If everything can be sorted with only the input of a few people, why not let them get on with it in our best interests and have another couple of representatives to discuss matters with the other places that have this system.

The idea spreads. Why have everyone busy every night, when we could vote for certain people to represent us and then carry on with our lives?

Well. I guess you can see where I'm going with this convoluted tale. Most of the things that the government and politicians do is just the boring stuff that we can't be bothered to do so we get someone else to talk about it. Every so often we impart an opinion as to what direction we'd like to take and let the government deal with it from there.

We have a representative democracy, because it's simply not convenient for us to all sit in one room and try and flesh out the issues of the time. We couldn't get by without one. Now the debate about what sort of government we should have, what their scope should be, how we should select them. All of that is up for debate. But the concept? It happened because it worked. Anarchy would at the very best settle back into representative democracy. At worst? Have you seen Mad Max?

Thursday, 25 April 2013

Programming a copyrighted dice game 1

My most recent missive was about the torment of learning, or at least of not learning when attempting to. It was borne entirely of frustration because I'm trying to learn quite a few things at the minute, and getting stuck on any of them feels like time wasted.

One of the things I'm trying to learn at the moment is c++. It's not the easiest thing to stick at when it's going badly, but is so rewarding (as if I'm honest, is any form of programming) when it's going well. I am quite a sharer though, in that I like to talk about what I'm up to, but with this I find that I only get 5 or 6 words into what I'm trying to say before a glassy look appears in the eyes of whoever I'm talking to.  As a result I thought I'd share it here.

Firstly I haven't started from scratch; I've made some rudimentary flash games before and as a result knew all about the basic programming concepts. So having learnt the syntax specific to c++ I decided to test my knowledge by trying to code a simple game. In this case Yahtzee.

The target is firstly to create a console version of the game. This means that the game will be entirely rendered in text and as a result absolutely dreadful to look at. It will however have all of the functionality of the real game, enabling the user to 'throw' 5 dice, hold those that they would like to keep for the following throw, throw any unheld dice, repeat and then score appropriately. If that goes well, I can then look to install a graphics library and make something that looks a little less 1980's.

So far it's going OK, I've had a lot of success this evening writing some functions to test the users input and throw the dice. I haven't though really made any sort of game out of it, and I'm frankly dreading the scoring bit.

I'm a little bit unsure if I want to keep this as a progress log, or if I should also throw in a tutorial as I go. For now I'll just talk through the class that represents the in game dice, and if (laughs to self) there's any demand I'll add more code snippets through my write-ups.

1 class dice{                                  //represents the dice of the game
2     bool held;                               //is the player holding this die?
3     int pips;                                  //what is the score on this die?
4 public:
5     void throwd(){                                             //Throws the dice object
6         pips = rand() % 6 + 1;
7     }
8     int getPips(){return pips;}
9     bool getHeld(){return held;}
10    void setHeld(bool dec){held = dec;}             //Tells this die if it is going to be thrown
11 };                                                                     //again

So on a line by line basis:
Line 1 - Tells us that we are creating a new reusable object (class) called 'dice' and that everything between the '{' on this line and the '};' on line 11 is the definition for the object.
Line 2 - Creates a new variable called 'held'. Every instance of this class that we create will have its own copy of this variable. The 'bool' tells us that the variable is of type 'Boolean', that is it can only have one of two values; true and false.
Line 3 - Creates a new variable called 'pips' which is of the integer type, that is it can only hold whole numbers.
Line 4 - It's a little awkward to describe the 'public' keyword to an audience that may not know programming. In short it says: 'let other objects see everything from here onwards'.
Line 5 - This is a function (or method) definition (as are lines 8, 9 and 10). It defines something that can be done to any instance of the dice class we create. The void means that we should not substitute the function call for anything when we use it later in the program. The function ends with the '}' on line 7.
Line 6 - This is the body of the function defined in line 5. It sets the variable 'pips' to a random number between 1 and 6. Remember this is a reusable class, so 'calling' this function will only effect the 'pips' variable  in the instance the call took place. This will make more sense when seeing the call on a later date.

Line 8 - The classic 'getter' function. We can use this later to see what the value of 'pips' is for an instance of this class. The reason we need a function is because the variable 'pips' is defined before the 'public' keyword.  The 'int' means that when we put this in the code later on, we can treat it as an integer.
Line 9 - Very similar to line 8, except we are expecting a Boolean value back this time.
Line 10 - This is the inverse to a 'getter' in that we are using it to set the variable 'held' from outside the class. Notice that the brackets aren't empty this time, but have 'bool dec' inside. This means that when we write the function in the code later, we have to include either true or false inside the brackets. This tells the class what to set 'held' to.

Seems that language tutorials (even very basic ones like that) take a lot longer to write than I thought! I shall at the very least keep this going as a progress log, and maybe post little code snippets up every now and again. If you have any questions please let me know.

Thanks for reading.

Monday, 1 April 2013

The plateau

I love learning. Always have. Not just the facts and figures bit or the book smarts, but skills, physical abilities, so many things that it's possible to do I like to try. See if I'm good at them. If I'm not I try and get good, if I am I try and get better.

I'm a bit like a magpie though. A new idea crosses my mind and it's like a shiny trinket to be chased to the detriment of whatever I'm currently improving at.

I can accept this. When I'm into something for a while I normally come back to it. What really bugs me though is what I call a plateau. This is when despite all my best efforts an improvement seems elusive. Like trying desperately to stakeboard up a steep slope, all the effort seems to be for nothing.

It may be no more than an illusion, and I've no idea why I'm committing it here, it just bugged me today and I hope expressing it will rationalise it a little. I probably expect results too quickly, but here is the magpie issue. If I get bored I worry I'll drop what I'm doing, but I don't want to. How do people keep the motivation going when success seems a distant dot on the horizon?