My experience with Unity.

 

Hello there, It’s Hussam Samir Yousif speaking.

I’m one of the developers of p219, my responsibilities where mostly GUI and dungeon. I’m here to speak about my experience with Unity.

First of all, I worked with Unity on windows. There is a GNU/Linux build, but it’s experimental and still in it’s early days. I didn’t want to take the risk of programming with bugs so I went for the more mature windows port.

For git we used Source Tree. A graphical git client which has been a fantastic tool in helping us both understand git better and get to work. Though we still managed to get conflicts and some problems with git, at some point things clicked and source control became a very natural thing.

Here is what Source Tree looks like.

SourceTree

Now to Unity. I just want to put this out there, but the amount of documentation, tutorials, presentations, live sessions and other resources for understanding Unity better is outstanding. I really want to commend the Unity team for the fantastic work they’ve done in providing the developers all they need in order to learn Unity. The API is also very well documented.

On the other hand the text editor provided by Unity isn’t all that spectacular. I mean it’s functional, it even has a “vi mode” which you definitely shouldn’t use unless your understanding of vi/vim doesn’t exceed hjkl(basic navigation). It’s not awful, I mean it has auto complete and syntax highlighting, but that’s pretty much all of the features it has.

I tried using Visual Studio with Unity. Now that’s a fantastic IDE, but it was too much. The start up times of VS are slow and it’s a resource hog. At some point I tried vim. It’s light and it has the greatest control scheme known to man. However the lack of auto complete killed it for me. During my time with Unity I was very dependent on auto complete scrolling through it in order to find the functions I needed. So in the end I kept at it with the default text editor which isn’t particularly light or good but it’s functional.

Text Editor aside Unity is a really impressive piece of technology. The way you’d go about programming in Unity is through components. Think of it as using small lego bits to make something greater. You create small components and attach them to objects. For instance our main player has scripts and other components in order to define it’s behavior.

Working with this Component based programming was fairly difficult to get used to at the start. I didn’t know the components, I had no idea how to make them behave how I wanted. That was however, part of the learning experience. The more time You spent on Unity the more things felt natural and that hurdle was quickly overcome. Honestly I was a bit surprised the short time it took for me to get accustomed to Unity.

It didn’t take long before you started to manage to get things done, however a lot of what we did at the start was scratched as it was made in a poor manner. For instance the way I had programmed NPC dialog was clunky. I put every moving object under a parent object and everything under that parent object would be locked if the dialog object was in use.

The problem was that I deactivated the NPC object each time It wasn’t in use which sent a null object to every object using it. Another annoyance was that it locked everyone in place, yet the animations was not stopped so every character would be locked yet their animations was active.

I’m fully aware that it was a logic error on my part, however I didn’t know that deactivating an object changes the state of said object to null. That sort of knowledge, knowing the minor issues would have saved me such a long time and such a hassle. However I only had a semester to do this project and as such had to jump straight at production of the game rather than taking some time to learn more about Unity. At the same time I don’t think I’d learn things as fast as I did without having a project of this size and the pressure of the University. You usually work more efficiently when something in the back of your head keeps nagging you about progress.

Unity is a huge tool and throughout this semester from the start till the very end I kept learning things, and I will probably still keep learning things as I don’t think I’ll stop making games with Unity in my free time. Also working with Unity as frustrating as it may be at times, has a certain charm to it. I can not remember how many times I thought to myself “I’ll just fix this bug, it’ll take half an hour” and then ended up spending an entire day in front of the computer working with it. It really helped to that you see the results of your work quite quickly.

If you ask me “What would you do different with your current knowledge of Unity” I’d answer that I’d put much more emphasis in generalizing my components and the way I make things. The preferable way of programming in Unity is to make general components and then reuse them for different objects, making mass production that much easier. It’s much like the “don’t repeat yourself” rule in programming.  About Dungeon I’m quite satisfied with how it turned out.Though I’d like to do it in a different way. Perhaps a room based generator to the dungeon would be interesting.

I’m also quite satisfied with GUI as it works as intended and looks pretty good. Honestly it was quite difficult to find decent GUI assets, however we did end up with some decent ones. And the GUI works as intended. However I’d like to know more about the GUI components IO never got to try to use. I mostly used panels, images and buttons.

My conclusion after a semester with Unity is that it was a fun project. I enjoyed working with it. However like all other programming projects it had it’s fair share of frustrations, bugs, and attempts at tracing said bugs. This project taught me a lot about Unity, Git, C# (I never got to use it, but C# actually has lambda functions!), licenses and general teamwork in such a project.

 

 

 

Advertisements

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