Reader small image

You're reading from  Unity Game Development Essentials

Product typeBook
Published inOct 2009
Reading LevelIntermediate
PublisherPackt
ISBN-139781847198181
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Will Goldstone
Will Goldstone
author image
Will Goldstone

Will Goldstone is a longstanding member of the Unity community and works for Unity Technologies as a Technical Support Associate, handling educational content and developer support. With an MA in Creative Education, and many years experience as a lecturer in higher education, Will wrote the first ever Unity book, the original Unity Game Development Essentials, and also created the first ever video tutorials for the package. Through his sites http://www.unity3dstudent.com and http://learnunity3d.com Will helps to introduce new users to the growing community of developers discovering Unity every day.
Read more about Will Goldstone

Right arrow

Chapter 10. Building and Sharing

In order to take our game from a simple example to something we can share with play testers, we need to consider the various platforms of deployment and how we can adapt the game to be exported to the Web. The best method for you as a developer is to share your work. Unity allows for various scales of the final build of your game and will compress textures and various other assets as appropriate for you. You should also be aware of platform detection for web builds in order to adjust certain settings when deploying online, as opposed to a full standalone desktop build.

The standard Indie and Pro releases of Unity offer you the chance to build for Mac desktop, Windows desktop, as a Widget for Mac OS X's'Dashboard' facility, and as a web browser plugin.

In this final chapter, we'll look at how to customize assets to create a web build and a standalone desktop build. We will cover the following topics:

  • Working with Build Settings to export your game

  • Building a web...

Build Settings


In Unity, go to File | Build Settings now, and take a look at the options you have. You should see the various options mentioned previously:

In the Build Settings, Mac builds are marked by the prefix OS X — the current generation of operating system. The Mac builds also give you various options, as there are different generations of Mac computer to consider — the older generation, running on the PowerPC processor, and the current generation built around Intel processors. The Universal Binary setting will build an OS X binary that runs on both the older PowerPC systems as well as the new Intel systems. This results in a larger file, as you are effectively including two copies of your game in one application.

In our example, the Build Settings show the list of scenes we have added to our project so far, beginning with the Menu scene. It is important to have the first scene you'd like your player to see as the first item in the Scenes to build list. If your menu or first scene...

Building the game


Now that we are ready to build the game, you need to consider the varying deployment methods discussed previously, and adapt the project to be built for the Web as well as a standalone game.

Adapting for web build

In Unity, the 3D world you work with is fully scaled by the engine to be presented in whatever resolution you specify in the Player Settings. We have also designed the menus in this book to be scalable in different resolutions by utilizing the Screen class to position GUIs based on current resolution. However, in order to learn about platform detection we will remove an element we don't want to be seen in our web version — the Quit button. In the Scripts folder in the Project panel, double-click the icon for MainMenuGUI2 to launch it in the script editor now.

Quit button platform automation

As this is a web build, the Quit button we have added to the menu is meaningless. This is because Application.Quit() commands do not function when a Unity game is played through...

Quality Settings


When exporting from Unity, you are not restricted to any single level of quality. You have a lot of control over the quality of your output, which comes in the form of the Quality Settings. Open this now in the Inspector part of the interface by going to Edit | Project Settings | Quality.

Here you'll find the ability to set your three different builds to one of the six different quality presets — Fastest, Fast, Simple, Good, Beautiful, and Fantastic. You can then edit these presets yourself to achieve precise results as you need to. As you are just starting out with Unity, let's take a look at the opposite ends of the scale, comparing Fastest with Fantastic:

As you can see from the previous screenshot, the settings are vastly different from each end of the scale, so let's take a look at what the individual settings do:

  • Pixel Light Count: The number of pixel lights that can be used in your scene. Lights in Unity are rendered as a pixel or vertex, pixel looking better but being...

Player Input settings


While the Resolution Dialog window gives the standalone build player the ability to adjust the input controls of your game in the Input tab (see the following screenshot), it is important to know that you can specify your own defaults for the control of your game in the Player Input settings. This is especially useful for web builds, as the player has no ability to change control settings when they load the game. Therefore, it is best that you set them up sensibly and provide information to the player through your in-game GUI.

In Unity, go to Edit | Project Settings | Input to open the input settings in the Inspector part of the interface. You will then be presented with the existing axes of control in Unity. The Size value simply states how many controls exist. By increasing this value, you can build in your own controls, or alternatively you can simply expand any of the existing ones by clicking on the gray arrow to the left of their name and adjusting the values...

Sharing your work


In addition to placing your web player build into your own web site, there are also several independent game portal sites available that act as a community for developers sharing their work.

Here are some recommended sites you should visit once you are ready to share your work with the online community:

It is important that you share your work with others not only to show off your development skills but also to get feedback on your game and allow members of the public with no prior knowledge of your project to test how it works.

This kind of unbiased feedback is crucial as it allows you to weed out bugs and troubleshoot unintuitive parts of your game that may make sense to you but baffle the ordinary player.

Also, be aware that some sites may not be able to host your game in .unityweb...

Summary


In this chapter, we've looked at how you can export your game to the Web and as a standalone project. In the conclusion, we'll look back at what you have learned over the course of this book and suggest ways in which you can progress further with the existing skills you have developed and where to look for continued assistance with your Unity development.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Unity Game Development Essentials
Published in: Oct 2009Publisher: PacktISBN-13: 9781847198181
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Will Goldstone

Will Goldstone is a longstanding member of the Unity community and works for Unity Technologies as a Technical Support Associate, handling educational content and developer support. With an MA in Creative Education, and many years experience as a lecturer in higher education, Will wrote the first ever Unity book, the original Unity Game Development Essentials, and also created the first ever video tutorials for the package. Through his sites http://www.unity3dstudent.com and http://learnunity3d.com Will helps to introduce new users to the growing community of developers discovering Unity every day.
Read more about Will Goldstone