Unity and the art of game version numbers

Version numbers for me have one main purpose: identifying the version players are playing. If somebody is playing version and reporting a bug that was fixed in version, I can keep track of things.

I had zero previous knowledge on how to do version numbers automatic in Unity, so I did the following: I created a game object where I can type version (such as “0.2.3”) and then this tiny lil piece of code adds something like “.231″ in the end. This gives me a nice little unique build number so I can somewhat compare builds.

This system adds a build number after every time you click “play”. This means if you try playing your game in the editor 3 times, each gets a new build number.

Not perfect. Not ideal. Not even useful always, but at least bit better than just having a manual version number like 0.2.3 that one forgets to change when building new things.

Here’s the updated (thanks to Mr. Reto) piece of code. Use as you please, and if you know better ways, I’m totally listening.

Attach this piece of code to a gameobject inside your game, and it should work pretty ok.

// BuildHandler.cs

using UnityEngine;

public class BuildHandler: MonoBehaviour
public int buildcount;
public string versionMajorMinorFix;
public string VERSION;

public void OnGUI() {
GUI.Button(new Rect(20,Screen.height-40,200,30), "version: "+VERSION);

public void Awake() {
if (Application.isEditor & !Application.isPlaying) {
buildcount = buildcount + 1;
VERSION = versionMajorMinorFix + "." +buildcount.ToString();


Unity & lurking in the shadows

The key feature for my Under the Shade (LD48 jam entry) was to make player be under a shade. I used two strategies. There was areas called “shade”, which were meant to provide decent shade. Not optimal, but something that stops dehydration (a feature that never got in the game due time limits…). This type of shade could be found under the trees or near big rocks. Another type of shade that I called “good shade” in the game. The “good shade” would be possible if there’s “something on top of a character”.

First I had trouble figuring out how to determine “if I’m under the shade”, but then I figured out a very simple solution: I clicked “create sphere”, and made the “collider” to be a “trigger”. Then I placed the shadearea to the place where I wanted to be. Here for example, I placed the area where the shadows are:

After that I placed a script called shadearea.cs to each shade area game object. For my purposes, I didn’t want this object to do anything except to inform when something enters or exits. So I basically wrote this (with the silly IF-statement, that should be got rid by for example ensuring that “player” is the only gameobject that can collide with the trigger).

public class ShadeArea : MonoBehaviour {

	void OnTriggerEnter(Collider other) {
		if (other.gameObject.tag == "Player") {
	void OnTriggerExit(Collider other) {
		if (other.gameObject.tag == "Player") {

After this, I could do something with the information (like make it so that player’s hydration value would be changed).

Naturally this approach was done for a jam entry, and there’s some obvious issues:
– If the position of the sun changes, the shade area should move. This could be done by checking out the central point (when the sun is highest) and then rotation/moving the shade area. Or we could just ignore this. Or we could do something else.
– Collision could inform “gameplayManager” or something like that, instead of the player. And the gameplayManager then could tell other objects that “player is in shadows” or not. This would be needed if there were other people in the game.
– I placed the shade area manually. Since I had only 2 of them in the game, I could handle. But if I was to create a random scenery or have 100 locations, I would definitely need to make the shadearea part of the gameobject.

And probably other issues too.

Since I didn’t have the time to make use of the feature (I dropped away ‘hydration’ feature since I had no time to test it), so the ‘shade near objects’ feature was dropped. But at least I learnt something when doing, and now perhaps this blog post helps somebody else in their projects.


18 hours later…

I finished my Ludum Dare entry “Under The Shade”. I once again had huge ambitions on what kind of game it would be. I drew an island, trees, rocks, thought about fishing places, fire system, cliffs, rescue signals… and realized that this would take 48 months or so to complete. (and not 48-72 hours as the contest requires).

So I did it anyway.

I know that ludum dare is a prototyping contest, where graphics should be… cubes and whatnot. Of course I didn’t want to have just grey cubes. I used some free assets in the asset store, and some assets I had lying around in my computer. To me it was important that the game also looks something else than cubes.

I did three things correctly:

I wrote a todo list
Since I had very limited time, I needed a clear plan on what to do. I made a brief list and moved things around. I divided my TODO into about 10 item lists, and wrote to each section “why” or “what’s this about”. Here’s a some of my todos…

It’s a huge motivational factor and keeps you focused on what I’m going to do.

TODO: you can start a game play it 

DONE - map: island (terrain, sea, some random trees)
DONE - map: collectable branches
DONE - terrain grass
DONE - item: matches on the beach
DONE - item: axe on the beach
DONE - make it possible to gather dead wood
DONE - possible to start a fire (needs small wood pieces)
DONE - place palm tress so that you can also collide
DONE - check what items there should be

TODO: Better torch & fire system
- get stick on fire by placing it to a campfire: if stick is "carried" and is "on fire", then we generate a fire to one end of the stick and it becomes a new fire. Fire won't spread otherwise, only when you carry it away from the campfire
- flame system: 3 size of fire, small, medium, big
- flame system: palm leaves make fire "smoky"

I playtested my game…
First I thought the game would be more about survival under the sun, but I had such a fun time trying to make a nice shelter that I eventually gave bit more attention on that. I had planned so that you could lose the game, but that didn’t feel right in the very last moments of the challenge… so I took it away.

Now the game is about building as good shelter as possible, and then doing a signal fire when you want to end the game.

I cut away majority of the features
I had planned the gameplay a bit, so that there would be more choices to be made. Alas, those features simply didn’t make their way to this minigame. There’s no beasts that hunt you. There’s no more hunger (although banana plant and a banana can be found on the isle). There’s no fishing. There’s no finding water. There’s just the shelter building so that you can get under the shade.

There really wasn’t any other option since I had no time to add those features.

I was persistent
Yesterday I was very tired and I slept 21-24 or so and woke up. I was thinking that “LD ends in 3-4 hours, I need sleep… I’m not going to release this”.

I got up and thought… “I can finalize this game in one hour, and it’ll be good”. I pushed myself to get to coding. After 2,5 hours I was done & uploaded the game. (And still got nice sleep between 3am and 7am)

I have mixed feelings about the entry. It does not have the “make meaningful choices” aspect in the scale I wanted there to be. There’s quite little “resource management”. It has bit of “exploration” and bit of “shelter building”.

And… there’s “fire making”. Sort of.

Over and out
The first 16 hours or so making this game was pure fun. I tweeted, I posted pictures, even put lil bit of Unity code out… so that alone made it worth participating.

The last 2 hours to submit the game to the contest was not bad either.

I didn’t collect all the achievements, but I think this was pretty ok gig for me.

Under the Shade is available at the ludum dare site (windows, mac, linux, web versions).


LD48 jamming: auto-screenshot taker

// script name: ScreenshotHandler.cs
// how to use: make a gameobject and attach this script into it
// now every time you launch your game, it takes 
// one screenshot after 5 secs have passed

using UnityEngine;
using System.Collections;

public class ScreenshotHandler : MonoBehaviour {

	private void capture() {
		Application.CaptureScreenshot("screenshots/screenshot_"+System.DateTime.Now.ToString("yyyy_MM_dd-hh_mm_ss") +".png");

	private bool _takeStartScreenshot;

	// Use this for initialization
	void Start () {
		_takeStartScreenshot = true;
	// Update is called once per frame
	void Update () {
		if (this._takeStartScreenshot == true && Time.time > 5.0F) {
			// take a screenshot after 5 secs have passed
			_takeStartScreenshot = false;
		if (Input.GetKeyDown(KeyCode.F12)) {

My gaming year 2013 in pictures

The main project

Year 2013 was me mainly about The Infected card game. A card game that I’ve been iterating for several years. I got a beta out (which is basically the feature-complete game, lacking better rulebook, better tutorials… and some card typo fixes) and aim to get the polished version out early this year (2014).

I must say that creating a simple, short-to-play, fun card game isn’t as easy as I anticipated. The time to ship physical products around the world takes time.


I got several playable prototypes out: Angry Troll Run (simple Android test), Thinglings (very simple card game, but actually pretty cool), Raftsmith (simple get out of the isle puzzle game).

Each of these prototypes had a different purpose: Angry Troll Run was about me seeing how difficult it is to develop for Android. Thinglings was “I want to make this really simple, really small card game on desktop” and for Raftsmith I wanted to see if I can draw fast & make a survival game. The game initially had much more plans… but at least I got the very, very, very compact & playable version out.

And yes, one game a month is cool. You too should join.


Some thing that got less attention was my 7 day FPS entry… which unfortunately I could not finish due problems with the FPS game creator. (yeh, I blame technology here, bear in mind that I wanted to spend days not weeks on these). I had a pretty cool story about a murder that happens in a hotel and that detective must figure out who did it… there was several characters and some “hey, why those planks on the roof look odd” type of figuring for the player. Too bad FPS creator simply could not meet all the tiny details I wanted. It was pretty cool thing to work on though.

I continued playing around with the detective ideas and drafted some plans for a a procedural detective/forensic game.

I thought about the gameplay but couldn’t get past “clue” type of hunting so eventually I thought this was too complex beast to tackle. I wish somebody goes and makes a complex, narrative procedural detective game one day, but all the plans I had are not technically so easy. Narrative AI must go some steps further.

More things

I also dived into the Unity camp and made some technical demos for just myself. My first bit grim entry is called Rest In Pieces, and it’s actually pretty neat and there’s some ideas for developing it further… so I just share a picture. This might turn into something more at some point. We’ll see.

I also made a very crude mobile prototyping tool for myself (since I couldn’t bother taking dice and figures to xmas trip). This tool was helping in designing simple gameplay mechanisms (or theoretically even simple games).

Unity is simply a really cool thing and I’m totally sold for it.

I tweeted “Give a man a game engine and he delivers a game. Teach a man to make a game engine and he never delivers anything.” (which sort of sums up my own experiences and thoughts when we look at the industry today) and it got 1000+ retweets pretty fast.

The Selene Project

(Please rate and comment here, thanks!)

And the year ended me participating in the Ludum Dare jam. In just 72 hours I created a pretty moody space game where player needs to answer some really serious questions. The game has many layers in which it tries to do and I’m actually very, very pleased how it turned out.

A short teaser is available on youtube:

The game web version can be played here: Selene (download links here)

I’ll write a more detailed “post mortem” and future plans regarding The Selene Project later.

That’s pretty much my gaming year 2013 in pictures (with a some piecesof commenting too…)

Over and out.


The Selene Project


Ludum Dare 72 hours jam entry. Made with Unity3d. Code, voice acting by me. GIMP for graphics and Audacity for audio. Sci-fi asset from the asset store & free unity assets.

Mankind is in the brink of extinction. Scientist have found an habitable planet that is located far, far away. Too far to reach by living humans. A spaceship carrying the dna of the last men and women has been sent on a mission to habit a new world. A ship is operated by an highly advanced artificially intelligent being.

A multi-choice game where your selections determine the fate of the mankind.

Ludum Dare 28 ratings

#34 Mood(Jam) 3.83

#155 Innovation(Jam) 3.22

#262 Overall(Jam)3.11

#399 Fun(Jam)2.51

Teaser video on Youtube

Play on Ludum Dare site