Game Career Guide is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Get the latest Education e-news
  • DIY RPG: Make Your Own RPG With The Source Engine

    - Ben Evans
  • [In this article from Game Developer magazine's 2012 Career Guide, developer Ben Evans provides an in-depth tutorial on making your own role-playing game in Valve's Source Engine.]

    If you want to get into game development, modding an existing game is a good way to start exploring design ideas and building prototypes without reinventing the wheel. In this tutorial, we're going to use Valve Software's Source Engine (the same game engine that powers Portal, Left 4 Dead, Half-Life, and Team Fortress 2) to prototype a mod with RPG-esque quests within Half-Life 2: Episode 2.

    Note that this tutorial assumes you have a basic knowledge of Source SDK's Hammer Editor and Face Poser tools, so it's definitely an intermediate-level project. You should be comfortable with building and compiling maps, placing entities, and setting up triggers before following this tutorial, and if you want to add custom dialogue, you'll also need to know how build and save your own scenes in Face Poser. It's okay if you've never used the Source SDK tools before-there are a ton of free resources online that you can use to learn how to use them. Start with the Valve Developer Wiki which hosts a lot of very useful tutorials and references, and then check out design3 (disclaimer: I am a design3 contributor) for step-by-step instructional videos on the Source Engine. The minimum requirements to run these tools are the same as the requirements for Half-Life 2: Episode Two: a 1.7 GHz processor, 512MB RAM, DirectX 8.1 level graphics card, and Windows XP or newer. You will also need a microphone that plugs into your PC.

    Gearing up

    Before we get started, let's make sure we have everything we need. First, you'll need a copy of Half-Life 2: Episode Two installed. We're going to use this game because it's the most up-to-date and flexible Source engine single-player game available for modding. If you don't have Episode Two, Half-Life 2 will be compatible with most of the elements in this tutorial as well.

    If you want to add custom dialogue to your RPG, you'll need some audio editing software. Audacity is a free, open-source audio-editing application that we're going to use to record your own dialogue for your mod.

    We'll also need a Phoneme Extractor patch that will help make Face Poser work better with Windows 7/Vista. Download it and follow the installation instructions. Without that patch, the tool that associates dialogue text strings with sound files won't work.

    Next, grab GCFScape. GCFScape allows us to open up the cache files that come with Steam games so we can view and extract the files within them. We'll be using it to extract audio for our mod.

    If you haven't already, you'll need to install the Source SDK, so open up the Steam Client, go to the Tools tab, and install it. You will need your own map to work with; we'll refer to it as "main map." It can be anything from just a few simple rooms up to a wide-open landscape. Figure 1 is a screenshot of the level I use in this tutorial-if you'd like to use this level for the tutorial, go ahead and download it here.

    Figure 1: Our sample level in the Hammer Editor

    Right now our level is just a rough prototype that hasn't been fully textured or detailed yet. It's always best to start rough and refine the details as you finalize the level, so just come up with a basic level structure to start with for your own RPG. Also, remember to save regularly! Some of the new features in Hammer are not fully supported in the Episode Two version and may crash your editor.

    Outlining the quest structure

    For this tutorial, let's focus on the questing aspect of a role-playing game-building a character-progression system with experience points would have to be a completely separate guide. Our game level will have three non-player characters (NPCs) giving two quests each. We can use them to give quests, provide information, fight against the player, or just add life to the environment.

    To keep our levels organized, let's use a naming convention prefix for our separate groups of entities, as explained in Figure 2.

    Figure 2: This naming convention will make it easier for you to stay organized.

    This will make finding the entities much easier, especially when working on individual quests. For example, adding the Level_prefix to entities that only affect the level keeps them all in one location in the list and out of the way of the quest entities.

    Before we start making quests, we need to break them down into smaller components. Figure 3 is a table that lists the order in which the components are used in each quest. Note that "" and "" listings refer to the actual game logic within the quests and the trigger to activate the following quest (if there is one).

    Figure 3: The anatomy of a quest.

    Don't worry about figuring out all of this yet-we're only making a list of what we need right now. This is a list for just one quest, so you can tell we'll have a lot of entities to keep track of by the time we're done. To keep our viewports (and minds) uncluttered, we're going to use Visible Groups (VisGroups) to separate and hide each quest. VisGroups let you define groups of brushes and entities and hide/show them quickly. If the VisGroup is hidden when the map is compiled, everything in that group will be skipped in the process and won't appear in the game. This is very useful because it allows you to selectively view individual groups of objects by themselves so that you can focus on them without all the other stuff getting in the way. We'll start using them in the next section.


comments powered by Disqus