Week #2 – Setting up Git with Unity
|
What is Git(hub)? I spent a lot of time this week on our game’s Version Control System (VCS). In short, the VCS keeps track of versions of files in the game, including scripts, animations, sprite sheets, scenes etc. In collaboration with my lead programmer, Oskar Karlsson, we set up a basic Github server and provided all group members with access so that they could upload what they were working on without using a more cumbersome tool like Google Drive or similar. With Github we managed to eliminate a lot of the manual work that went into distributing files and assets previously. On the client-side (In this case I talk about the user’s GUI for exploring and managing files in the VCS), we all use Github Desktop which is a locally run application. We use this to “push” changes to the Github server. All in all, this method worked well until we tried to merge two builds that had changes to the same Unity Scene file.
Conflict Management of an unexpected character Let’s rewind a bit. Normally I function as the game’s producer and my main focus is, besides sound, to make sure the team functions as a unit and work towards the same goal. This includes helping out to resolve interpersonal conflicts between team members; conflict management. Thus, I was a quite surprised to find myself in a situation where I now had to deal with conflict management between files. At the time when the merge conflict occcured, both programmers were hard at work on their respective tasks. This led me to roll up my sleve and dive head first into the, for me, quite confusing world of Unity merge resolution. The lead programmer, Oskar Karlsson, took some time off of his task to help out and attempted to resolve the merge conflict manually. With Oskar leading the charge on the actual resolution I started researching why this error occured in the first place. After some Unity forum reading, as well as a few visits to threads on StackOverflow and the Git forums, I could conclude that Unity does not like merging of scene and prefab files. At all. With this new information in hand, I set out to work proactively to avoid similar issues in the future and clarify our current work process. I have now set up multiple scenes in Unity, one each for the programmers, one “master” scene for our level designer, as well as a sandbox scene for the two artists to test their work in the game. Additionally, we configured a new merge engine to use with Github that is tailored to Unity, called UnityYAMLMerge. By combining this engine with an update to the so-called .gitignore-file (file that tells Git what kinds of files to ignore when merging) we now see a large decrease in the number of file conflicts, as well as in the number of files we need ot commit each time we “push” changes to Github. All that is left now is to spread the news and instruct all of my team members on this new work process which I aim to do tomorrow, Friday. I will do a short presentation of the changes and lay out the necessary ground rules and hope to anchor this knowledge in every single member of my team in a good way. Thank you for reading. |
