Update to Map Creation

Putting basic blocks onto the map generated by the map creator turned out to be pretty simple. Essentially, all that is necessary is to instantiate a prefab at the location defined by the array (in coordinate multiples of 10 in my case due to the block sizes) and this is the result. The trees were a quick attempt at Blender (instantiated with a random rotation) but obviously need to be replaced with something nicer. Much like all the other blocks 🙂

FirstMapBuild

The roads are a little more complicated as placing them requires knowing what other road tiles are adjacent. Now I’m currently working on a basic player character and trying to get the level to loop at each end (like defender).

First Steps into Game Making

Procrastination is a hell of a thing. Although I’ve spent periods of the last year trying to learn Unity and C#, much more was spent on Reddit. A few weeks ago, however, I managed to kick myself out of that cycle and start work on my first game. The game in question is essentially a bit like Defender (of old arcade fame) but with inspirations from other sources – one in particular from the 80s on the wonderful C64 called Falcon Patrol.

To add a modern twist I’ll be using 3D graphics viewed from an orthographic perspective, and instead of pre-built levels I’ve opted for procedurally generated maps. This will hopefully keep the game fresh with each new play and help it feel more contemporary.

To begin I started with the map creation. I generated a basic layout in a two-dimensional array (water along the edge, sand inside, then grass and a seeded random amount of trees placed on the grass). After that I went back over the map adding towns, bases and roads (all using the seeded random). I had to ensure the roads linked at each end because, like the inspirations this game is based on, I want it to continually loop. To visualize what the level looked like I wrote the array to the console. As seen below:

MapVisualisation

  • 0 Ocean and towns if in the middle of the map
  • 1 Grass
  • 2 Trees
  • 3 Farm
  • 4 Road
  • Plus a few others

Next step will be to instantiate prefabs (basic blocks to start with) using the generated array and see how it all fits together.

Credit to Sebastian Lague with this youtube video for getting me started with the procedural generation. Cheers. J

Trip to Malaysia 2015

Wow… It’s been over a year since I last posted!

What the hell have I been doing? Continuing to learn Unity and C#, traveling a little and taking pics of various places. Other than that it’s hard to say… Anyway, below are some pics from a trip to Malaysia (specifically Kuala Lumpur and Malacca).

Learning Unity3D

For some time I’ve considered trying out games programming. Not that I think I’ll ever create much worthwhile but it seems like a fun challenge and a decent break from my usual web app stuff. One of the hardest decisions is the first; what language/environment to use? There is an astonishing number of options (far too many to remember or write about here) so I’ll simply say that I chose Unity3D in the end.  My reasoning:

  1. It’s free
  2. I like C# and Visual Studio – C++ was another option but as I stated earlier, I wanted a “fun challenge”. Plus the Unreal Engine is $20 per month (cheap for sure, but not free).
  3. Lots of tutorials and sites.

During the first tutorial (Project Roll-a-Ball) I stumbled upon a minor issue. The author was using GUI Text which is now seemingly considered as “Legacy”, and not selectable in the Unity Editor. Instead it is necessary to use UI Text. Easy, right? Nope. Being new to Unity it took me some time to find this alternative and work out that it is also necessary to make a few adjustments to the code shown in the video.

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour
{
    public float speed;
    private int count;
    public GUIText countText;
    public GUIText winText;

The code above needs to have the reference UnityEngine.UI added, then instead of creating our variables as GUIText they can simply be created as Text.

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class PlayerController : MonoBehaviour
{
    public float speed;
    private int count;
    public Text countText;
    public Text winText;

If I missed something let me know. J