A Brief Foreword
Before jumping into the article I’d first like to clarify just what place tutorials have in Queer Pro Quo. Above all, this site is devoted to exploring the often overlooked LGBTQA issues and designers with the world of video games. I’ve created this site with the hope that, in some small increment, games will change for the better. But that change won’t happen overnight and it I don’t expect it to originate in major studios. It is up to independent developers like myself (and hopefully you) to create meaningful content. We can’t do that if we’re not willing to collaborate with and inspire one another, however. It is with this in mind that I’ve decided to provide guides for creating your own games with stories and characters that matter to you. So let’s begin.
What You Will Need
The standard version of Unity is free and available for download here. Any version will do, but personally I’m using 5.0.2f1.
- A beginner’s understanding of Unity
This guide will cover each step from new Unity file to finished product, but you will want to familiarize yourself with Unity’s UI, basic functions, and terminology here.
- Provided Scene (optional)
Everything in this guide can be easily built by you by following along. I am however providing the finished Unity file. If you’d prefer to skip the tutorial and simply download the finished product, you are certainly welcome to do so. If you are unfamiliar with Unity I would advise against this however as you may not understand the project’s inner workings.
What you will Learn
This tutorial isn’t meant to be for building a fully fledged game by any means, but rather serves as a useful starting point for making your own. After reading through this guide you will understand how to make a NavMesh (a navigation grid that AI can use to move to destinations and avoid obstacles) as well as create randomized destinations for those AI.
Since the goal of our Unity file will be to have a level that can be intelligently navigated by AI, we’ll need to start with building the level itself. Thankfully, this is pretty straightforward. When mapping out the geometry, don’t feel compelled to follow along exactly. Any configuration of cubes will do.
Start by creating a floor for you level. Do this by going to GameObject -> 3D Object -> Plane. I’ve put mine in the center of the map and scaled the X and Z values by 15. Once you have a floor, you’ll want to change the color to contrast with the obstacles you create. You can make a new material by going to Asset -> Create -> Material. Select this new material within your assets and you can then adjust it and rename it in the inspector.
Next you can fill your level with cubes and walls of varying dimensions. These are the obstacles that the NPCS will navigate around. First go to GameObject -> Create Empty to create an empty game object to serve as a group for all the cubes you will create. Next you can create the cubes themselves by going to GameObject -> 3D Object -> Cube. 5 by 5 by 5 is a good size for small obstacles but you can increase the dimensions for larger ones. Drag all the objects you create to your empty game object in the hierarchy to make the empty game object a parent. Fill out your level until you have something looking like this.
Once completed, you can move on to constructing the NavMesh