Experimenting with Unity

Posted on 8th February 2013  |   Catagories: 3D, Illustration, Scripting, Unity
23 comments

Last year, I began a several-month-long process of learning to use Unity – a highly accessible, cross platform 3D game engine – with the ultimate goal of exploring it’s potential to create an interactive ‘toy’ along the same lines as Windosill by Vectorpark.

In the process I built a series of experiments, each focusing on different aspects of the engine and all contributing towards a final “proof of concept” design. It’s unlikely that these experiments will become part of a finished project in their own right, so I’m keen to share them here, with a few things I learned along the way.

From Dawn till Dusk

For this first post, I’ve put together a demonstration of the dynamic day/night cycle I developed for the project. From the outset I knew I wanted to play heavily on the use of light and how it changes throughout the day.

Below is an interactive demo, making use of the Unity Web Player, which you’ll be prompted to download if not already installed. It’s a lightweight plugin, and highly recommend – once installed, you’ll be able to play with all the official Unity demos and other user generated content too.

The game clock will automatically tick forward at a rate of 2 in-game minutes per second, but you can also click and drag across the sky to move time forwards or backwards manually. A couple of tips: right click to go fullscreen or click on the windmill to make it to rain!

I’ve also included a few of the birds sprites I developed, which are controlled by some (very) basic AI behaviour – be careful, they’re easily spooked!

A few other notes about the underlying system:

  • The colour/shading of all objects is determined by a single light source, which moves as part of the rotating sky plane.
  • The precise colours for dawn, day, dusk and night can all be adjusted to suit the environment.
  • Other objects and their attributes (such as the stars, clouds, porch light, etc) can also be adjusted depending on the time of day.
  • the overall art style is largely informed by the need to optimise performance across multiple platforms – I’m keen to talk more about the challenges and opportunities this presented, as overall, I’m pretty happy with the result.

That’s all for now – stay tuned!

Edit: I’ve now posted part two, click here to continue reading!

  • Alexander

    Looks quite nice. But that night-sky with shimmering stars, how did you do it? It looks amazing!

    • http://www.harrynesbitt.com/testing Harry Nesbitt

      Hi Alexander, thanks for commenting!

      The way the stars ‘twinkle’ is actually a happy accident, resulting from the lack of mipmapping and each star being smaller than a single pixel – as they pass between pixels, they get dimmer :D

      • Kaneki Shiba

        Looks like some diffraction effect, good job :)

  • Alex

    Man, this is sick! I can rotate this all day long!
    I’ve been wanting to learn Unity for a long time. Now I’m definitely gonna do that.

  • lennartbnl

    How did you achieve this lighting and shading? Any particular plugins or settings?

    • harrynesbitt

      Thanks for commenting! I’m using a modified version of the default toon shader in unity along with a custom ramp. All lighting is controlled by a single directional light combined with a script to adjust colours and attributes based on the time of day. Hope that helps!

      • Ryan

        Any chance you would like to post these assets?

  • http://twitter.com/fffabs Fabio ↬

    Really loving this, I am at that learning stage right now and doing a bit of unity 3ds max and zbrush at the same time, hoping to get a little beta out soon. Have you modelled your own scenario in a 3d package or did you reuse some existing assets?

    • harrynesbitt

      Hi Fabio, thanks for commenting! I built the 3D assets myself using Maya (I’ve dabbled in 3D before – http://bit.ly/Y6Su3Z). I personally found zBrush to be hugely challenging and couldn’t get to grips with it, I’d love to know how you get on!

      P.S. I love your avatar, did you design it?

      • http://twitter.com/stalkbrandon Brandon V. Fletcher

        I found Zbrush to have a higher learning curve. I think Mudbox is a lot more accessible especially if you’re used to using Maya.

        • http://twitter.com/fffabs Fabio ↬

          I agree but I think that’s because of the strange UI in Zbrush and the bazillion tools at your disposal.

      • http://twitter.com/fffabs Fabio ↬

        Hmm I am sure I replied to this yesterday but for some reason is not showing up, silly disquss :) anyway lovely work with 3d as well, and with your illustrations! Zbrush is quirky but it’s really powerful, loads to learn, I am giving myself a few months and see what I come up with.

        Thanks the avatar is my first non-UI work experience, it was made for fun and I did prepare some more for some of my colleagues http://drbl.in/gJtk :)

  • http://www.miletbaker.com/ Jon Milet Baker

    This is great! I look forward to reading about your progress.

  • http://joshuadance.com/ Joshua Dance

    Never heard of Windosill by Vectorpark. Now I am stuck on one of the levels. Thanks. :)

  • Anas Ali

    How did you make the awesome day/night cycle ?

  • el Flashor

    I just discovered this recently… and I must say this is very nice!
    I’m particularly interested in how you’ve setup the lights, gradient color changes, sky boxes… all that light-related stuff in Unity! ^^
    Would you mind sharing your thought and experimentation process about that?
    And once again, great job!

  • Amaikwu Chukwuebuka Steve

    Awesome and relaxing game. Thank you so much. I have been playing for hours. What’s the name of the song you used in the game trailer?

  • karai sua mãe

    Hello Harry, i am a student school SAGA Art BR, I’m studying an engine Unreal end Unity 5, Your Demo Timer It’s amazing, I really wanted to study for the engine (Unity),
    Unity Web Play It’s not much help.
    You could make it available For Me, my Friends,
    Study the time? Please!

    Just to compact
    Thanks (Sorry My English, i am Nob Kkkkkk)
    http://www.harrynesbitt.com/demo/time

  • Siracel

    It’s brillant! The most important part of me that amazes me was this!

  • shambhawi prakash

    Loved the concept of sensitive and stylised approach . The soothing UI of the game turned out to be one of the main reasons for me to download it ! Great work ! The conversion of the art into code sounds awesome . Would be great to know more about it . Could you please share something about your experience from simple art and design to graphic art ?

  • Leo LH

    HI, could you maybe release some snippets of code or layout in the scene editor, more specifically how you accomplished the rotating sky plane. It would help a lot with my school research thanks.

  • http://eufr1k.deviantart.com/ eufrik

    hi there! i hope you’d still get to read this. i was hoping you’d have the demo up somewhere else we could download? since unity’s web player had been phased out. i’d very much like to study it if that is possible. thanks for this!

    • http://joshuadance.com/ Joshua Dance

      I was wondering the same thing.