20.Mar.07 Lecture 8
Focus on final projects, installers, triggers

Motivate

We are going to move into a new phase of the class where you will be working on your individual games. This will be the section where you will have to self motivate and make changes to your game each week. I will be asking you to send me an e-mail each week as to what you are going to accomplish that week and you will turn in your game each week and tell me what you actually got done. This should be the fun part of the class. Hard work, but fun.

You can go to a great school and still not learn anything. You can go to a bad school (or not at all) and still be successful. It is all about what YOU put into life. Nothing will ever be handed to you, you have to earn your place. You have an opportunity here to develop a new skill and to build a really fun game. There will be parts that will be tedious and hard and I'm here to help you through those, but the end result should be a fun game you are proud to show off to your friends.

Only 49 days left. That is only seven weeks.

Barrel Texture

Progress Reports

I have to submit progress reports next week. You can find your current grade on blackboard. Make sure you are keeping up with the projects.

Do you now have everything you need to create a cool game in TGE?

We have covered most of the core topics required to create a game inTGE. If you still don't know how to do something or want to go further into a specific topic, please ask and I'll try and lecture on it.

I do still have a lot more to go over and will be covering more topics, but it is important that you spend the next seven weeks building your final projects.

Installers

For your final project (and all homework from now on), you will be required to create an installer for your game.

Why?

This is actually going to become a portfolio item you will use to get a job. You are going to want to make it as easy as possible for a potential employer to see your work.

What?

The installer we are going to use is NSIS. This was created by the WinAmp folks and spun off into another open source project.

How?

Basically you create a text file (.nsi) that describes your install and all the files that are required for the install and where each item gets installed. That text file is compiled into a single exe and when it is run will install all the files you specified in the .nsi file. This should be a very simple process for you to create

Always start with a working example.

You don't actually have to do this next part, I'm including a sample file I would like you to modify. It is the file I created when using example2 as a starting point.

To test the basic process, take the example2.nsi file.

Right click on it and select Compile NSIS script. This will create the example2.exe file which only installs one file, the example2.nsi file. It is as simple as you can get. We'll use this as a good starting point for your game.

For your installer:

Create a new directory called yourgame-dist. This is what I call the distribution directory. This will contain the final distribution of your game. In our case you will be shipping source with the game until class is over, but in the real world we would only copy the .dso and .ml files to this area not the source code.

Copy the skilltest.nsi file to this directory and rename it yourgame.nsi.

Copy all your game files to this directory. All the elements for my specific game are torquedemo.exe (renamed skilltest.exe), the gameOne directory (you should rename it at some point), the common directory and a main.cs file. You will need the creator directory if you want to edit your missions.

First I edited the skilltest.nsi file and changed all the Example2 entries to GD360SkillTest. You can change the SkillTest to the name of your Game (leave the GD360 see below).

CAUTION: You are changing registry entries here. Make sure you get them all to match or your machine could have extra fluff in the registry after uninstall and this is a sure way to screw up someones machine and miss getting a perfectly good job (or grade!).

Make sure to add your design document into the install so I know who wrote it and what the game is. The design doc should include your name and information about the game and game design. It can be .txt or .doc format. Each week you should add a section to the document that describes the changes made since the previous week.

Then I added the list of files that I want the installer to include.

; Put file there
File /r "GameOne"
File /r "Common"
File "skilltest.exe"
File "main.cs"
File "mydesign.doc
"

The /r tells it to recursivly include all files and a specific directory.

Later in the file you will also need to remove all those files.

; Remove files and uninstaller
RmDir /r $INSTDIR\GameOne
RmDir /r $INSTDIR\Common
Delete $INSTDIR\skilltest.exe
Delete $INSTDIR\main.cs
Delete $INSTDIR\mydesign.doc
Delete $INSTDIR\uninstall.exe

Please make sure you remove everything. I will mark down significant points if you do not remove all the registry items and files on uninstall. Make sure you test this process.

PLEASE MAKE MY LIFE EASIER AND DON'T SCREW UP MY MACHINE WITH A BAD INSTALL! I WILL REQUIRE THAT YOU USE SPECIAL NAMING SO I CAN TRACK MY MACHINE CHANGES. MAKE SURE ALL ITEMS ARE REMOVED BY THE UNINSTALL. IT IS EXTREMELY BAD FORM TO LEAVE FILES AFTER AN UNINSTALL.

Name your install directories and registry values starting with GD360. For instance, my game directory would be.

; The default installation directory
InstallDir $PROGRAMFILES\GD360SkillTest

The registry values would be:

WriteRegStr HKLM SOFTWARE\GD360SkillTest "Install_Dir" "$INSTDIR"

Use regedit (Start/Run - regedit) to make sure you really did clear out the registry keys. HKLM stands for HKey, Local Machine. You should be able to find that very easily with regedit.

Here is my sample nsi file you should use as a starting point.

If you notice, I give my installer a version number. This is so I can more easily keep track of various installers that might end up on cdroms or other websites. I can quickly tell what version we are talking about. I always use three numbers. 1-0-0 would be version 1.0.0. 1-0-1 would be a minor bug fix to version 1. 1-1-0 would be 1.1 which is intermediat dot release. For our purposes we are starting with 0-0-8 which I consider an alpha (very rough, not even ready for general testing) version. In this case 8 stands for week 8. You will have to change this number each week when you build a new installer to turn in.

Keeping version information clear will really make your life a lot easier. Most large projects also include build numbering. A large group of developers check their code into a central area and a librarian does the build each evening (or more often). The release is tracked on version and build number as there may be a significant number of builds for each release. Each organization will have it's own process, but they all have a well documented system to keep the developers organized.

Triggers

First, an overview page on creating triggers.

What would you use a trigger for?

Populating an area with bad buys.

Starting some sort of process that spawns bad guys. In my game I'm using triggers to start a process of poping up targets.

Damage from standing/moving into the wrong place.

Increased health from some sort of healing system.

Enrage or Scare opponents.

Teleportation.

Move to another level/area.

You can do almost anything with triggers.

Using the above website, I created a DoorFrameTrigger you could use in one of your games.

Add the Door Trigger by adding Mission Objects - Mission - Trigger and selecting DoorFrameTrigger as the Data Block. When you move into the trigger it prints out the message "DoorFrame onEnterTrigger". Your code would have logic here that make the game do something at that point.

Datastructures

Deciding how to store information is always going to be something you are going to have to get used to. What are the best ways to store different types of information? The answer is, it depends and there are many different ways to make something work. Over the next few weeks I would like you to ask questions about different types of games (existing or something you are working on) and let's talk about the best way to represent the information you require for the game.

Audio

Sample rates

Phone - 11 kHZ

Radio - 22.5 kHZ

CD - 44.1 kHZ

Audio files are just files of numbers.

Good pc audio primer

What are some of the audio file formats

AU - Sun Audio Format

AIFF - Audio Interchange Format - Apple/EA developed

WAVE - Microsoft audio format

MP3 - MPEG-1 Audio Layer 3

MIDI - Musical Instrument Digital Interface

Audacity - Audio editing tool

Creating audio

Zoom in - zoom out

Scrolling

Truncating

Using filters

Saving audio in other formats.

CPSC240 - Games Development
Chapman University
Instructor: W. Wood Harter
(c) copyright 2006-2007 - W. Wood Harter - All Rights Reserved
Screen shots on banner (c) copyright their resprective owners