Pages

Friday, 31 March 2017

Unity Custom Profiler

During my University third year, I was given the opportunity of creating a number of small research projects. During the third part of the year, I chose to create a custom profiler for the Unity engine.

The brief was that Unity's profiler is somewhat limited in what data it shows. It doesn't really give much in the way of helpful information such as the amount of memory an object is taking up. Thus, the task was to create a custom profiler which showed the memory usage of individual objects, including audio, meshes, textures, physics and scripts.

In many ways, I did just that, the profiler I created shows the memory usage of individual objects in a Unity scene. I had to use the old Unity Editor GUI functions to show this in an editor window utilising Unity's editor scripts. This meant I could create a window in the editor to run my profiler with, to incorporate it in any Unity project that I create.



The profiler shows the number of bytes of memory usage of each object in a hierarchy view not too dissimilar to the hierarchy view in Unity itself.

It is also shown in a bar graph and can also perform some limited analysis on objects in the scene to see if they are above a certain data threshold before reporting back with a warning message to the console to allow the user to track down problem objects.

The profiler does use some of Unity's internal functions, and one has to keep in mind that we just need to trust that they are doing the correct thing.



Unity also separates it's functionality in components, and as ingenious as this system is, it means that each Unity object doesn't contain much memory use. It just contains metadata. The components themselves are the things which take up the memory, and it is difficult to know if every component is being retrieved to create the total memory usage used. Unity uses, a lot of components after all.

Should you wish, please copy and paste the download link below. There you can download the project and inspect it yourself.

Unity version 5.3.2 required

https://drive.google.com/drive/folders/0B2-4-3Aj27LXM2g3R21mYkotdzQ?usp=sharing

Blog introduction


Hello there, and welcome to my portfolio blog. Please, allow me to introduce myself.

I am Sam Britnell, games designer, programmer, writer and gaming enthusiast. I am an aspiring English gentleman with many hobbies and interests. For this blog post, I will seek to tell you a little about myself and introduce my portfolio blog.

As you can well see, this blog is a dedicated portfolio to showcase work I have completed, and projects I have been a part of. Here you can find a complete record of personal projects, and professional work which I can be accredited to.

On the main blog page, you can find a list of links to pages on this blog which showcase the best of my work for your consideration. If I am applying for a job under you, or you are seeking to recruit me, I encourage you to browse these showcase projects at your leisure so you might get a better understanding of my abilities.

Should you be interested in just who I am as a person, I encourage you to read on.

So, who am I? Well, I like to think of myself as a well rounded person. People seem to like and get on with me. It has been said that I am quite a humble individual, not one to shout out about my successes or my failures. I'm quiet when in a crowd, but when I do speak people find it is often something quite poignant. It is 'one on one' or in a small group I feel most comfortable and it has been said I can be an engaging conversationalist despite my introverted tendencies. I can work well in teams, and often I can think outside the box and come up with a fresh perspective that most do not take. Above all, I am polite and respectful to everyone.

I write short stories and hope to finish a novel in my spare time someday. I also paint small miniature wargaming models. I code and design games in my spare time. I also have an interest in the paranormal, as well as military history.

I would hope this brief introduction gives you a better understanding of who I am as a person. Now. I wish you a good day, and thank you for reading.