Tag: Unity

Unity Debug Diaries

Unity Debug Diaries: Mip Map Memory Reduction

First off, I must apologize for the weird tense swapping that happens in these articles. I write stuff as it happens and do not want to do too much editing lest these become too tedious to write and then I just stop completely. So if you can deal, I will continue to write ūüôā

Today, I am attacking using Mip Maps on UI for multi-resolution rendering. Enabling Mip Maps and managing which of the maps are loaded into memory is the easiest way to handle texture memory on lower end devices. Now, I believed this but did not see the reduction in the profiler on device. So then I figured it was a fallacy because the data suggested otherwise. I then switched to TK2D to handle a lot of my multi sized sprites but the lack of clarity on the issue always bugged me. So now, I want to find out for sure. I cant get a straight answer out of anyone so its time to set up some tests.

First, I am going to make a separate project in iOS to have a clean environment and have nothing muddy my results. I am choosing iOS because its got its own set of profiling tools that will help me isolate if the Unity Profiler is telling porky pies (lies).
Results: Lies lies lies!¬†So profiling in iOS showed a radical drop in memory based on the appropriate¬†quality settings. I have four 2048×2048 at 32 bit. The results in the profiler are:

Full resolution: 107.66mb
Half resolution: 43.68mb
Quater resolution: 27.69mb

These results…




Unity Debug Diaries

Unity Debug Diaries: Radically long load time on Kindle Fire HD

One of the most useful things in day to day game development is to know about those weird gotchas that you find in any complex tech. On top of that, you need to remember said gotchas the next time you encounter them. When developing cross platform games at a fast pace, I have solved problems and completely forgotten the solve the next time I bump into it six months later. Debug Diaries is my first attempt at trying to curb this. When I am faced with a weird problem, I am going to try¬†to fix the problem while writing about it so that I can remember and hopefully, help you too. Here goes…

On doing the Amazon port of our soon to be released game, Thunder Jack’s Log Runner, I found that after adding the plugins to the port, the game too about 5 to 10 mins to load. I have seen this before when loading a lot of textures from resources but can be sure. The last thing I added before the problem was AdColony, which could have pushed me over the memory threshold. Time to pull it out and add some debug logs.

The first thing I did was to switch from my amazon branch to my google play branch to see if the problem was inherent or platform specific. For those who don’t know, most Android builds will work on Amazon devices because they are Android. You just have to watch out for the platform specific plugins.
Result: Same thing. So now, I am…




Kindle Fire HDX and Unity

Unity and the Kindle Fire HDX… a Christmas story!

As most of you know, I have been working on my wife’s game, Notespace, for the last year. It has been an epic adventure filled with joy and peril but treacherous¬†waters of publishing on Android.¬†You can avoid a lot of the problems by publishing multiple builds per texture compression but every now and then you get those sharp rocks that come out of no where. And that, for me,¬†was the mysterious crashing on Kindle Fire HDX devices.

Now before I move on, for those that don’t already know, Android¬†devices use an array of GPU’s where as iOS devices only use one (Power VR). This generally does not affect you in anyway except when it comes to texture compression that has alpha. Unity’s default Android compression setting is ETC 1/ RGBA16. What that means is that it will compress power of 2 textures with no alpha as ETC 1 (an older OpenGL format) and will set compressed textures with alpha to RGBA 16. On average, RGBA16 will be at least double the size as your compressed texture so it has the ability of sending your GPU memory usage over the edge. That being said, I have not actually seen that happen on a device but that kinda means nothing on Android with a gazillion devices on the market. Whats more important is that 16 bit textures can look really bad, especially if you have a lot of gradient work. So there is 2 ways around it. 1) Build a custom shader for your compressed images with alpha…




Unite 2014 Presentation: BUILDING A SOLID FOUNDATION

Video recording of my session

Presentation slides




CMR #13 Playnomics

Collective Mass Radio #13: Playnomics

As always, check out the rest of the blog as well as the other Collective Mass Radio podcasts on the site. Big thank you to Chethan, the CEO of Playnomics, for taking the time to chat and to his team for all the scheduling and internal chats. For more info on the company and the big man himself, check out this article on Venture Beat. Follow Playnomics at @Playnomics and check them out on the web at http://www.playnomics.com. If you are interested, apply for the closed beta of the new product. I have and what I have seen so far is great. The guys are really paying attention to the important details. Now, go build the best game ever!

 




Collective Mass Radio #10

As always, check out the rest of the blog as well as the other Collective Mass Radio podcasts on the site. You can follow Adam at @AdamTuliper and check out the great Microsoft offerings for Unity at http://unity3d.com/pages/windows/. Be sure to check out their events section for hands on Unity workshops near you.




Connecting the Unity Profiler to your iOS Device

While doing some contract work recently I found that the Unity Profiler no longer reports accurate texture memory figures for mobile while you are in editor. Maybe it never did but I swear it did an some point. Rest assured, all the texture compression settings are still fine, you just have to test on device now. I had never done this with the latest release of Unity and remembered the days where I wished I could. So I gave it a bash and it is dope! Here are the steps you follow:

Make sure your mobile device is on the wifi network. The profiler uses a network connection to send data back to Unity.
Make sure you have “Development Build” and “Auto Connect Profiler” check to on in the build settings (handy shortcut for the build menu, Command + Shift + B)

Build for XCode. Make sure you are using a profile that allows you to be running the XCode debugger, so not an enterprise profile.
When the game launches, grab the IP address that appears in the XCode debug console. It will have a port number so make sure to get that as well.

In Unity, in the profiler, click on the “Active Profiler” button in the bar at the top. Sometimes it picks it up automatically, but if not, dump in…




Unity & MonoDevelop 4 Woes

Unity usually always brings it to the table with their updates but sometimes they miss a few things. The MonoDevelop 4 is shiny but has one serious problem with the basics, at least on OSX. This is code folding! At first, code folding looks great. I do like the ability to fold “if” statements,¬†but after I update something, all hell breaks loose and I can’t fold anything anymore. My workflow relies on folding to help me navigate code (as I think it is so with a lot of other devs). So here are some steps to get back to the old version of Mono. I am on OSX Mavericks, on a mac book pro BTW. I am not sure if yall PC people have the same issue, but then you are probably using VS.

Dual Install Unity
Most people don’t know, but you can have multiple versions of unity on your machine. First, uninstall all your Unity instances. Next, do an install of Unity 4.2.2 (anything that is before 4.3). Once you have done this, rename your unity folder. I just rename it to “Unity 4.2.2”. Now install teh latest version of unity. So now, you have both versions of unity installed on your machine. The folders are “Unity” for the current and “Unity 4.2.2” for 4.2. Make sure update your shortcuts in your dock.
Link To The Old Mono
In the current install of Unity, open the Unity preferences and go to External Tools (Unity->Preferences->External Tools ). There, select “External Script Editor” and “Browse…” to open…




Collective Mass Radio #2




Collective Mass Radio #1