What’s the first thing to do in a survival situation?

For the recent LD48 (72 hour jam mini-game), I created a survival mini-game Under the Shade. In a survival situation, one of the important things to do is to get an overall picture of the situation (at least that’s what the buddies in tv seem to do).

That’s what I did in this game jam: I sketched a high picture view about “what possible elements there could be in the game”. It was brainstorming, so I knew 80% and more could be thrown away… but it helped me to get some idea about the theme. I thought about weather, day-night cycles, shelter building, water, food, mosquitoes and so on.

Eventually I drew this:

One very important thing for me was to type down “what is the objective of this game”? I wrote “build a signal fire when you see a ship” in the top of the page.

Then I thought about conflict, and somehow the theme perhaps got me thinking about “shade”. “Shelter building” was something I wanted to do… so here I had the 2-3 most important pieces I could start to deal with.

By observing the situation a bit, I could get overall picture and then draft a plan.

They tell this type of assessment making works in wilderness survival situations… and I guess the same can be applied to game jamming as well.

At least this time it seemed to help me out… and Under the Shade was born.

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 90012 and reporting a bug that was fixed in version 90311, 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 “.17339822″ in the end. This gives me a nice little unique build number so I can somewhat compare builds.

My script just adds a timestamp everytime I do a build, so this approach isn’t totally fool proof. It could happen that versions 0.2.3.17339822 and 0.2.3.17339941 are actually the same – I just happened to build one few minutes after the other. At least the timestamp tells something about the timegap.

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 piece of code. Use as you please, and if you know better ways, I’m totally listening.

// Debugger.cs 
// Create an empty gameobject and attach this script to the object 
using UnityEngine;
using System.Collections;
public class Debugger : MonoBehaviour {
  public string version;

  void Start () {
    // ahem, this *was* epochStart but then I changed it to 2014 instead of 1970 *whistling*
    System.DateTime epochStart = new System.DateTime(2014, 1, 1, 8, 0, 0, System.DateTimeKind.Utc);
    float timestamp = (float)((System.DateTime.UtcNow - epochStart).TotalSeconds);
    int buildtime = Mathf.FloorToInt(timestamp);
    this.version = this.version+"."+buildtime.ToString();
  }
	
  void OnGUI() { // just to display the version info when rendering... I like gui boxes
    GUI.Box(new Rect(0, 10, 200, 30), "version: "+this.version);
  }
}

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") {
			other.gameObject.SendMessage("enterShade");
		}
	}
	void OnTriggerExit(Collider other) {
		if (other.gameObject.tag == "Player") {
			other.gameObject.SendMessage("exitShade");
		}
	}
}

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
			this.capture();
			_takeStartScreenshot = false;
		}
		if (Input.GetKeyDown(KeyCode.F12)) {
			this.capture();
		}
	}
}

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.

Prototyping

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.

Ideas

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 Infected: 28 Cards Later first edition (beta) is now available

I’ve finally got my card game released: The Infected: 28 Cards Later (website). The game is feature complete and fully playable. There won’t be any major gameplay affecting changes. I will still be making some minor modifications to card texts (fixing grammar, perhaps doing simplifications) but … the game is out.

That’s worth repeating: After three years, my small game is out.

I will write a more extensive “lessons learned” post in the future, but meanwhile..

check it out.