Welcome

Hi, my name is Chris (aka @echception). I’m a hobbiest game developer, mainly using Unity3D. This website is a collection of the projects I’ve worked on, along with things I’ve learned along the way.

Unity - Hooking Into OnSave

Recently, for a project I was working on, I wanted a way to implement some custom logic that ran when I saved a scene in Unity. Some background, the project is using Unity’s new Tilemap feature for a top-down 2D map. However the data I want to store per tile is complicated enough that the built-in mechanisms Unity has for serialization don’t work well, so I’m storing the Tilemap information in a custom json file which is read a runtime to populate the Tilemap. [Read More]

Tilemaps In Unity 2017.2 Part 3

Previous posts: Part 1 Part 2 Full Implementation In the first post of this series we took a look at the new Tilemaps in Unity 2017.2 at a high level, without going into too much detail. In the second post we started building a minesweeper game using the new Tilemaps. We created a map to store the board state, then defined two custom Tiles, one for revealed squares and one for unrevealed squares. [Read More]

Creating a UI Element Directly on a Canvas

When you create one of the default UI objects from Unity, something slightly different happens from the other (non-UI) objects; the UI object will be automatically created under a Canvas. If a canvas doesn’t exist in the scene, a Canvas will first be created, then the UI object will be created under that new Canvas. The built-in UI objects will get automatically placed under a Canvas If you’ve used the Unity UI system before, you’ve probably noticed this, but maybe never given it much thought. [Read More]

Tilemaps In Unity 2017.2 - Part 2

Minesweeper

In the previous post we took a brief look at Tilemaps in Unity. In the next couple posts, we will go more in depth and build a complete sample game using Tilemaps. This will give us an opportunity to bo beyond just placing tiles via the Unity Editor, and explore the runtime APIs available for Tilemaps. The game we’ll be creating is Minesweeper. I assume most people are familiar with minesweeper, so I won’t spend time going over the rules. [Read More]

Tilemaps In Unity 2017.2 - Part 1

Introduction

Unity 2017.2 adds a new feature I’m very excited about, and have wished existed for a very long while: 2D Tilemaps. I like using Tilemaps in my games, I’m no artist and I find the barrier a lot lower to entry with using 2D art. And there are a large number of existing tilesets available for free online that finding simple placeholder tiles is very easy. I’ve experimented with several 3rd party extensions in the past, and when I couldn’t find one that did everything I wanted it to, I even wrote my own. [Read More]

Dynamically Selecting Sprite Size

Background As I was working on polishing up Glide, one of the goals I had was the game would look good no matter the device it was being played on. Due to the large variance in mobile displays on the market, this meant I wanted to support all resolutions, from 480x800 all the way up to 2560x1440 and beyond. Just extending how much the camera can see wasn’t a valid option for this game, I wanted the puzzles to take up a uniform amount of screen space across devices. [Read More]