Making Unity3D Applications That Don’t Drain Battery

If you’ve read this blog long enough, you already know: I use Unity3D a lot, and I love it. Not just for 3D games either! Making a graphic user-interface for a computer program is one of the last things a school ever teaches to Computer Science students, and in most languages, it isn’t easy. In comparison, Unity3D makes it practically instantaneous. Either with their built-in GUI objects, or by programming a custom library of clickable objects, Unity3D is by far the easiest way to make a program that requires any visual interface. Personally, I use it to make a variety of things, the most common I use being a customized text-editor to catalogue my library of DVD’s.

Yes, I used Unity3D to make a text editor. Stop laughing.

… but there are reasons why you shouldn’t use Unity3D for everything (I said stop laughing). For one thing, a compiled build of a Unity3D app has gotten bigger and bigger with each version, currently about 45 MB for an empty Windows game (I made a completed promotional demo recently, coming out to 46 MB… imagine if I had used a lower-level language, I might have been able to create a similar app for less than 1 MB!). Second, while simple Unity3D games can run on low-end GPU’s, it probably doesn’t fair well if you are using an older device without a GPU entirely. And third, and most importantly, is battery life: when using my simplistic text editor made in Unity, my Surface Pro device barely lasts 2 hours, when it can normally run for over 8 hours using other software (Microsoft Word, Adobe Photoshop, Google Chrome, etc.). Even the Unity3D editor doesn’t drain my battery as much as a compiled game does!

I only just recently found a solution to make Unity3D apps use less battery life. It isn’t perfect for all cases, but it works well for me.

Continue reading

“True King” Development – Strategy Board Game AI

While I’ve procrastinated on this for some time, I finally got around to implementing a game feature this month. A big part of my game “True King” will be a turn-based strategy mode, held on a map grid between two armies, like “Fire Emblem” or “Final Fantasy – Tactics.” Or, more generally, like Chess or Checkers. I had already made a prototype where the enemy character AI moved randomly (see that article here from… 18 months ago?!?). Now, the enemy AI knows where your players are, and knows to move towards you, to create the illusion of a somewhat tactical army.

How does one create artificial intelligence for this type of thing? It’s a basic concept, and I’ll talk about how I did it.

Trust me, you can’t hide from the AI.

Continue reading

“True King” Development – User Interface Implementations

It’s been quiet lately. This is the long “labour day” weekend, a chance to dedicate more time to my game. Also a chance to write a post on what I’ve done since the last time I wrote on this blog.

I remember saying on Twitter I intended to have a fully-playable demo by early August. That has already come and gone… but I have finished something important: the GUI.

Basic GUI during regular part of game.

Continue reading

“True King” Development – Fixing an Animation Bug and Understanding Unity3D’s “Update” System

Anyone who has played my last two games will have noticed a bug I never properly fixed, one that is unique to my animation system. The 3D camera can be moved freely, but doing so quickly will see the character’s frames not keeping up with it, resulting in a temporarily odd appearance. A month ago, I finally got around to finding the problem.

An example of what happens when the camera is moved too quickly in “True King”

Continue reading