15-02-2018
|
Hello reader(s)! Let me start by telling you a short story about a boy who decided to work on a programming project together with some of his friends. They opted to use the Unity engine and creation tool, along with its handy feature called simply ”Collaborations”. What he thought would be a nice and stress-free learning experience soon turned into a nightmare… Yea, I guess you already know where I’m heading with this, so I’ll cut to the chase: today’s blog post will be about the importance of researching the programs your working with. As me and the other one working with code in my group, my dear project manager, found out the hard way this week, Unity Collaboration is prone to some pretty unpractical behaviour. Overall these few weeks have been pretty good for me as a programmer. I’ve learnt a whole lot, always delivered on time and I’ve never really been stressed. This week was on track to be just as timely delivered as always. I just fixed the last bugs with the powerups (something for a later post, perhaps?) and I was dead set on implementing a nice UI just in time for the alpha presentation. Already my project manager had already started a bit and got an early prototype working. The goal was to display the player battery level in the bottom right corner so you could keep track of how much time you had left before your flashlight died. The problem was that the prototype was made with a GUI layer, a part of the Unity Legacy and no longer officially supported. In order to not run into any troubles down the road, I decided it would be best to implement the UI with the updated tools, using a Canvas object and a Text object. And I set to work, everything going fine. I ran into a small problem with not being able to get my players battery level into my GameManager and instead of wasting some valuable time on what surely was a simple mistake I headed down to the code tutoring about 15:20 on Wednesday. The solution was simple, I just needed to change my public GameObject player to a more specified public Player player. Easy. Compile and play. Spoilers: it still didn’t work. GameManager still didn’t get the right battery level. I spent a good hour testing it thoroughly to see that it wasn’t a dumb mistake I bothered the tutors with, in the meantime doing some much-needed cleanup of the project in general. After a while I checked my player.battery with Debug.Log() twice in the same file, Player. And to my big surprise, the console was giving me two different values for the same variable. I can’t say I’ve seen much in my programming days but this was still among the top weird ones. I raised my arm and asked for help from the tutors. We checked all sorts of stuff and nothing worked. In the end, one of them asked me: ”Are you using Unity Collaboration?”. I told him that yes I was and all I got as an answer was a long drawn out sigh. It turns out that the fellow who asked me had run into a similar problem in an earlier project when he was editing the same files with Collaboration. So I had to scrap what I’ve been working on and implement a (excuse my french) really shitty last minute UI with no updates what so ever just so we could pass Alpha. In the end, I’m being overly dramatic for comic effect. But I’ve spent a bit to much time on problems I didn’t cause and caused serious stress to both me and my team members. TL:DR: Read up on potential problems with Unity Collaboration now so you don’t have to do it later. |