Unity game development essentials review
Only the first chapter has a standalone demo to get your feet wet, the rest of the book is all one project. I found this format to work nicely, as you can concentrate on one aspect of the game design during each chapter but feel more accomplished as you built up the game.
It covers creating a terrain, setting up a player controller, importing models, creating a GUI, collision detection, basic scripting to trigger events, and basically everything you would need for a simple demo.
Although the game you build will not win any awards, it is functional and teaches some fundamental concepts. What I will say is that the author did a bang-up job with the source code listings. There are tons of code snippets throughout the book and I found only one, yes one, mistake out of the whole thing. And, even then, it was a minor variable misnaming.
Nothing major. This was a refreshing surprise, as many programming books are riddled with errors and non-compiling code. We'll be utilizing rigid body dynamics as part of our prototype in this chapter and as part of the main game of the book in Chapter 7 , Instantiation and Rigid Bodies. More crucial in game engines than in 3D animation, collision detection is the way we analyze our 3D world for inter-object collisions.
By giving an object a Collider component, we are effectively placing an invisible net around it. This net usually mimics its shape and is in charge of reporting any collisions with other colliders, making the game engine respond accordingly. There are two main types of Collider in Unity— Primitives and Meshes. Primitive shapes in 3D terms are simple geometric objects such as Boxes , Spheres , and Capsules.
Therefore, a primitive collider such as a Box collider in Unity has that shape, regardless of the visual shape of the 3D object it is applied to.
Often, Primitive colliders are used because they are computationally cheaper or because there is no need for precision. A Mesh collider is more expensive as it can be based upon the shape of the 3D mesh it is applied to; therefore, the more complex the mesh , the more detailed and precise the collider will be, and more computationally expensive it will become.
However, as shown in the Car tutorial example earlier, it is possible to assign a simpler mesh than that which is rendered, in order to create simpler and more efficient mesh colliders. The following diagram illustrates the various types and subtypes of collider :. For example, in a ten-pin bowling game, a simple Sphere collider will surround the ball, while the pins themselves will have either a simple Capsule collider , or for a more realistic collision, employ a Mesh collider , as this will be shaped the same as the 3D mesh of the pin.
On impact, the colliders of any affected objects will report to the physics engine, which will dictate their reaction, based on the direction of impact, speed, and other factors.
In this example, employing a Mesh collider to fit exactly to the shape of the pin model would be more accurate but is more expensive in processing terms. This simply means that it demands more processing power from the computer, the cost of which is reflected in slower performance, and hence the term expensive. Unity makes the game production process simple by giving you a set of logical steps to build any conceivable game scenario.
Renowned for being non-game-type specific, Unity offers you a blank canvas and a set of consistent procedures to let your imagination be the limit of your creativity. By establishing its use of the GameObject concept, you are able to break down parts of your game into easily manageable objects, which are made of many individual Component parts.
By making individual objects within the game—introducing functionality to them with each component you add, you are able to infinitely expand your game in a logical progressive manner.
Component parts in turn have Variables —essentially properties of the component, or settings to control them with.
By adjusting these variables , you'll have complete control over the effect that Component has on your object. The following diagram illustrates this:. In the following image we can see a Game Object with a Light Component , as seen in the Unity interface:.
If we wished to have a bouncing ball as part of a game, then we would begin with a sphere. This can quickly be created from the Unity menus, and will give you a new GameObject with a Sphere mesh the 3D shape itself. Unity will automatically add a Renderer component to make it visible. Having created this, we can then add a Rigidbody component. A Rigidbody Unity refers to most two-word phrases as a single word term is a component which tells Unity to apply its physics engine to an object.
With this comes properties such as mass, gravity, drag, and also the ability to apply forces to the object, either when the player commands it or simply when it collides with another object. Our sphere will now fall to the ground when the game runs, but how do we make it bounce?
This is simple! The collider component has a variable called Physic Material —this is a setting for the physics engine, defining how it will react to other objects' surfaces. Here we can select Bouncy —a ready-made Physic material provided by Unity as part of an importable package and voila! Our bouncing ball is complete in only a few clicks. This streamlined approach for the most basic of tasks, such as the previous example, seems pedestrian at first. However, you'll soon find that by applying this approach to more complex tasks, they become very simple to achieve.
Here is an overview of some further key Unity concepts you'll need to know as you get started. These are the building blocks of all Unity projects. From textures in the form of image files, through 3D models for meshes, and sound files for effects, Unity refers to the files you'll use to create your game as assets. This is why in any Unity project folder all files used are stored in a child folder named Assets.
This Assets folder is mirrored in the Project panel of the Unity interface; see The interface section in this chapter. In Unity, you should think of scenes as individual levels, or areas of game content—though some developers create entire games in a single scene, such as, puzzle games, by dynamically loading content through code.
By constructing your game with many scenes, you'll be able to distribute loading times and test different parts of your game individually. New scenes are often used separately to a game scene you may be working on, in order to prototype or test a piece of potential gameplay.
Any currently open scene is what you are working on, as no two scenes can be worked on simultaneously. Scenes can be manipulated and constructed by using the Hierarchy and Scene views. Any active object in the currently open scene is called a GameObject. Certain assets taken from the Project panel such as models and prefabs become game objects when placed or 'instantiated' into the current scene. Other objects such as particle systems and primitives can be placed into the scene by using the Create button on the Hierarchy or by using the GameObject menu at the top of the interface.
All GameObjects contain at least one component to begin with, that is, the Transform component. Transform simply tells the Unity engine the position, rotation, and scale of an object—all described in X, Y, Z coordinate or in the case of scale, dimensional order.
In turn, the component can then be addressed in scripting in order to set an object's position, rotation, or scale. From this initial component, you will build upon GameObjects with further components, adding required functionality to build every part of any game scenario you can imagine. In the following image, you can see the most basic form of a Game Object , as shown in the Inspector panel:. GameObjects can also be nested in the Hierarchy, in order to create the parent-child relationships mentioned previously.
Components come in various forms. They can be for creating behavior, defining appearance, and influencing other aspects of an object's function in the game.
By attaching components to an object, you can immediately apply new parts of the game engine to your object. Common components of game production come built-in with Unity, such as the Rigidbody component mentioned earlier, down to simpler elements such as lights, cameras, particle emitters, and more. To build further interactive elements of the game, you'll write scripts, which are also treated as components in Unity. Try to think of a script as something that extends or modifies the existing functionality available in Unity or creates behavior with the Unity scripting classes provided.
While being considered by Unity to be components, scripts are an essential part of game production, and deserve a mention as a key concept. You should also be aware that Unity offers you the opportunity to write in Boo a derivative of the Python language. We have chosen to primarily focus on C and Javascript as these are the main two languages used by Unity developers, and Boo is not supported for scripting on mobile devices; for this reason it is not advised to begin learning Unity scripting with Boo.
Unity does not require you to learn how the coding of its own engine works or how to modify it, but you will be utilizing scripting in almost every game scenario you develop.
The beauty of using Unity scripting is that any script you write for your game will be straightforward enough after a few examples, as Unity has its own built-in Behavior class called Monobehaviour — a set of scripting instructions for you to call upon.
For many new developers, getting to grips with scripting can be a daunting prospect, and one that threatens to put off new Unity users who are more accustomed to design.
If this is your first attempt at getting into game development, or you have no experience in writing code, do not worry. We will introduce scripting one step at a time, with a mind to showing you not only the importance, but also the power of effective scripting for your Unity games. To write scripts, you'll use Unity's standalone script editor, Monodevelop. This separate application can be found in the Unity application folder on your PC or Mac and will be launched any time you edit a new script or an existing one.
Amending and saving scripts in the script editor will immediately update the script in Unity as soon as you switch back to Unity. You may also designate your own script editor in the Unity preferences if you wish to, such as Visual Studio. Monodevelop is recommended however, as it offers auto-completion of code as you type and is natively developed and updated by Unity Technologies.
Unity's development approach hinges around the GameObject concept, but it also has a clever way to store objects as assets to be reused in different parts of your game, and then instantiated also known as 'spawning' or 'cloning' at any time.
By creating complex objects with various components and settings, you'll be effectively building a template for something you may want to spawn multiple instances of hence 'instantiate' , with each instance then being individually modifiable. Consider a crate as an example—you may have given the object in the game a mass, and written scripted behaviors for its destruction, and chances are you'll want to use this object more than once in a game, and perhaps even in games other than the one it was designed for.
Prefabs allow you to store the object, complete with components and current configuration. Comparable to the MovieClip concept in Adobe Flash, think of prefabs simply as empty containers that you can fill with objects to form a data template you'll likely recycle.
The Unity interface, like many other working environments, has a customizable layout. Consisting of several dockable spaces, you can pick which parts of the interface appear where. Let's take a look at a typical Unity layout:. This layout can be achieved by going to Window Layouts 2 by 3 in Unity. As the previous image demonstrates Mac version shown , there are five different panels or views you'll be dealing with, which are as follows:. Scene [1] —where the game is constructed.
Game [2] —the preview window, active only in play mode. Hierarchy [3] —a list of GameObjects in the scene. Project [4] —a list of your project's assets; acts as a library.
The Scene view is where you will build the entirety of your game project in Unity. This window offers a perspective full 3D view, which is switchable to orthographic top-down, side-on, and front-on views. When working in one of the orthographic views, rotating the view will display the scene isometrically. The Scene view acts as a fully rendered 'Editor' view of the game world you build.
Dragging an asset to this window or the Hierarchy will create an instance of it as a GameObject in the Scene. The Scene view is tied to the Hierarchy , which lists all GameObjects in the currently open scene in ascending alphabetical order. The Scene window is also accompanied by four useful control tools, as shown in the following image:.
Accessible from the keyboard using keys Q , W , E , and R , these keys perform the following operations:. The Hand tool [ Q ]: This tool allows navigation of the Scene window. By itself, it allows you to drag around in the Scene window with the left mouse button to pan your view.
To gain access to the entire source code and receive enterprise grade support, there are bespoke packages available, allowing you to design a tailored solution that can include a custom number of concurrent users and customer courseware that best suits your team. Of course, this could change, especially since Amazon owns Twitch, which is becoming more and more important for games marketing. One of the major benefits of using Unity is that a lot of the advanced engine coding is handled for you.
This is a key area to consider when choosing an engine for your game. Most teams will happily take the added speed and convenience, but this can be a deal breaker for those that want absolute authority over the engine. The upcoming first-person game P. The Unity player can currently export builds for over 20 different platforms — more than most of its competitors.
There is even a VR version of the editor in the works where you can put yourself in your scene and place game objects by hand. This will be extremely useful for level designers even in non-VR games. The web build platforms are worth mentioning separately for a moment.
Chrome first dropped it rather suddenly in September If you want to make a Unity multiplayer game, you will want to do some serious research. Unity have started to provide their own multiplayer servers but they are not long out of Beta and do cost money to go beyond a very low level of support.
Research what best suits your needs and shop around for price. Apart from Multiplayer, Unity have been bringing a whole suite of online services to their users in recent months.
Unity Analytics, Cloud Build, Collaborate, Ads and more seek to provide the entire solution with a particular focus on team development and mobile games services. Punch Club and Party Hard were two recent games made with Unity that saw great and unexpected publicity because of their Twitch integration.
Viewers could literally play or participate in these games through text commands in the chat. This suggests a whole new way to play and market games. The Unity Roadmap webpage makes for no small amount of interesting reading. They have teams in twenty locations around the world handling all different areas of research and development.
Singapore is primarily in charge of the 2D features, for example. In the near future we can see a lot of WebGL work and new build platforms coming down the line, but also a lot of 2D, VR and physics improvements. They seem to be simultaneously focusing on closing the graphics gap with other engines, keeping their lead on build platforms, keeping VR developers sweet check out videos for the VR editor — sweet! Well, are you a student, hobbyist, or a small studio? Then Unity probably is for you.
The number includes a higher proportion of students and hobbyists than is found using other engines. This is because Unity has a relatively friendly learning curve and its free version can do an awful lot, especially since Unity 5 removed the paywall for advanced features like lighting and certain cloud services.
Here the number would be a lot lower.
0コメント