Tag: Unity3D

Unity Myth Busters

Unity Myth Buster: GameObject.Transform VS Cached Transform

Caching the transform was one for the first Unity optimizations I ever learned. It was drilled into me like scripture. But things change all the time, and Unity is the fastest evolving software platform I have ever used. Kudos to you Unity! Now I started using Unity back at the end of the 2.x cycle and we have come along way. IL2CPP is freaking amazing. The more profiling I have been doing, the more blown away I am by it. You will clearly see why by the results.

Enough blather, what we are going to be doing here is evaluating our assumption that caching the transform object is faster than referencing it from script or a game object. We are going to be taking our readings from device to be as accurate as possible. In this case, a Samsung Galaxy S8 (Android). I will be providing a link to the evaluation project so please report back with numbers from other platforms if you get different results. Test results from the editor are unreliable and don’t allow you to make use of IL2CPP optimizations.

The Setup

I wanted to check both performance and memory allocation here so I had to do some shenanigans. The most accurate way to get memory allocation readings that I know of is the Unity Profiler. To use that effectively I needed to separate the tests so that I could fire them manually after I had connected the profiler. So I made UI but the Unity canvas and event system creates its own garbage, especially…




Getting started with the Magic Leap One

I have some great clients that enable me to play around with tons of interesting new stuff like the Magic Leap One. It’s great because you get to take a look at the latest and greatest but it can also suck pretty hard. It can suck because new stuff mostly does not come with instructions or those instructions were a “TBD” on the backlog. Yea yea, it seems like I am just whingeing about nothing but it’s easy to forget how frustrating a crash with no feedback is. This speaks volumes to the quality of SDKs being produced nowadays and of course, to that wonder that is the internet.

With moving some of our demos to the Magic Leap One, it was a mixed bag. Getting up and running was easy peasy! Beautifully documented with precise easy to find instructions. We had the device so no messing around with simulators.

A few things to note:

To get a certificate for deploying to a device, you will need a DUNS number (DUN & Bradstreet) If you have ever published stuff as a company on iOS, you should already have it. Good news, unlike the Apple App Store, approval was a couple of seconds. I have been told you can get a temporary certificate from Magic Leap but how and where I have no idea.The device takes a little bit of time to be found by the deploying computer. Before deploying your app, you will need to use the Magic Leap console, mldb, to check for devices. Command “mldb devices”…




Unity3D Pro Tip

Unity Pro Tip: Gradient Property Color Stepping

An example of the fixed color step of the gradient property.

Unity updates fast and furiously and one thing you might have missed is the Gradient property update. With them already working on 2017.2, they have been busting it out! With this breakneck pace, you will undoubtedly miss some the coolness. Now, commercially, I am still on 5.6, but that just got released this year so I don’t feel too bad. Plus, there are a bunch of issues I encountered migrating to 2017 with Text Mesh Pro. So, if you are going to start a new project, go for it but I warn you, migrating existing projects will be a pain.

One of the little things you can find in 5.6 and above that is super useful is the upgrades to the Gradient property. Most commonly found in the Particle System component, the Gradient property can handle the linear interpolation of up to 8 colors. It also handles the interpolation of alpha separately with the same 8 key limit but on a separate track, meaning it’s not tied to the color keys. If you have not already used it for something else, consider it! As a programmer, you can expose color transitions for artists and game designers by just adding the field! It uses the same evaluation method as the curves property. Just call “myGradient.Evaluate(0.5f);”, 0,5f being the time or ratio. It serializes to boot, so great for JSON but it does create more data than you would think.




Notespace Beat

Notespace, the incredible journey!

As many of you know, I have been working with Alexis Brandow, who is owner of Amorse Inc. on a great product, called Notespace Beat. Notespace is an interactive musical activity book for kids. Its a very different vision for mobile and its jammed full of content. Its first a storybook, with each page being its own interactive puzzle packed with unique little experiences. Secondly, its a bunch of mini games, all of them different. The experience revolves around musical concepts, some of them classical like scale and intonation and some, not so classical like LFO waves. Thirdly, Notespace is virtual instruments. Currently it has a mix machine and a synth with 40+ different synth instruments. Like I said, jam packed full of content. The game also sports a musical album, by musical artist Bosko, that the players can win and download. The album is pretty dope just as a stand alone but he worked with us through out the project, adding touches here and tracks there.

The first thing we knew going in to this is that it would be a tough sell. Its a tablet only game on musical concepts with the main protagonists being non stereotypical female roles… not quite the game selling formula everyone is used to. We weren’t trying to make any kind of statement on gender but Alexis did want female role models that weren’t a-typical. She didn’t want super girly girls and she didn’t want its antithesis, super tom boy tomb raiders. She wanted roll models…




Adding the Dolby API to your Unity Project

While developing Notespace with Amorse Inc, we decided to implement the Dolby API into our tablet based game. The game is a interactive musical activity book for girls so it makes a whole bunch of sense. As of the date of this post, the Dolby API is integrated into the following:

Acer Iconia Tab 10 2014
Amazon Kindle Fire HDX 7 2012
Amazon Kindle Fire HDX 8.9 2012
Amazon Kindle Fire HD 7 2013
Amazon Kindle Fire HDX 7 2013
Amazon Kindle Fire HDX 8.9 2013
Amazon Fire HDX 7 2014
Amazon Fire HDX 8.9 2014
Amazon Fire HD 6 2014
Fujitsu Arrow F-06E
Lenovo Yoga 8 2013
Lenovo Yoga 10 2013
Lenovo Yoga Tablet 2 8” 2014
Lenovo Yoga Tablet 2 10” 2014
Lenovo Yoga Tablet 2 Pro 2014
Samsung Galaxy Tab 3 8.0 2013
Samsung Galaxy Tab 3 10.1 2013
Tesco Hudle2 Tablet
ZTE Grand S Flex
ZTE Grand S
ZTE Grand Memo LTE
ZTE Grand Memo N5S
ZTE Nubia Z5S
ZTE Nubia Z5S Mini
ZTE V975
ZTE N5S
ZTE Geek U988S
ZTE Boost Max
ZTE ZMax
ZTE BladeBox

As you can see, we know that its not on iOS devices (boo) but is on every Kindle Fire device past first gen. Thats a sizable market to optimize our experience for! We also know, for development down the road, that every Windows 8 device will have Dolby hardware. This is not necessarily true for Windows 8 mobile though, so don’t get them mixed up.

First, we are…




Collective Mass Radio #12

As always, check out the rest of the blog as well as the other Collective Mass Radio podcasts on the site. Huge thank you to the guys from Fract OSC for a great chat, it was really good to hear about both the ups and the downs. I hope that other indie game devs will hear your comment about scope and designing around technical limitations. Go visit the Fract site and buy the game NOW! It is a great experience with stunning shader work! Follow Fract on twitter at @FRACTgame, Richard at @phosfiend and Henk at @henkboom.




Locking layers in the Unity scene

Every now and then, while working Unity, I find that they changed something. It’s Like Déjà vu in the Matrix, but in a good way. This time I found that you can lock assets in place in the scene view. Its really weird because I was just lamenting about this, and “poof”, there is it! Its incredibly useful when you are laying out a 2D scene or UI against a comp where you are trying to match the source image your artist gave you. The problem was that, while placing or moving items, I would continuously selecting the layout image and then moving that. OMG, the pain! Now, I just make a layer in my project called “layout”, place my source image on that and then lock it. I make my source image a Unity sprite because A) its super easy to drag and drop into the scene and B) the layer locking only works with Unity native objects… not with 2D Tool Kit sprites. So Here is how you do it

Nift Unity layer pop-up for locking and hiding layers

Click the “Layers” drop-down in your scene view
Click the little lock next to the layer
Enjoy (preferably with a cup of coffee)




Collective Mass Radio #6

As always, check out the rest of the blog as well as the other Collective Mass Radio podcasts on the site. You can follow Clark on Twitter at @kromenak, check out his portfolio at http://www.clarkkromenaker.com and blog at http://www.supersegfault.com. Clark works at Hidden Variable studios who are the talented individuals behind Tic Tactics and Bag It! Be sure to give them your support by checking out their games as well as checking out the game Threes, which they did the Android port of.




Collective Mass Radio #5

As always, check out the rest of the blog as well as the other Collective Mass Radio podcasts on the site. You can follow Emil on Twitter at @angryant, check out his site at http://angryant.com/ or view his LinkedIn. Emil is currently available for interesting projects, so hit him up if you have something that requires his level of AI awesome!




Collective Mass Radio #4

As always, check out the rest of the blog as well as the other Collective Mass Radio podcasts on the site. You can follow Aras on Twitter at @aras_p. Send him your thoughts on just how cool the new Unity tech is!