Blog

All posts


Beware Unity's project Colour Space setting

by Stephen - 5th January 2016
Last week I was experimenting with some custom shaders and noticed that when I output a hardcoded colour (from C# code or directly in the shader itself) it returns a different colour than expected. For example return float4(0.5f, 0.5f, 0.5f, 1.0f); gave me #BCBCBC instead of #808080 as expected. However, I also noticed that if I define a property (which becomes visible to the inspector) and return its value (untouched/unedited), it results in the correct colour.

Naturally this meant that the issue was somehow related to the fact that Unity was in some way processing the property value such that it is evaluated correctly...which also did not make sense to me since I did not think it needed any alternative evaluation.

After a couple of days of hair-pulling, a post to the Unity support forum pointed me in the right direction. It turns out that somehow my project was set to use linear space lighting instead of the (usual, expected) gamma space. So Unity was properly converting the inspector-selected colour to linear space whereas my hardcoded values were not! (0.5, 0.5, 0.5 is naturally valid in both linear and gamma, but translates to #BCBCBC in the former and #808080 in the latter).

So if you want to work in linear space, you need to convert your values. A quick, although quite inaccurate method (depending on the target platform) of doing this is to raise the RGB values to a power of 2.2

Otherwise do as I did and if you don't specifically need linear lighting (which in 3D environments can offer a more realistic effect), make sure your project is set to gamma space rendering via "Edit ->Project Settings -> Player -> Other Settings".



Note that linear lighting is not supported on all platforms.

More details can be found at http://docs.unity3d.com/Manual/LinearLighting.html.

Stephen

It's time for another Malta Unity User Group meetup!

by Stephen - 18th November 2015

It's time for another Malta Unity User Group meetup!

Date: Wednesday 9th December
Time: 7:00pm – 8:00pm (after the meeting we can stay and have a drink and a chat)
Venue: The Pub, Valletta

This year we'll be having a number of 10-15 minute microtalks. In no particular order:
  • More fun with shaders: What would Fallout 4 look like on the Game Boy? - Alan Duca (5¼Games)
  • Geometry Deformations: Model or Shader - Marvin Zammit (Mighty Box)
  • Developing a Unity3D Asset Store Plugin - Michael Camilleri
The event is free, but please help us out and RSVP on the Facebook event page so we can get a better idea of numbers and prepare accordingly.

The Malta Unity User Group is a local group for Unity users and developers to exchange ideas, share experiences and help each other create awesome games using Unity.

The group is open to everyone! You don't need to be a Unity expert to attend. Whether you are still a beginner or an experienced Unity user, come and join us.

Stephen

Introducing the Malta Unity User Group!

by Stephen - 13th November 2014

We are starting a local group for Unity users and developers to exchange ideas, share experiences and help each other create awesome games using Unity.

We are having our very first meet on Tuesday 2nd December at 6:30pm, and it is going to be a very special kick off event as we will be joined by Unity's own Andy Brammall, Alex McCredie and Andy Touch who will be telling us all about Unity 5!

We also have some great content lined up from local game studios Pixie Software, 5¼ Games and Codemasters for a jam packed evening of game development goodness!

We shall be meeting at the Microsoft Innovation Center Malta at SkyParks in Luqa. The fine folks over there are generously hosting us at their premises.

More details to come soon!

The group is open to everyone! You don't need to be a Unity expert to attend. Whether you are still a beginner or an experienced Unity user, come and join us.

The event is free, but please help us out and RSVP on Eventbrite or on the Facebook event page so we can get a better idea of numbers and prepare accordingly.

Schedule
18:30Introduction
Alex McCredie - Unity Technologies
18:40Unity 5
Andy Touch - Unity Technologies
19:20- Break -
19:35Unity 5
Andy Touch - Unity Technologies
20:15- Break -
20:30Making life easy through precompiler directives
Stephen Caruana - Pixie Software
20:45Unity through a technical developer's lens
Alan Duca - 5¼ Games
21:00Codemasters
21:15We'll head off for some drinks and a chat

Stephen

The importance of finishing games

by Stephen - 30th October 2014
I've recently stumbled upon a blog post by Derek Yu* where they stress the importance of finishing games you start. They provide the below 15 (paraphrased) tips to help you do this, which are discussed in some detail:

Finishing a Game - Derek Yu
  1. Choose an idea with potential
  2. Start the game
  3. Don't re-invent the wheel
  4. Prototype
  5. Design fun core mechanics
  6. Work with like-minded people
  7. Prepare for repetitive tasks
  8. Use real events as hard deadlines
  9. Don't get stuck on details: move on then circle back
  10. Take care of your health
  11. Don't start over
  12. Stick to the plan
  13. Do away with unnecessary fluff
  14. If you fail, try with something smaller
  15. Polishing takes time
All of these points have been brought up and discussed time and time again by many people, and I'm sure most of you have heard them in some form or another. Regardless, I still encourage you to read Derek's post. It's quite to the point and very well put. If anything it will serve as a refresher and strengthen your resolve to finish your games.


Finish him! (Derek Yu's sketch)

* If you don't know who Derek Yu is, they made Finishing a Game. If you don't know what Spelunky is, or haven't played it...I strongly recommend that you do.

Stephen

Re-establishing my online presence

by Stephen - 6th October 2014
So I finally got around to updating my website, which was way out of date. Well, it wasn't really out of date more than not fit for purpose anymore.

It was originally created a few years ago for me to have a simple online presence as a software engineer, way before I made the transition into game development and started Pixie Software. At this point I had absolutely no other significant online activity: I had no Twitter account, my Facebook usage was purely functional (monitoring my account just in case someone decided to contact me there rather than through more conventional methods), and I wasn't on any other social media platform.

As I started becoming more active in the game development scene, there was an inherent need to have a more active presence online. So I set up profiles and accounts for the studio and started communicating as the studio, but it soon became clear that this was not really working for me. It feels silly, and at times impossible, to communicate with and relate to other people when it's not even clear who is speaking: yourself or "the studio". I'm finding it very strained, limited and artificial.

So I've decided it's high time I update (or actually, set up) my personal online presence and make that completely distinct from Pixie Software. As a result of this:
  • I've now set up this website to act as a sort of blog for when I feel like voicing my thoughts on something or other.
  • I've revived my dormant, single-tweet-in-2009, Twitter account to house my Twitter activity instead of the studio's account. I'm starting from scratch and have absolutely no followers, so I'd appreciate a hand in that regard i.e. follow me ;)
  • I'm also going to start using my Facebook profile a bit more.
  • Naturally there's my LinkedIn account, but that's not really all that social.
My initial target is to shift my regular activity from the studio's accounts to my own. Following that, we'll see where things lead to...

Stephen