And yet another website change!

Another blog post, another website update, right? 😛 I grew tired of fighting with WordPress in Google App Engine, but actually the main reason for this change is that the CloudSQL bills were quite hefty! Since WordPress needs the database for pretty much everything — even with extensive caching — the CloudSQL instance has to spin up almost every hour of the day. So it ended up running 24/7 and that costs more than I'd like for a simple site like this.

What I did was ditch WordPress and switch to an entirely static website. I lost some dynamic features like the search, and I didn't bother to implement categories for posts, but I gained speed and simplicity. 🙂 Also the RSS feed is currently not implemented, ping me if you need it and I can add something. Anyway, I wrote a custom tool that generates the site from a few templates, and App Engine just serves those static HTML files. The generation takes only about 2 seconds, which is nice. You might wonder why I use App Engine for 100% static content? Indeed the site could be served from a CDN (speaking of CDNs, I added one for the images on here, go me! 🙂), but I'll reserve the option to do some dynamic stuff later on, should a need arise. So let's see how this works — personally I'm very eager to see some savings on my hosting bills! 😉 I might do an update later if anyone is interested.

Oh wait, actually there's the new theme as well! You did notice it, didn't you? I wanted something simple and responsive, so I took Bootstrap and quickly whipped up something. It's quite basic but shall do, for now.


Website migrated to a new server!

Hello, world. If you see this, you are reading this from the new server, which is great. Notice anything new? Apart from the comments being powered by Disqus now, the font change (I grew tired of the previous serif fonts) and some minor tweaks, the site should function just like before, but only better. I have migrated everything from the old webhotel that would break down even under little traffic to the Google App Engine, so things should run smoothly even in case there is some heavy traffic going on. Assuming everything works correctly, that is. 🙂

Oh, do let me know in the comments if you notice anything broken that used to work before!


My thoughts on Unity

Long time no see, right? Just for fun, I wanted to write up some (initial) thoughts on the topic of Unity, the game engine. Not sure if I've mentioned it before, but I've been keeping an eye on Unity for years (since 3.x days I think), on the prospect that I might actually use it someday for my own games.

After spending way too long on making the general engine code for Jewels 2 (remember the engine consisted of 75% of all my code in J2, quite a bit of which I ended up not needing at all!) it occurred to me that maybe it's not the best use of my time if I actually want to make games. I have two kids, a day job and generally a lot less time to tinker with gamedev than I used to, so perhaps it should be spent not making engines, but games. And I don't even want to count how many times I've started building a game (engine first, of course) and actually ended up with an incomplete engine and no game!

With that in mind I decided finally to use Unity. Early this year I got back to my old day job of making learning games for children and conveniently enough we use Unity there too, so it was a great chance to actually use the thing. Before I had only tinkered with it, made a couple of very small prototypes.

Now that we've established why I wanted to use Unity, and I've actually used it for some time, I wanted to list (not necessarily in any particular order) some things I like and don't like about it. Nothing is perfect, after all. This is from an "old school" do-your-own-engines-in-C++ -perspective, so subjective stuff all around. Also goes without saying that I'm no Unity expert; I'm still learning to get into the proper Unity-mindset and finding an Unity-ish way of doing things, which often is vastly different from what I'd normally do as a coder. (Some of you may be wondering why Unity, instead of, say, Unreal Engine? Well I'll get to that in a bit.)

What I like about Unity

  • The Unity Editor: As a programmer I'm used to doing most of things through code, but after getting to grips with the editor centric workflow it is really good. It's very handy to place stuff in editor and especially to inspect things during gameplay, at runtime. The editor is also very extensible, powerful stuff.
  • Asset pipeline: It's great to have the ability to just drop a .blend or .psd in the assets folder and have it ready for in-engine use, (usually) without much trouble. You can also extend it with asset pre/postprocessors, very useful.
  • Prefabs: I think they're neat way to encapsulate and reuse things. They do have a fatal flaw… (see the other list below)
  • Component based: Component based programming is neat! I never got around trying that in my own stuff even though I always wanted to try.
  • C# scripting: After over 15 years of battling with C++; header files, fugly templates, const references, copy constructors and all that shit, C# feels like breath of fresh air. This is the main reason I didn't consider Unreal Engine that much; C++ feels cumbersome and counter-productive after spending some time with C#. Not to mention compile times, C# is much faster to compile. So in short: if I have the option of not using C++, I'll gladly take it.
  • Co-routines: Useful as hell; can't count how many times in the past I've had to add vars for various counters, polling when certain stuff should happen. In J2 I made an event scheduler that allowed rigging timed events, repeating or one-shot to happen, but co-routines make all that so simple I don't know what could possibly be better than them!
  • Cross platform: It isn't quite the "one click and your game is ported", but halfway in the general direction at least. iOS remains a painful platform to develop on even with Unity, since Apple doesn't allow JIT (Just In Time) compilation and code has to be compiled AOT (Ahead Of Time).. Do anything fancy and you'll find that it doesn't work on iOS without having to pull tricks like making dummy code reference all the types that would otherwise get missed during the AOT compilation.. But I digress, it's still whole lot better than spending all the time in Xcode.
  • Prototyping: Unity is excellent prototyping tool! I usually don't do much prototyping (does it show? 😄), but with Unity I have and it's been helpful testing stuff without "officially" starting a new game project.
  • Powerful animation: Mecanim is quite powerful if a bit convoluted, and can animate almost anything. I still do lots of tweens from code, but I'm using animation for more and more things.
  • And finally… (I've saved the best thing last) — not having to write everything myself! 😉

What I don't like about Unity

  • Outdated Mono: Mentioning this is something of a cliché, but yeah better GC and updated .NET would come in handy. Luckily once Unitys il2cpp-project matures these problems should finally go away.
  • No nested prefabs: Suffice to say, prefabs would be super awesome if they could be nested and then updated properly. Maybe one day…
  • Magic methods: MonoBehaviour magic methods (such as Update(), OnEnable(), OnDisable(), etc.) feel like they should be inherited or implemented with various interfaces. What I'd like is a new ScriptBehaviour that has the basic methods to override, and bunch of optional interfaces for special stuff (like physics handlers). Or maybe user code could subscribe to events like this.OnUpdate += MyUpdate.
  • iOS development == shit: Sorry, had to add this here again even though I mentioned it in the above list. It's pain in the ass due to the AOT problems, hopefully il2cpp helps with these!
  • Shuriken scripting: Shuriken is a nice particle engine, but I'd like a complete API to all its features from code.
  • 2D still lacking: The (relatively new) 2D tools are great, especially the fill-rate saving tight mesh generation for sprite atlases is helpful for mobile devices. However, there are still some omissions that I'd like to see: automated HD/SD support for atlases, dithering for 16-bit sprites (quite low hanging fruit IMHO and would improve visual quality a lot, especially for Android where 16-bit is the default "compression"), built-in support for premultiplied alpha (must for doing additive and alpha blending in same pass), a way to control the tight mesh quality, etc.
  • Pricing: I think the Unity Pro-price is ok, IF it would include all the mobile platforms. As a mobile dev, having to buy 3X the Pro-price it's a bit too much for my liking. And Pro-subscription does not make much sense: you don't get to keep the license after you've reached the normal Pro-license value. If that was not the case I'd have bought the subscription months ago. Of course even though I complain, I still need those Android Pro and iOS Pro licenses eventually, so I'll just have to bite the bullet and buy them.
  • No source access: This is usually not a problem, but when things don't work as expected, for me the best way to debug is to look what the library/engine code does and actually expects. It takes a lot of the guesswork out of debugging, but I realize having Unity open source would probably not be possible with the 3rd party stuff they're using. Luckily some of the sub systems will be open sourced, such as the new uGUI. Speaking of which..
  • The mythical uGUI: Now the long-awaited uGUI is finally here, albeit in beta form. It's mostly great — and thinking back on how much time I spent building the GUI components, menu layout and transition stuff for Jewels 2 — I'm just glad there is a proper GUI in Unity! Still, have to admit I was a bit disappointed, there were quite a lot of bugs and strange omissions (no drag threshold!?) considering how long it was in the making.. Nevertheless GUI is a complex beast + it's much better than having no GUI at all, and I'm sure it will only get better when the bugs are ironed out and the system is open sourced.
  • Terrain: Old, clunky and very slow to load on mobiles. Don't use it myself but at work we've been battling with it more than enough.
  • Easy to freeze the editor: Granted, this is an user error, but if you accidentally make an infinite loop in code, you're pretty much screwed if you had unsaved things in the editor. 😛 Before I would just kill the game, fix the code and that's it. Now there's potential to lose some of your Editor-made edits, if you forgot to save.

So there. My initial impressions of Unity. I'm sure I forgot some points I wanted to mention, but I will update this later if anything worth adding springs to mind. No doubt using Unity more will reveal new pain points, but I still believe that it is better to use an engine (be it Unity or Unreal or whatever) these days, IF your intention is to make games and not to tinker with lower level mechanisms. And for me, personally, seems that Unity is a great choice. 🙂

UPDATE on October 6th: added notes about co-routines, terrain and iOS development being shit.


Gameplay footage from Jewels 2

Just a quick update: I made a (too long) video with some gameplay footage demonstrating the different game types in Jewels 2. It is a not-so-great promotional video, and only about 6 months too late! 😉 Take a look nevertheless, if you haven't played the game and the static screenshots just won't cut it! 😄


The new addition to our family

Hi again, happy news this time! My wife and I had our second child on the 31st of July, a little sister to our now three years old Nella. 🙂 Naturally this means less time to work on games, at least initially. Nevertheless I'm hoping to set aside some time to work on Jewels 2 soon, and try to track down the nasty saved game problem some people are experiencing.

Anyway, to keep this one short: here are some pictures. Bye! 😄