Archives

Very Simple Solitaire – Launched

On the Apple App Store, on the Google Play store and On Facebook (desktop browsers, use Chrome or Edge).

Simulator Screen Shot 29 Apr 2017, 08.50.32

Well done, but.. How did it come about? There’s a billion of them!

Like most days, we sat on the sofa, watching TV and fiddling with our phones. The o/h is addicted to two games at the moment, Genies & Gems and Solitaire. Unfortunately she’s never been interested in my game TapPhrase, nor the epic space adventure I slaved over, nor even the Dachshund game I’m making. I’ve always wanted to make a game she would play, but never managed to hit the mark. Then I hear her grumbling about adverts interrupting her solitaire game.

BINGO.

Now, at this point, sane people find the highest rated app that has either a ‘no adverts’ purchase option, or a paid app without adverts. But after further discussion her criteria was:

  • No adverts, ever.
  • Free.
  • No silly animations.
  • No clutter on screen.
  • No score visible and no time visible.
  • Absolutely no sound, ever.
  • Absolutely no Facebook or social gifting or achievements/game centre.
  • No in app purchases.
  • Just VERY SIMPLE.

The next day, as she left for work, I grabbed Unity, downloaded a pack of cards from the Asset Store for a few dollars, and set to work. By the time she’d come home, I’d already built the first version and put it on our Nexus 7 tablet.

She immediately found bugs, which I fixed and iterated.

The first version just used flat icons for buttons, didn’t even keep score. It didn’t even know when the game was finished. There were silly bugs but it was playable. And she started to play it in preference to the one she’d downloaded.

What did you do next?

I soon realised that when I fixed a bug, another got introduced. The game logic was all over the place (what do you expect from a day?). So, it was time for the really dull bit. Automated tests. And introduce a new test every time a bug is found that I hadn’t covered.

This is something I do day in, day out, so I wasn’t unfamiliar with what I needed to do. And I was also depressed with the volume of work ahead of me.

I started to write out names of functions for my tests, and these described the expected behaviour I wanted my game to exhibit. I then started to look into how you can do automated tests in Unity, and how I could rearchitect using inversion of control principles and dependency injection, whilst fitting into Unity’s MonoBehaviour classes. With Unity, nothing is ever straight forward, so this was initially harder than normal (struggling with .Net 2.0, C#3 or 4). There’s also the problem that Unity relies on the update loop and processing for coroutines, so I had to fake that too!

Anyway, in short, that took me a good month or so of evenings and weekends to re-architect with interfaces, my own minimal IoC class, time service, swappable shuffling services (so I could fake near-wins), input interfaces, so I could pretend I was dragging cards from code – you name it – it’s mockable. In all there’s 86 tests, and there’ll probably be a few more yet as I haven’t tested everything!

What about those flat icons?

I can’t draw. So I looked around at tutorials on how to draw buttons, and I managed to combine flat icons and a glass effect bubble button using Inkscape.

Here’s some iterations:Screen Shot 2017-04-25 at 20.21.28

So what you going to do next with it?

Well, my mind was buzzing, I wanted to add a disco mode with unicorns, rainbows and laser beams. Turn 3 variants, multiple card covers, background changes, funky music, achievements, social timed battles.

Then I remembered – KEEP IT SIMPLE. VERY SIMPLE.

So at the moment – there’s no planned improvements. Unless people follow the Facebook page and tell me they want them, even then, if it interrupts pure play – it’s not in.

I’d rather create a new game and charge 99p for the all-singing all-dancing unicorn laser disco super happy fun fun version.

How do you make any money?

I don’t.

I’ve learned from TapPhrase, that if you set out with money in mind, you’ll pour hours and hours into the game, you’ll worry about capitalising on it, you’ll fret about the minor things and try to include every thing you can to make the customer happy, or to meet their expectations. And then the realisation hits you.

ITS HARD TO GET NOTICED.

Paid advertising, tweeting, Facebook sharing, asking for reviews, avoiding getting banned from reddit – It’s not easy. It’s demoralising, embarrassing and unappreciated. No one appreciates the effort you’re putting in. It can be quite soul destroying. All those hours, all that money, was it worth it? I had a 72 hour marketing plan for TapPhrase, and it just didn’t take off.  So I stopped doing it for the money – and did it for the hell of it –  It makes it less painful to walk away!

So are you really doing it for free? Why not just give it to the o/h and ignore everyone else?

Well – I figured other people might like what she likes.

Nothing makes me happier than to hear someone is playing my game, or has enjoyed it.

Really? There’s no ulterior motive?

Ok, there’s a tiny, microscopic chance that other people will love Very Simple Solitaire, and maybe follow me on twitter/facebook. Then, out of that tiny pool of people I might amass some kind of following. Then, when I release my next game, I might just have a few thousand helpers who might just do me a solid and like/share the game to get me started.

BUT, I won’t advertise in Very Simple Solitaire. Nothing will break my integrity on the original promise.

Back to reality, – I’ll just take the satisfaction and notch up another released game on the app store!

Do you plan on bringing it to Android? Windows? Mac? PC?

Yes. But that takes time – just to fill in the details and provide the appropriate screenshots and legal documentation – YOU WOULDN’T BELIEVE IT.

I tried searching for it on Facebook – why isn’t it there?

It takes time for games to be listed, upto 4 weeks – and I’ve not (at the time of writing) submitted it to the App Centre. Mainly because I have to draw about 5 different icons for it! Even then, they don’t approve any old rubbish!

Cheesy Potato Bake Surprise

A fantastic vegetarian friendly dish. Sorry there’s no picture – we ate it all! This is a variation of this  Creamy Cheese & Potato Bake.

Time: 1hr 50.  Preparation 40m, Cooking time  1hr 10m. 200C.

(Serves 6)

Ingredients

1.5kg (once peeled) of Maris Piper or King Edward potatoes

2 Punnets/300g of mixed woodland or oriental mushrooms.

100g of spinach leaves (or a big handful)

75g of gruyere Cheese – grated.

Salt

Pepper

Two cloves of Garlic, or one large (crushed)

Two knobs of butter, and some for greasing.

1 red onion, finely sliced or diced.

100ml White Wine (yes – you can drink the rest).

300ml Milk

400ml Double cream

50g Cheddar – optional cheese monster edition.

Tools (don’t eat them)

A large oven proof dish – approx 30cm x 20cm x 5cm deep

Kitchen foil

 

Method

Potato Prep

First, peel the potatoes. This made me grumpy, so play some happy music. Put them  them in a large pan of cold, salted water and bring to the boil, boiling for no more than 5 minutes. We’re just getting them softer. Drain and leave to cool down enough so you can manhandle them. Grease the dish with butter.

Mushroom Prep

While the potatoes are cooling, chop the mushrooms up into slices and crush the garlic. Add some butter to a frying pan and sauté the mushrooms and garlic till reduced and ready to eat. Don’t do it, they are tempting little buggers.  Drain the excess oil off and place the mushrooms in a bowl and save for later.

Cheese Prep

Those potatoes are probably still hot – so grate your cheese, keep the two types of cheese separate to confirm your OCD.

Spinach Prep

Chop up the spinach and put aside.

Potato hell

Now, with a nice large kitchen knife slice the potatoes to approx 5mm thickness. They should be nice and easy after being softened. This takes forever and is sticky work. Drinking wine helps, until you cut yourself. Layer the slices in the dish, until you’ve laid out half the potatoes.

Now lay out the mushrooms & spinach on top. Add half of the Gruyere cheese and half of the Cheddar if going full monster. Slice the rest of the potatoes, but do not place them in the dish yet. Move onto the sauce when they’re all sliced.

Sauce

Add a knob of butter to a large pan and fry the onions until golden and soft. Then add the milk, cream, wine, a few good grinds of salt and pepper. Did I mention you can drink the rest of the wine? Gently heat the sauce until about to boil, then pour half the mixture evenly over the bottom layer of potatoes/mushrooms/spinach. Add the rest of the potatoes then add the remaining sauce evenly over the top layer. Add the remaining cheeses evenly.

Cooking

Cover the dish in foil (shiny side up!), and cook at 200C for 30m.

Uncover the dish and cook for approximately 40m, until the dish looks amazing – with crispy cheese on show. The ultimate test is that you can push a fork into the dish and hit the bottom without much force, but not so little that the potatoes have turned to mash. Serve with something other than carbs or gravy.

Tip: If you can’t live without meat, remove the salt content and add chopped bacon in the middle layer.

 

What’s the surprise?

Either the mushroom layer, or the fact you still like potatoes after slicing hell!

 

 

 

 

Coding meetups around York (UK)

Here’s a list of development, hacking or process related interest groups who meet up around York (that I’m aware of). You may see the same faces at some of these groups, York is small! 😉

Agile Yorkshire (Leeds)

Agile Yorkshire meets on the second Tuesday of each month. Sometimes features coding / tech intros, but mostly focused on Agile processes and sharing experiences.

Twitter: @agileyorkshire

 

Code & Coffee (Leeds and York)

A spin-off from Agile Yorkshire, Code & Coffee is an early morning wake up call in Leeds and York. For those who don’t like a lie-in! Meets every Wednesday early doors.

 

York Geek Club

The York Geek Club Meets on the first Thursday of each month at The Habit on Goodramgate, 8pm.

Twitter: @yorkGeekClub

 

York Code Dojo

The York Code Dojo meets up every month, focusing on pairing up on different topics.

Twitter: @yorkCodeDojo

 

York Hackspace

York Hackspace meets Wednesday evenings, every week, to hack something, hopefully not someone ;-).

Twitter: @YorkHackSpace

 

York Game Developers

The York Game Developers group meets up in a beer slipper on the second Thursday of every month.

 

Any more?

My Unity/Blender Notes – Working with animations

This isn’t a well-crafted blog post. Not this time – it’s just a dumping ground for workflow/findings when trying to use Blender->Unity for animations.

 

Adding armatures and bones for unity

Select the object

Press Shift A

Add the armature with a single bone

p1

Name the armature (good practice)

And make sure you rename the bone too – you will regret it if you don’t when all you see is Bone Bone Bone in your animation editors.

 

Select the object only, then shift select the armature (make sure you can see it)

p5

Now we are going to parent the bone to the object.

p6

TIP: Before doing this,  if you extended the top face of this cube many times, you could create many bones from this single bone that are all connected (go to edit mode, click the top circle, and press E for extrude on the bone), then the above step will AUTOMATICALLY connect all your faces to the bones – Instant win. Press enter to confirm its position. If snapping is on you can press ctrl to disable it temporarily while moving.

This option adds a vertex group to the object AND assigns the bone to the group – saving you from having to do it. If you want more control over vertices you have to this yourself. Your bone name must match the name of the vertex group.

To see this association, select the cube, and enter Edit mode, then highlight Cube Bone as below, and deselect/select the vertices associated with the vertex group.

p7

You’ll also notice that this action has added a deform with armature modifier to the cube

Now select the armature

Enter the pose mode

p8

Press R to rotate and move the mouse – you’ll now see that the cube moves with the armature

If you want to see your armatures/bones click XRay

p9

 

 

You might want the new bone to control different vertices – simply create another vertex group with the same name as your new bone and assign the faces it should interfere with.

p10

Don’t forget to name the bone

p11

Now add the vertex groups for the cube

 

Using the select faces tool, select the faces that should be affected by that bone, and press Assign.

Select/deselect each vertex group to see if things are good. You may need to remove all vertices from the original vertex group if you’ve extruded faces from it, but here’s what you should be aiming for. The top should bend as you bend it.

 

However, the first bone we created doesn’t independently move the base – it moves the entire object because it’s the root bone. You can extract another bone beneath it to properly react to the independent movement. Here’s another CubeBoneBottom – and the main bone has no vertex group assignment.

You can then import the .blend into Unity.

Then drag the object into the scene and bring up the animation window.

Adding ‘properties’ adds the bits you want to animate (position, rotation, scale)

You can enter big values to simulate multiple rotation as well as negative values to rotate back.

You can also edit the curves to produce different interpolation.

Click the timeline to move the keyframe position.

If you lose the animation, drag the newly created controller into the ‘animator’ component.

You can also drag-select a box over the keyframes and move them to a new timing.

However, you can’t change the shape of the curves much – so if you want elastic effects you have to do this in blender using the NLA editor, action editor, curve editor and dope sheet.

That’s a whole world of pain!

 

P.s.  I know I haven’t mentioned Actions in blender yet, but be warned…

Sometimes you want a single 3d model to contain many moving parts of separate sub-jects, as part of one animation. That’s many armatures under one action – however, blender doesn’t like this one bit. So to do this save each action as a new file e.g. model@action.blend and tie the actions together in Unity.

If you only have one armature with many bones – you’ll be fine. (e.g. a character or single set of swinging doors.

 

 

 

I wrote a book on Open Source Software Licensing, but why?

One part of my role, over the last 15 years, has been to police the flurry of software components developers want to leverage. In response to that I developed internal systems, processes and gained experience of interpreting licence agreements. I’ve always been trying to keep on top of such things because I didn’t want to be distracted with any repercussions. I just want to get back to code.

During a recent customer deal, my experience expanded when one client insisted that as part of a software escrow deposit, any hint of open source contamination could trigger code exposure to the customer for investigative purposes. This swiftly followed by a highly elevated level of scrutiny over our codebase; leading us to outsource independent verification of our findings. We wanted to have confidence that we have taken all reasonable and diligent steps to protect ourselves and our assets. Being competent, confident and responsive to 3rd Party component usage information requests have also made further deals and engagements progress more smoothly for all involved.

Over the last year, I bought a number of books on Open Source Software Licensing to solidify my knowledge. It quickly dawned that not many provide pragmatic advice on how to start taking control of the problem, or how to manage it day-to-day. They are often filled with more information than (I) needed.

When I work, every minute is precious – I hate being inefficient or ineffective, and I’m sure others do too. So I decided to write a book that was going to get straight to the point – helping people like me who really just want to get back to coding as soon as possible.

I thought it was going to be easy – I was wrong.

At first I wanted to focus on the pure pragmatic advice, and forgo dull introductions, build up, terminology. But it soon became apparent that I needed to build some foundational knowledge in the reader before laying out my experiences. This started to pollute my vision but felt a necessary evil; and I suddenly understood why many books do this. Everyone needs to be on the same page (pun by design). I also wanted a quick-fire Q&A section, but realized that it would mainly be a copy & paste of the content in the book, as it was already fairly minimal.

I was writing during the evenings and most weekends, and I soon realized that writing on such a topic seemed hard going. Every time I wrote a sentence I doubted what I was saying was fact, and  believed it was just my crazy opinion; so I then had to research and find corroborating support from books or online articles. This obviously slows down the process while adding legitimacy, and protecting me from embarrassment. Further slowdowns were caused by writer’s block, or as I like to call it word blindness and imposter syndrome.

During the process I discovered many articles and useful web sites I just had to try and include in the book. Unfortunately that broke the planned structure. In the end I rewrote it about fifty five billion times – give or take one. Rewrites and reorganizations take time, and you also then get confused with what you’ve reviewed and if you’ve already talked about a topic. Rewrites also introduce more grammatical errors, something I’m already terrible at.

Eventually I just decided to stop worrying about it, dump all the content into the book; then go through linearly (many times, in both directions) to make sure I hadn’t stated the same thing twice (or at least not verbosely). Then streamline some more, making sure the pragmatic ethos is applied. After drawing some pretty diagrams and formatting headings, adding emphasis on the correct words and getting page breaks right, I felt ready to publish. The PDF was ready.

Little did I know that it would take another month to publish. But kind words from those I gave pre-release copies to really helped push me on. @MrRio and Laura Turner to mention a few.

If only I’d have googled ‘how to write for a Kindle device’, things would have been a lot smoother. No one set of formatting seemed to work well on iPhone/iPad/Fire reader.  After many nights of pain, I had to drop Apple Pages, and use Microsoft Word. All the beautiful formatting and indentations were lost, artwork had to be redone. The Amazon cover page creator is seriously rubbish too, I started to lose the will to live.

It almost got to the point that I was going to publish regardless of how scraggly it looked, and never read it again. After telling my friend Amelia, a professional copy editor, about my Kindle woes – she just constantly nodded; as if she’s heard it all before.

I’ve sworn not to write a book ever again, the process has been so traumatic. Not something I enjoyed, but I don’t regret doing it. After-all, It’s kinda cool to say I’m an internationally published author!

As for sales, I’m not going to retire anytime soon. At the time of writing I’ve had one purchase in Japan, one in North America and 70 normalized pages have been read through the Kindle Subscription services. I knew this was going to be a niche market; so no surprise there!

I do have some plans to neatening the book up a little; for a start the bibliography and references section needs help – I was largely at the mercy of Microsoft Word->ePub conversion, and I gave up the fight.

I could also do with adding recent events regarding the Oracle Java API case, and elaborate more on some of the popular licences in play and their associated risks/permissiveness.

I’m dreading the first reviews – it’s been a rough experience and reviews can be quite brutal. I just hope the audience appreciates I’ve tried to respect their time by keeping it minimal and pragmatic – Given Kindle pays per page read, I’m not surprised there’s some oversized books on the shelf!

Here’s the book in all it’s glory, it’s fun to see what it looks like in Japan’s store..

Amazon US

Amazon UK

Amazon JP

 

 

 

 

 

 

 

 

 

GameDev Diary – SpaceLife #7

It was all going so well.

I placed some pre-canned planets procedurally, as well as making planets farthest from the sun be gaseous. Then I decided to be a fool and turn on lighting. Producing some lovely results as you can see below:

 

Yay! That looks cool.

But then I discovered something quite awkward.

The sun is in a mini, scaled down solar system 30,000 units away. So that’s where the directional lighting is.

The ship and asteroids are NOT in the same place. So we’re actually getting the right shadows by luck rather than by judgement. If I warped behind the sun, we’d get the shadows on the wrong side because it’s all been faked. We will also find that shadows of planets will only fall on other planets and not on the ship or asteroids, because the light is coming from a different direction and length (we won’t get the correct cone of shadow).

I’m not 100% sure what to do about this. I need to prevent light bleed from both locations, yet represent the light in both locations.

If I create a fake light in my ‘local space’ and curtail the light effects of the mini solar system so they do not bleed into us, then we still won’t get shadows falling from planets.  That will manifest itself when we start to add space-stations. If a space-station is near a planet, and the sun is behind the planet, then the space station’s rear should be dark too. But because I’ll be faking a local light that’s not got a planet in the way – that won’t be the case.

So I either work out something clever, or I keep this simple-stupid.

Time to read up on lighting I think! http://www.edy.es/dev/docs/unity-5-lighting-cookbook/

Eureka-ish

Using a point light in the scaled-down universe allows me to get an area-of-effect light but curtail it’s distance. That’s the solar system lit up nicely! You can see here that a planet further away is bright as day but the back side of the planet near us is dark.

2016-06-04 13_53_03-Start.png

However, if I were to add some asteroids or change the camera to see the cockpit, it won’t be lit up yet. Time to add another spotlight that lives in our near universe – mimicking the position of the sun.

This is achieved by a spotlight 5000m away in the +ve Z axis, pointing at us. Here’s a picture of how it all pans out.

2016_06_04_14_21_44_Start.png

Now the trick will be to keep the sun in the correct place; remember – the floating origin trick? Well, if we do nothing, and keep our local sun as a root game object, it will work. But you’ll see the intensity of the light get higher and higher until our player reaches the threshold for the floating origin ‘push back’. Suddenly the lighting conditions will appear to flip to a darker scene. So we have to keep the local sun at the same distance away from us, and if it’s starting position is different (maybe in future, we’ll warp to a planet the other side of the sun) it will keep in the same elevation/position relative to the mini universe specifications.

What have we lost? Shadows from planets. But in reality, they player probably won’t even notice.

After adding some ambient light, our scene looks nice, like the first images of ‘fake success’.

2016-06-04 14_34_30-Unity Personal (64bit) - SkyboxTestScene.unity - SpaceLife - WebGL_ _DX11_.png

2016-06-04 14_38_50-Start.png

Next I think I need to tidy up the current code, start thinking about how to warp near planets to get to their space stations – if they have them. One day I’ll get rid of the lame warp-up/down etc. That’s just to play around with.

 

GameDev Diary – SpaceLife #6

Generate this!

It’s easy to get lost when you’re a solo developer. Now and again it’s a good idea come up for air and try and think about what your goal is, or even your critical path, and ask your self questions like “Is this a game I would play?”.

I’d like to say my goal was to make the best space game out there, but that’s not realistic. Whilst I was looking into procedural generation of solar systems and planets I came across an intersesting debate. There were voices declaring that procedural generation of 18 billion stars in NoMansSky didn’t sound like fun, that the variation between systems would develop patterns and not be engaging enough. The fear is that computer generated content can be boring by the virtue that it will inevitably have constraints on the parameters involved, creativity and purpoe will be limited. We humans are incredibly good at feeling repetition, even if we can’t immediately see it. What’s the point in travelling across a few thousand planets if you feel that they all are roughly the same. Maybe that’s the inevitability of the universe. It probably is like that, but even more boring. Let’s not forget how excited scientists are to sample some dust or have the mere hint of water on Mars.

Players often want some kind of journey full of delight and surprises, others are quite happy being a nomad and living away from civilization to build their own game in their heads – but surely enough real content needs to exist for this to be more than a fleeting engagement.

Of course, procedural generation takes a huge load off a development team; not having to create every minute scrap of content, so it’s perfect for a solo developer (as long as it’s kept simple). In my search for the balance of fun and procedural generation I came across this great blog post by  Kate Compton. I hope you appreciate the link – it took me an hour to re-find it from yesterday!

What am I making (the generator)?

  • A star system generator, which can layout space stations, jump gates, hidden treasures, asteroid belts, resources, planets, nebulas, you name it. Ok – maybe that’s too much right now – let’s focus on just planets and nebulas.

What’s good/important about my star systems?

  • If system is a solar system, it should contain a sun/star (solar gives it away?).
  • Planets should move around elliptical orbits  centred around the biggest mass. Those orbits do not have to be on the same plane, although most probably will.
  • There may be one or two nebulas in the system with size constraints.
  • Some planets have moons, which should also rotate.
  • The background skybox
  • The same solar system must exist and behave exactly as it did if we visit again (unless we add some catastrophic event).

What must not happen?

  • Planets must not be too close to each other
  • Objects must be limited in size.
  • Planets shouldn’t all be the same size or texture.
  • Moons should be smaller than the planets they circle, and must not collide.

Ok, that’s still a lot to think about – so the first mission is just to get the central star procedurally generated, and the skybox.

Universe coordinates

To start procedural generation, we need to have a deterministic algorithm based on a fixed set of values. We always want the same output for a specific input. This prevents us having to store lots of detail, configure scenes, test, you name it.

I imagine my starting star system is a box at coordinate 0,0,0.

Imagine there’s other boxes above (0,1,0), below (0,-1,0), left (-1,0,0), right (1,0,0), forward (0,0,1) and back (0,0,-1). This can be the key for all the detail we need in the universe. Of course, this doesn’t mean we can only move in 6 directions, there’s nothing stopping diagonal movement in the game. I may decide that some kind of routes are available through the universe, based on the availability of jump gates,  and that we do not expose all of these boxes to the user. But i’ll leave that alone for now – see how easy it is to get lost in your own thoughts.

If I wanted to make the player’s universe more sparse at the edges or center, I could use those x,y,z values to influence the cap on numbers of planets, or other features.

e.g. if x,y,z fall in the range of 5 to -5, we are in ‘high security space’, where bandits do not appear, and as we leave that zone the percecntage chance increases. If we have a huge universe, then we might have a more complex algorithm that used sine waves, or use simplex noise to produce interesting waves of security, which then inform what type of ships, alliances, predators are present.

But for now, I’ll just use those universe coordinates to populate some data that I’ll use as a starting point for my skybox and solar system.

Here’s the code to generate a deterministic set of numbers from vector coordinates. This gives us 20 bytes (values 0..255). We can isolate individual bit patterns for simple on/off decisions, or use the modulus operator to select an item out of the array. If we wanted to we could combine four bytes to make a large 32 bit integer.

ProceduralGeneration101

This algorithm only gives us 20 bytes, but what if we need more (we will). Simply add on some text to the base string and generate another hash. e.g.

planetData = baseData + “Planet”;

Then call ComputeHash() using planetData.

I think that’s enough blogging for now – I’m going to get my head down and bash out the nebula, orbits and planets and see what problems arise. Till next time.