How I replaced animation with shader and ̶s̶a̶v̶e̶d̶ optimized the world

So one fine day our designer decided that the trees in Summer Catchers are boring. And he was actually right because they were totally static.
After full day of work he presented a brand new version of tree crowns which were steadily swaying in the light wind. A real breath of fresh air in the visual aesthetics of the game.

But then I checked how this was achieved. My breath was taken away.

Read more

Share Comments

Paper Folding

In april 2020 I created this demo / proof of concept of a game whose mechanics is based on folding of the sheet of paper. Each side of the paper represents completely different environments. By folding the paper those environments could be combined as a result letting the main character reach the goal (this part is not implemented in this demo).

Read more

Share Comments

How I broke Incremental GC in Unity

Once upon a time, before releasing Summer Catchers on Steam, I was trying to make our game as smooth as possible. Since we are using object pooling our game almost does not have memory allocations after a new scene is loaded and thus it does not require to use GC.

Share Comments

How I made logos crisper, while also minimizing a memory footprint and a build size

Minimizing the build size of your game is always a plus: it saves your disk space, it saves your time to upload and your players’ time to download, besides some app stores and shops impose size limits. So that’s one of the things which I was doing while porting our game to Nintendo Switch (it’s worth nothing that this optimization and improvement is applicable to other platforms as well).

Read more

Share Comments

Login Buddy

So here is a small experiment in Unity3d inspired by amazing job Animated SVG Avatar by Darin Senneff.
I wanted to make it as fast as possible, ideally spending 3-4 evenings (maximum a week). But unfortunately due to various reasons (damn real life) I spent almost.. ta-dam.. 3 months, with the longest pause for about 2 months. Anyway, it’s done and now you can use it as you wish (links and demo inside).


Read more

Share Comments

Simple GPU Occlusion for Lens Flares

One of the interesting problems I had to solve during development of Summer Catchers was implementation of Lens Flares effect. In this post I’d like to share what I came up with (including an open-source demo). Buckle up.

Read more

Share Comments

GrabPass + Dynamic Batching == Friendship 🤜🤛

Update: the original trick was not working with Unity prior to 2017.2
But it appeared that the fix is quite simple and now it works fine with the latest versions (tested with 2019.2). Source code is inside.


GrabPass is probably the easiest way to get the content of the screen and pass it to the shader automagically. Later you can use this texture to make some nifty effects like distortion and reflection.

But GrabPass has a huge fault: it breaks the dynamic batching 💔

Read more

Share Comments

Why I don't like Dictionary.TryGetValue and how I made it better (I hope)

The most annoying thing of Dictionary.TryGetValue is that it returns a default value of value parameter if key is not found. E.g. if value is of float type it will be 0.0f.
Because of that you have to check the returned bool and if it’s false you have to assign the value you need. It looks as follows

int count;
if(!arrowCount.TryGetValue(biome, out count))
{
count = kDefaultCount;
}
view raw Dislike.cs hosted with ❤ by GitHub

As you can see now we have to deal with redundant if statement which makes code not so clean and neat as it could be.
How about this one?

int count = kDefaultCount;
arrowCount.TryGetValue(biome, ref count);
view raw Like.cs hosted with ❤ by GitHub

Fortunately it’s quite easy to make it real with an extension class like as follows

using System.Collections.Generic;
namespace Utilities
{
public static class DictionaryUtility
{
public static void TryGetValue<K, V>(this Dictionary<K, V> dictionary, K key, ref V value)
{
V proxyValue;
if (dictionary.TryGetValue(key, out proxyValue))
{
value = proxyValue;
}
}
}
}

Share Comments

StableEnum or: How I Learned to Stop Worrying and Love the Enums in Unity3d

It’s a well-known problem with serialization of enums in Unity3d:

  1. Use enum as a serialized field in your MonoBehaviour or ScriptableObject (or anything serializable).
  2. Fine-tune everything and code your game further casually.
  3. Add some new enumerators in the middle of your enum.
  4. BAM!! You are screwed.

What happened? Nothing fancy: new enumerators of your enum just shifted down the old ones occupying their values, because Unity serializes enums as ints.
Solution is easy: serialize enums as strings. And StableEnum will help you with this.

Share Comments

Nested canvas bug

Weird bug related to UI.Canvas was accidentally found by me while I was developing new menu for our upcoming game SummerCatchers. Btw, follow us ;)
As far as you may know Canvas can have other Canvases as children objects. This is very useful in optimization purpose because sub-canvas isolates its UI elements from other canvases (parent and siblings) thus modifying one of its children won’t cause rebuilding of batched mesh for other canvases.
The bug is as follows.

Read more

Share Comments