Unity, Git, and other meanderings

My Unity projects have been starting to become a bit large and in need of a good pruning / refactoring / reorganisation.  However, I am loath to do so with abandon, since I am afraid that I might break something irretrievably!  So, I’ve started to develop an interest in version control systems.  Indeed, with the release of Unity 4.2 I was interested in what could be done with the new version control system that is built to work well with it.

My initial best guess was that it would be Git – instead, it is a different animal, namely, Perforce.  Perforce, apparently, is supposed to be uniquely suited to dealing with teams working on very large (100s of MB, if not upwards of 1 or 2 GB) projects, offering the “best of Git” together with the “best of Subversion”.  Merging is apparently done on the server, rather than on individual machines (terminals?) of users – as opposed to Git, where the merges must be done locally.  Interestingly, it appears that it is possible to obtain fairly reasonably priced plans with the tech – in the cloud – for a reasonable amount of storage, too!

So I had a bit of a poke to see what the story was with implementing a setup of the thing.  Largely speaking, however, I found the profusion of products, terms, and other general goobledegook on the main perforce website a bit too confusing, and difficult to navigate to find, well, the main perforce VCS (maybe it is P4? not sure).   Indeed, even then, I’m still not convinced that it suits my purposes – since I am still working largely by myself with Unity, and therefore am just after a VCS where repositories can be locally managed.  This does not mean that using Perforce isn’t ultimately the best option for VCS with Unity – I’m sure that there may well be some logic to the whole thing – but I’m currently interested in a quick fix.

So, since I already understand Git – and have never version controlled a Unity project before, anyway – I decided to have a poke around the web for ways to get started directly using Git with Unity.  A post on the Unity forums led me to this series of posts, which is essentially more or less a comprehensive ‘how to’ of using these technologies together.

In other news, I’ve been starting to work on my first opensource collaboration.  This has been quite interesting.  I’ve been learning about Oauth for google and twitter, in terms of “logging in” to a service from a website.  Fascinating stuff!  Also some deep and interesting things about python, too.

While I was ferreting around on StackOverflow, moreover, and trying to understand the structure of the project in question, I came across another goldmine of useful information regarding things pythonic – a series of three posts written by a fairly knowledgeable chap.  They were:

There is also an extremely useful post / discussion about *args and **kwargs here.   The top two comments there clarified matters for me on these terms no end.

Regardless, I’m currently up to the stage with the project where I’ve managed to, sort of, get twitter authentication working.  The main roadblock I’m encountering now is a ‘pickle error’ (yes, another pythonesque thing I’ve never encountered before this point).  It turns out that in certain circumstances Python encodes objects (like functions or classes) as a bytestream (this is ‘pickling’), which is sent somewhere, and then decoded (this is called ‘unpickling’).  However certain things cannot be pickled.  For instance, if one function calls another function that is not instantiated within a base class object (as I have done), then that is a no-go.

So basically the plan to eliminate the pickle error is to consolidate a few functions, hopefully in a relatively sensible manner, into an authentication class.  That should be interesting.

Advertisements

Tags: , , , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: