This section will include added notes and other topics that don't quite fit in our Unity project for several reasons – topics such as Virtual Reality (VR) for a side-scrolling game that could work but ideally would be better suited to a first-person view format to help with the potential issues that a developer may encounter.
Finally, in the last topic, we will cover some random general knowledge pertaining to Unity that could also help you through the exam.
As you probably know, VR has been around commercially since the '90s, but it only became more widely recognized when Oculus and Vive headsets, which can be hooked up to a PC, became accessible. A short time thereafter, mobile phones were being turned into VR headsets as a cheaper alternative, examples including Google Cardboard and Samsung's Gear VR attachment headsets.
As Unity developers, we need to not only understand the technical limitations of these VR devices but also understand how and why some people feel sick while others do not.
VR games/simulations can get rejected very quickly if, for example, the brain and the body know they are not inhabiting the world their eyes are telling them they are a part of.
Note
If you would like to know more about the health and safety aspect of using/developing a VR app, refer to the following link: https://retrophil.codes/Self-Study-App-Cognitive-Behaviour-GearVR.
So, in terms of performance and VR applications, frame rate is important. Developers are encouraged to aim for a high frame rate of 90 to avoid a jerky disconnect with the world the user is in. Latency or, to be more precise, motion to photon (MTP) is required to be no higher than 20 milliseconds (the delay in updates when the user moves their head) with a display refresh rate of 90 Hz (displays refresh every 11 milliseconds).
The following diagram shows the three aforementioned technical targets that need to be achieved when designing a VR app:
So, if we can hit those three targets consistently, the user will feel more immersed in their world. Keeping performance high means being careful with the platform's resources. For example, if, in the user's distance, there are plenty of 3D assets with materials and various textures applied that the players are never going to reach, we may as well replace those assets with a skybox to help maintain the fluidity of the VR app. Another technique designed to help keep the VR app running smoothly is by altering the texture of the display (renderViewportScale) at unavoidable parts in the VR app.
We, of course, can still make the user feel ill by overdoing things with post-processing effects and by adding aspects such as motion blur and depth of field, which may confuse the user, while removing aspects such as jagged edges on assets would naturally make the user feel even less like they are in a game/simulation. Meanwhile, even going as far as increasing the resolution through super-sampling can be a very expensive method for a mobile device. If your VR app is basic (no textures, basic lighting, and few assets), you may be able to achieve this... as long as your performance doesn't dip!
The main takeaway from this is that VR needs to run as smoothly and convincingly as possible before filling and polishing a scene too soon.
There is also a possibility in the Unity programmer exam that you will come across the odd question on shaders to establish how much you know about creating shaders or what different shaders can create. Learning about shaders is another book in itself, and it's also unlikely when you sit your exam that the majority of it will be devoted to shaders. Hence, if you don't know how to write shaders, do not concern yourself with the coding and focus more on the general practice and functions used. For example, a cel-shaded toon in an environment or custom post-processing effect can be achieved by using functions such as Camera.depthTextureMode to calculate the depth of a scene.
Knowing that these functions and methodologies exist will give you a better chance of answering them, and if you need more information on shaders in general, refer to the Packt book entitled Unity 2021 Shaders and Effects Cookbook – Third Edition; otherwise, I recommend skimming through the Shader reference manual provided by Unity: https://dev.rbcafe.com/unity/unity-5.3.3/en/Manual/SL-SurfaceShaders.html.
In the next section, I'll go through the process of installing post-processing v2 on later versions of Unity.
Some of the mock questions in the Unity programmer exam may refer to Forward and Deferred graphic settings, but what are these, apart from a selection that can be made in our Camera component in the Inspector window?
The following screenshot shows alternative rendering paths in the Camera component:
As we can see in the preceding screenshot, there are a variety of different rendering paths. Each of these will render our scene's surface and light in a slightly different way. Some will work faster than others but be devoid of other benefits, such as anti-aliasing.
Note
Refer to the following link to see the chart comparisons of the various rendering paths: https://docs.unity3d.com/Manual/RenderingPaths.html.
So, we really have come to the end of the book, and the whole process of designing a game/prototype was a way of trying to cover as many objectives from the Unity programmer exam as possible in a variety of scenarios. There are parts in this tutorial series where obviously things could have been quicker or done better with regard to creating a project, but this book was never about making a game. It was about covering as much as possible while seeing your project develop.
Also, if you bought this book simply with a view to making a game and you haven't made one before, you've covered a range of tools and components that you can now use, and for sure, you could find employment as a Unity developer. The majority of the 30+ Unity projects I have worked on have all emanated from the skills I have demonstrated in this book. Hence, if you want to carry on with Killer Wave or rename it and change the concept to personalize the game, go for it. You have an adequate foundation to continue, but where should you go next with the game?
Here is a list of things that you could work on in order to continue with Killer Wave:
Optimize the code:
transform.position = lastPos + wantedVelocity * (speed * speedFactor * Mathf.Sin(someOtherFactor) * drag * fricition * Time.deltaTime);
Transform _transform;void Start(){_transform = this.transform;}
Other game ideas:
I hope these ideas/suggestions help and that the book, in general, helps you on your journey. The very best of luck!
The answers to the mock questions located at the end of some chapters can be found in the following sections:
More questions and answers can be found at the Packt repository at the following link: https://github.com/PacktPublishing/Unity-Certified-Programmer-Exam-Guide-Second-Edition /tree/main/Extra.