10 CHAPTER 1: Designing and Preparing
Developing the Design: Looking Ahead
The previous sections, taken together in combination with the YouTube gameplay video (URL
provided earlier), should offer a strong enough and clear enough vision of CMOD. These resources
will constitute our game design document (GDD), a document clearly articulating the vision of the
game to make. For most games, the GDD will typically be longer and more comprehensive than
ours, but our GDD is sufficient and fit for purpose in our case. The design may initially seem “simple”
(or maybe not!), but if it seems so to you, it’s important not to confuse simple with simplicity. The
game we’ve planned actually involves a lot of work, especially C# coding work. Each subsequent
chapter is dedicated to a specific aspect or subset of development. In this section, we’ll take a
sneak glimpse of that future work: a general guided tour through some of the main issues and
subjects we’ll visit throughout this book. This work ranges from using the Unity Editor and tools,
sometimes in new and creative ways, to heavy coding sessions in C# to create artificial intelligence
and pathfinding. Let’s see how these subjects, and our workload in general, are distributed across
the book on a chapter-by-chapter roadmap.
Chapter 2 is concerned with establishing the foundations of our game.
Game development is a specialization of software engineering, and like most
engineering projects, it must begin by laying foundations. This involves lots of
work in the Unity Editor—especially level design work—using both the scene
and game views for assembling and building a level with modular environment
pieces. It’ll also involve lighting and lightmapping with the Beast lightmapper
to get an appropriate mood and look for our environment. In addition, we’ll
also look at processes for automating asset importing to fix some mesh import
issues we’ll encounter. By the end of Chapter 2, we’ll end up with a project that’s
ready to start customizing and defining through C# scripting.
Chapter 3 starts our coding adventure! It’s where we add code to our project.
It’ll explore event-driven programming in depth, looking at what it is, how it
works, and how to integrate it into our project to get efficient results. It’ll also
explore why we should start implementing this kind of system before anything
else. Practically, every game needs to detect when things happen, such as when
the Player dies or collects a power-up, among others (these will all be important
events for us). In addition, other objects in the game need to know when those
events occur, so they can respond in specific ways. The Enemies, for example,
need to know when they’re close enough to the player to launch an attack;
otherwise, they’ll never know when to start attacking. These issues concerning
events and responses will lead us to develop a streamlined and dedicated
Notifications class; one capable of handling almost every kind of event and
response we could ever want in a game.
Chapter 4 will see us using concepts such as class inheritance, Singletons,
and vector arithmetic for creating our four workable power-ups for the game:
the Cash Power-Up, the Upgrade Weapon Power-Up, the Ammo Power-Up and
the Health Restore Power-Up. Achieving this requires us to consider a range
of ideas. We’ll use the Unity API to work with Physics Colliders, components,
and 2D sprites (part of the 2D functionality added in Unity 4.3). We’ll also
develop a range of different and interacting classes, and build our own Billboard
functionality to ensure sprites are always camera aligned. By the end of this
www.it-ebooks.info