Search Unity

Greeting Unity developers! A couple months ago we at Camouflaj published Remastering Republique: The Journey to Unity 5, a series of videos, articles and blog posts, sharing our experience thru the course of the project.

Today we’re going one step further by sharing a real slice of our game at the Unity Asset Store! Hopefully, this will act as resource for the community to learn about what’s possible with Unity 5, and how it can be applied this in a real game.

You’ll find several areas from Republique in this project file: the Brigs, the Atrium, and the Terminus. You’ll also see how we used several out-of-the-box Unity 5 features: Reflection Probes, Enlighten, new Animation and Audio features, and more.

Here’s a quick tour to walk through some of the things you’ll find.

ENLIGHTEN 

image04

image00

Republique’s Atrium space was the first thing we tackled as a studio when we moved to Unity 5. Many studios will create a proof of concept by taking a simple, unimpressive space and transforming it using the new technology they’re looking to adopt. We did just the opposite! The Atrium is Episode 1’s hero space, undeniably one of our favorites, and we wanted to be honest with ourselves about what migrating to Unity 5 would do for the highest quality areas. We were pleasantly surprised by the enhancements provided by Enlighten, particularly in the light being cast from the top of the scene.

 image07

Emissive materials are one of the newest additions to Unity 5. Here you can see that by increasing the Emission intensity of the Fluorescent Light material, you get a much brighter scene with bounce lighting. You will receive instant feedback if you have continuous baking checked. This is a huge time saver when lighting your environment.

image06

You can see in the material example that the emission value is a new feature, and can easily be animated by adding an Animation track that controls these values.

image10

image09

Here you can see that by increasing the Indirect Intensity in our lighting tab, the scene will dynamically update and become brighter. This, like everything else, is displayed in real time.

 image05

Reflection probes allow metals to react more like their real-world counterparts by reflecting the environments around them. If you check Box projections, these more accurately reflect the geo around them, provided the scene is a square shape.

image12

Here you can see that if we take the pillar and set the surface of the material to metal and increase the reflectivity, you get a spatially accurate reflection.

image11 

Likewise, as you decrease the smoothness, the reflection will become rough or blurry.

image01

UNITY 5 AUDIO

image03

Unity 5’s Audio Mixer allows you to categorize audio and specify output buses to allow for more flexibility in how audio is routed and mixed, as well as how effects are applied. In the ‘Ambience’ group, ‘Ambience’ is split into 2D and 3D sub-groups. Naturally, 3D ambient audio is routed to the 3D sub-group, so that the audio associated within the 3D bus fire appropriately relative to their grouping. Within each group, the volume and pitch can be adjusted, audio filters can be applied and tweaked, and you can solo or mute individual or entire groups in real-time. Just be sure to click on ‘Edit in Play Mode’ on the top right corner of the Audio Mixer while the game is running. As an example, we’ve added ‘SFX Reverb’ to the Footsteps group for you to tweak and play around with while the game is running.

image02

Once you’re satisfied with how the mix is turning out, you can save a Snapshot of your Audio Mixer settings. Snapshots are very useful in preserving your mix, as well as allowing you to create multiple sound profiles, paving the way for a more dynamic mix.

MECANIM

When you’re ready to press play and give the game a shot, you can left click to move Hope around the environment, and use WASD to control the camera. We’ve included several animations, but since we are exposing the Mecanim API, you will be able to create all sorts of tools to create and edit Mecanim assets.

image08

In this project, there is a button to re-create the Animator used on Hope 1 click. The script creates a similar Animator in the Project folder. The code for the creation of the controller is as simple as it gets:

[csharp][MenuItem ("Hope/Create Controller")]

static void CreateController () {

<i>// Creates the controller</i>

var controller = UnityEditor.Animations.AnimatorController.CreateAnimatorControllerAtPath ("Assets/HopeScriptCtrl.controller");

<i>// Add parameters</i>

controller.AddParameter("Walk", AnimatorControllerParameterType.Bool);

controller.AddParameter("TurnLeft", AnimatorControllerParameterType.Bool);

controller.AddParameter("TurnRight", AnimatorControllerParameterType.Bool);

controller.AddParameter("HalfTurn", AnimatorControllerParameterType.Bool);

<i>// Add StateMachines</i>

var rootStateMachine = controller.layers[0].stateMachine;

var stateMachineStand = rootStateMachine.AddStateMachine("Stand");

<i>// Add States</i>

var stateIdle = stateMachineStand.AddState("Idle");

var stateTurnLeft = stateMachineStand.AddState("TurnLeft");

var stateTurnRight = stateMachineStand.AddState("TurnRight");

var stateHalfTurn = stateMachineStand.AddState("HalfTurn");

var stateWalk = stateMachineStand.AddState("Walk");

stateIdle.motion = AssetDatabase.LoadAssetAtPath("Assets/Animations/Hope Animations/StandingIdleLooking.fbx", typeof(AnimationClip)) as Motion;

stateTurnLeft.motion = AssetDatabase.LoadAssetAtPath("Assets/Animations/Hope Animations/MoveStand90_L.fbx", typeof(AnimationClip)) as Motion;

stateTurnRight.motion = AssetDatabase.LoadAssetAtPath("Assets/Animations/Hope Animations/MoveStand90_R.fbx", typeof(AnimationClip)) as Motion;

stateHalfTurn.motion = AssetDatabase.LoadAssetAtPath("Assets/Animations/Hope Animations/MoveStand180.fbx", typeof(AnimationClip)) as Motion;

stateWalk.motion = AssetDatabase.LoadAssetAtPath("Assets/Animations/Hope Animations/MoveWalk_F.fbx", typeof(AnimationClip)) as Motion;

<i>// Add Transitions</i>

var idle2TurnLeft = stateIdle.AddTransition (stateTurnLeft);

var turnLeft2Idle = stateTurnLeft.AddTransition (stateIdle);

idle2TurnLeft.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If, 0, "TurnLeft");

idle2TurnLeft.duration = 0.025f;

turnLeft2Idle.hasExitTime = true;

turnLeft2Idle.exitTime = 0.85f;

turnLeft2Idle.duration = 0.15f;

var idle2TurnRight = stateIdle.AddTransition (stateTurnRight);

var turnRight2Idle = stateTurnRight.AddTransition (stateIdle);

idle2TurnRight.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If, 0, "TurnRight");

idle2TurnRight.duration = 0.025f;

turnRight2Idle.hasExitTime = true;

turnRight2Idle.exitTime = 0.85f;

turnRight2Idle.duration = 0.15f;

var idle2HalfTurn = stateIdle.AddTransition (stateHalfTurn);

var halfTurn2Idle = stateHalfTurn.AddTransition (stateIdle);

idle2HalfTurn.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If, 0, "HalfTurn");

idle2HalfTurn.duration = 0.025f;

halfTurn2Idle.hasExitTime = true;

halfTurn2Idle.exitTime = 0.85f;

halfTurn2Idle.duration = 0.15f;

var idle2Walk = stateIdle.AddTransition (stateWalk);

var walk2Idle = stateWalk.AddTransition (stateIdle);

idle2Walk.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If, 0, "Walk");

idle2Walk.duration = 0.025f;

walk2Idle.AddCondition(UnityEditor.Animations.AnimatorConditionMode.IfNot, 0, "Walk");

walk2Idle.duration = 0.25f;

}[/csharp]

And so ends our summary of the Republique Remastered in Unity 5 Learn Project! We hope you find our project useful, and we inspired you to experiment and learn more on your own. Best of luck from all of us at Camouflaj!

 
*NOTE: Visual fidelity of project file may differ slightly from the retail version of Republique Remastered.

Comments are closed.

  1. Tommaso Lintrami

    May 19, 2015 at 7:43 pm

    Much appreciated by me and my students!

  2. Thank you very much!

  3. Harsha Krishna K

    April 23, 2015 at 4:23 am

    Oh.! You gave it for free …Very good for learning..

  4. Wow, this is very generous and will help a lot of people understand and explore settings that produce various results on the render, lighting, and material fronts. Thankyou, thankyou, thankyou.

  5. Andrew Peterson

    April 20, 2015 at 11:19 pm

    This is incredibly generous! Thanks for taking the time to do this. It’s really inspiring to me and I’m sure a lot of other Unity devs as well!

  6. Matias Lauriti

    April 20, 2015 at 7:15 pm

    This shows as what Unity 5 can give us… is AMAZING to see this type of titles (AAA) made with Unity !!!

  7. *Extremely* generous and useful for all Unity devs around the World. Thanks!