GDL - Harvest Moon

The easiest way to describe Harvest Moon is as a farming game. However, it's executed in a different way from regular sim" style games such as Sim City or Transport Tycoon. In Harvest Moon you taken on the role of the farmer in an almost RPG way, and you run around planting crops and doing most of the work yourself.

There is also more of a focus on story and relationships, and there is a town full of people that you can befriend, and several lucky people that you can marry.

It's a quite a simple concept in essence, but layers of extras are added on to create a strangely compelling game. So what game design lessons can we learn from it?

The Good Bits

Freedom

There is a huge amount of freedom in the game, much like the more traditional sim games. Very little of the game or story is forced onto you, which gives the player a lot more control over how they progress.

Players can earn money with crops, livestock, mining or even just rummaging in the mountains for fruit and mushrooms to sell. Some routes are easier than others, there's really no set way the game should be played.

The social aspects of the game are also optional, and you can choose to befriend everyone in town and get married or stay in your farm like a hermit.

Discovery

The freedom given to you also fosters a sense of discovery, as there are little stories hidden away in the game that you're free to discover at your own pace. There are a few cut-scenes to illustrate important events, but the majority of the story can be discovered entirely at the player's pace.

Simplified mechanics

Some sim games can dig a little too deep into micro-management, but Harvest Moon gets it just about right. You plant seeds, water them and then pick the crops to sell. There are no complex menus and dialogs about setting prices or managing transportation. This helps to keep the gameplay light enough to be enjoyed more casually.

Relationships

Being nice has an effect on the game, and can have rewards for the player. Some townsfolk may give you items, but some also open up new areas of the map.

A large example of this are the characters known as the "Harvest Sprites". There are seven of them in total, and if you're nice enough to them they will help out around your farm. You need to give them gifts in order to gain their friendship so that they'll help. You'll get bonus "friendship" points if you remember their birthday, and you can also wrap the gift for additional points.

The not so good bits

Limited customisation

In any RPG, it's beneficial to give the player a sense of ownership of the character. Very little about your farmer can be changed, and a few additions such as house decorating or changing clothes would have gone a long way to making the adventure seem more individual.

Notebook

I grew up with text adventures, when making maps and writing things down was part of the game. However, there's a lot more complexity in modern games and keeping track of everything can get quite difficult, especially in an RPG.

The game does keep track of all your recipes, and has a library with shipping prices and crop growth times, but there is still a lot of information left out. A "Smart" notebook that fills in facts as you go could be useful, especially as not everyone wants to fill a Moleskine with pages of notes about a farming game.

What can we learn?

Keep it simple

Always be on the lookout to simplify things. Instead of adding new, complex features, see what you can remove until you're left with the core elements of what makes you game fun.

This does depend on your target market though. For example, a flight simulator aimed at hardcore fans won't be popular if you simplify it to a few key presses. However, most games can do without some of the more complicated elements.

Keep it data driven

On a slightly more technical note, take advantage of data driven game techniques. There is a lot of content in Harvest Moon, with around 20 different crops and hundreds of recipes. Coding each of these into a class would be a nightmare, so always be on the lookout for ways to make your code more data driven.

Have faith in your players

There is often the temptation to railroad players into playing the game exactly as you want it. This can either be to avoid bugs cropping up, or it could be because you want the player to experience the game as you designed it.

If you've ever watched someone play a game you've created, you'll quickly find they'll do things in a different way than planned. This doesn't have to be a bad thing. Give your players some tools and an environment to play in, and watch what happens.

You don't have to make your game completely open-ended, but look for ways to let the game take care of itself instead of events being heavily scripted. An added side-effect to this is that it gives a lot more replay value, and it can also generate those "You've got to see this!" moments for players.


Harvest Moon at Amazon.com


Using zip files with Blitz Basic

Zip files are one of the most common compression formats around, and are a great way of storing files. Using the userlib functionality of BlitzPlus and Blitz3D, it's now possible to access and manipulate zip files from within your Blitz applications. This can be useful for packing your media, as well as compressing network data.

This article will show you the following:

  • What files you need to use zip files in Blitz, and how to install them.
  • How to open an archive file and find out what files it contains.
  • How to extract a file from an archive.
  • How to create a new zip file and add files to it.
  • How to compress and uncompress Blitz banks.

What will you need?

  • Blitz.ZipApi – A free library that you can include in your Blitz project. It comes with everything you need to use zip functionality within Blitz.

Installing the files

Once you've downloaded the library, you'll need to copy "zlibwapi.dll" and "zlibwapi.decls" to the appropriate "userlibs" folder so that you can use the userlib functions in your application. This will be something similar to "c:\program files\blitzplus\userlibs\". The userlib file is fully documented and has XML comments for use with Protean IDE.

You're now able to use simple zip functions, but if you'd like to get easier access to some of the more common functions, you should include the following into your project:

  • Blitz_File_ZipApi.bb – Helper functions for using zip files in Blitz.
  • Blitz_File_FileName.bb – A few functions for manipulating file names. Use them to get a directory name, file name and extensions from a string.
  • Blitz_Basic_Bank.bb – PeekString and PokeString functions.

All of these files are included in the Blitz.ZipApi distribution, along with full documentation in HTML format.

How it works

The zip library works in a similar fashion to the standard Blitz file functions. Before a file can be read from it should be opened with ZipApi_Open, and once finished with it should be closed with ZipApi_Close. Files to be written to should be opened with ZipApi_CreateZip and closed with ZipApi_CloseZip.

Fully documented examples are included with the library, and are also available online.

Reading the contents of a zip file

Example source code can be found here.

The zip library includes several functions for iterating through the files in an archive that has been opened with ZipApi_Open. To start with, we need to open an archive file and move the internal "pointer" to the first file in the zip:

; Open the zip file
Local zipIn = ZipApi_Open("myZip.zip")

; Move to the first file
ZipApi_GotoFirstFile(zipIn)

To move to the next file in the archive, call ZipApi_GotoNextFile. This will return the constant value ZIPAPI_UNZ_END_OF_LIST_OF_FILE if the end of the archive has been reached.

; Get the current file's information
Local fileInfo.ZIPAPI_UnzFileInfo = ZipApi_GetCurrentFileInfo(zipIn)

Calling ZipApi_GetCurrentFileInfo gets information about the file currently pointer at. This information is returned in as a type for ease of use. The following fields are the most useful:

  • FileName$ – The name of the file.
  • ExtraField$ – Extra field data that is sometimes added in an archive.
  • Comment$ – An optional comment about this file.
  • Crc32% – The CRC-32 value of the file. This is used to check the file has been unpacked properly.
  • CompressedSize% – The compressed size of the file (in bytes).
  • UnCompressedSize% – The Un-compressed size (in bytes).

Once you're finished with the object, call ZIPAPI_UnzFileInfo_Dispose with the ZIPAPI_UnzFileInfo object as a parameter. This is similar to using Blitz's "delete" function, except it takes care of freeing up bank handles and other internals.

Extracting a file from an archive

Example source code for extracting files can be found here.

Extracting a file from an open archive is quite simple. Simply call ZipApi_ExtractFile with the handle of the opened file and the name of the file to extract, and the rest is done for you. The function will return the full path to the file that was extracted, so can be used within LoadImage and similar functions.

Creating a new zip file

Example source for creating zip files can be found here.

Creating a new zip file is another standard operation. Like reading from a zip file, a file handle must be opened first. However, writing an archive requires a different function to open it.

; Open our new archive
Local zipOut    = ZipApi_CreateZip("my-test.zip")

Once the archive has been opened, adding files is a case of calling ZipApi_AddFile with an open zip handle and the name of the file you wish to compress.

; Add a file
Local zipOut    = ZipApi_AddFile(fileOut, "my-file.txt")

One useful feature is the ability to add a bank directly to a zip file. The ZipApi_AddBankAsFile function allows you to add a bank directly. This can be very useful if you're creating dynamic data you wish to compress, such as something downloaded directly from the internet or created in memory.

ZipApi_AddBankAsFile(zipOut, bankToAdd, "test-file.txt")

Once all files have been added, call ZipApi_CloseZip to close the archive. That's all there is to it!

Compressing a bank

Example source for compressing and uncompressing banks can be found here.

Compressing and uncompressing banks is very straightforward. Only two functions are required: ZipApi_Compress and ZipApi_UnCompress. Both of these functions take the handle of a blitz bank, and both return the handle to a new bank containing the packed/unpacked data.

You may wish to pack a bank for a number of reasons. It can be useful for sending data over a network, such as maps or character data.

Further reading

The full documentation for Blitz.ZipApi is available here, and contains a several examples and full explanations for all of the common functions in the library.


Getting Started with Subversion

Subversion is an open-source version control system. That doesn't sound particularly interesting, and at face value it isn't, but you only need it to save your skin once to realise how useful it can be.

Version control is a method of storing different revisions of the same file, usually source code or documents. This allows developers to see when changes to a file have been made, which can be useful for isolating bugs, and can also be used to "roll-back" a file to a time before a bug was introduced.

Along with these features, version control allows developers to merge two versions of a file, which is very useful for projects with more than one person.

This article covers the following:

  1. What software you need
  2. Creating a new repository
  3. How to set up a Subversion server
  4. Adding password protection to a Subversion repository
  5. Laying out your repository and importing files
  6. Checking out and checking in
  7. Using tags and branches

What you'll need

Subversion – The primary download is source code, but there are binary versions available for different operating systems, including Windows, Mac OS and most common flavours of Linux.

If you intend to use Subversion mostly from the command line, you might want to add the Subversion binaries directory to your Windows PATH variable.

Optional Downloads

tortoise-svn.png

TortoiseSVN – If you're using Subversion with Windows, I highly recommend installing TortoiseSVN. It integrates with the Windows explorer shell, so you can see an icon if a file has been changed. You can and also check in items, commit changes and perform other common operations with a few clicks of the mouse instead of using the command line.

Creating a Repository

You can think of a repository as a database where all the information about versioned files is stored. You can either create your repositories in lots of different folders, or select one folder and create all repositories within it. The second option is better if you want the same server to handle multiple projects.

Repositories can be created using the command line, or by using TortoiseSVN. The examples below show how to create "Repository4" in our example layout.

Example Layout

svn-repo-folders.png

Creating with the command line

svnadmin create c:\Repositories\Repository4

Creating with TortoiseSVN

  1. Use explorer to create a new folder in "C:\Repositories\" named "Repository4".
  2. Open this folder, and right click. Select "Create Repository Here" from the TortoiseSVN menu to create a repository.

Setting up a Subversion Server

Subversion is based on a client/server model, where the server takes care of storing versioned files and keeping logs of what has changed.

There are two ways to run a subversion server. The first is to install it as a module on an Apache 2 server. If you already run a local web-server, this might be the best option for you.

The second method is to use svnserve, which comes with the main Subversion package. It's a simple command line tool, and is useful if you're only a single developer or if you don't want Apache running. There are different ways to run svnserve too, but we'll concentrate on using it as a "daemon" process. In other words, once it's started it will run quietly in the background.

You'll need to specify the folder which contains your repository (or repositories), and specify a run mode. You can also supply an optional port number, instead of the default one (3690).

The following command will run a server that will serve our repositories, and will listen on port 85.

svnserve --daemon --listen-port 85 --root "c:\repositories\"

To check if it's working, open up a web browser and navigate to 127.0.0.1:85 (or 127.0.0.1:3690 if you didn't specify a port number). You should see something like the following in your browser:

( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline svndiff1 absent-entries ) ) ) 

If you don't wish to set up a local server, you can use a professional subversion hosting service, such as wush.net or CVSDude. They take care of all of the server-side stuff, so you can concentrate on more fun jobs.

Adding password protection

If you're intending to allow other people to access your repository, you may want to add password protection to stop unwanted guests. Thankfully this is quite easy if using svnserve, and it only takes a few steps.

  1. Open up your repository folder, such as "Repository1". You should see several files and folders, including a folder called "conf"
  2. Open the "conf" folder, open the file "svnserve.conf" in a text editor.
  3. Find the line "# password-db = passwd" and remove the # at the beginning. Save and close.
  4. Open up the "passwd" file in a text editor. This file will contain an unencrypted list of usernames and passwords. To add a new user, add the line "user = password" after [users].

Laying out your repository

Now that we have a repository set up and a server listening for our requests, it's time to add some files. There isn't a rigid format for Subversion repositories, but the recommended structure involves creating three folders: trunk, branches and tags.

  • Trunk – All of your files will go in this folder. It represents the main part of the project that is being worked on.
  • Branches – This is used to store alternative versions of the project for experimental purposes. For example, you can create a branch of your project to test a new map rendering component. Checking in files will go to the branch and not the trunk, so your work won't affect the main project. If the experiment works, you can then merge the branch with the main project.
  • Tags – Use tags for storing a copy of the source at a particular milestone. For example, you could create a tags for version 1.0, 1.1 etc. This is useful for keeping track of changes, as well as making backups in case a bug creeps in.

To set up your repository with these folders, perform the following:

  1. Create a new folder. For this example, we'll call it "c:\myproject".
  2. Inside this new folder, create three new folders. One called trunk, one called branches and one called tags.
  3. Optional step: Copy your project files into "trunk".

Once your folder scheme is set up, you're ready to import it into your repository. You can do this from the command line or using TortoiseSVN.

Command Line

svn import "c:\myproject" "svn://127.0.0.1/repository1"

If your repository is password protected, you'll need to add --password PASSWORD and --username USERNAME

TortoiseSVN

  1. Navigate into "c:\myproject".
  2. Right click and select "import".
  3. Enter "svn://127.0.0.1/Repostory1/" as the repository name.

Multiple projects in a single repository

Because a repository is really just a folder, you can store as many projects as you like inside it. How you lay it out is up to you. You may either use top level folders for each project, and have trunk, branches and tags folders inside or a main trunk, branches and tags folder with individual project folders.

There is no set structure, and it doesn't really matter as long as all developers involved know how the structure works.

Checking out and checking in

"Checking out" is often referred to as "creating a working copy". When you check files out of the repository, you create a copy of the files on your own machine. You can edit them freely without changing anything on the main server. When you've made the changes you wish and everything is working, you can check the files in, or "commit" them.

To check out via the command line, use something similar to:

svn checkout svn://127.0.0.1/Repository1/trunk/

This will check out the latest files from the trunk of Repository1. If you're using TortoiseSVN, right click and select "SVN Checkout" and enter the URL you wish to checkout from.

Checking-in is just as simple. To commit changes using the command line, navigate to the folder your working copy is stored in and enter:

svn commit --message "Why I made these changes"

The message is optional, but it's extremely useful to make a note of what was changed, and more importantly why it was changed. Nothing is more annoying than changing between two methods because you forgot why it was such a bad idea.

If you're using TortoiseSVN, right click and select "SVN Commit".

Using Tags and Branches

Tags are useful for creating a record of the source at a set release, such as version 1.0 of your project. A branch is used to create an offshoot of the project, such as testing a new algorithm.

Creating a tag using the command line

  1. Open a command line window and navigate to your working copy folder
  2. Enter something like "svn copy trunk tags/project-2.1.0" to create a tag called "project-2.1.0".

Creating a tag using TortoiseSVN

  1. Open your working copy folder
  2. Right click and select TortoiseSVN -> Branch/Tag
  3. Enter the URL of your new tag or branch. Typically this will be something like "svn://127.0.0.1/tags/project-2.1.0/" for a milestone.

Important Note: If you've created a branch, you'll need to create a working copy from it so that your changes will only affect the branch and not the trunk.

Further Reading

The Subversion book is available online at http://svnbook.red-bean.com/, and it contains just about everything you'll ever need to know. There are some very powerful features, such as setting up scripts to run before and after a commit (useful for parsing comments to see if it was a bug fix).

Hopefully this article has given you all you need to set-up and use Subversion in your daily development work. It may seem like a lot of effort at the start, but it's an incredibly useful skill to learn, and even if you only use it as an extra safety net, it's worth the time to set up.


Computer Love

Games can make us feel many different emotions. Fear, excitement and even sadness are common emotions in games, but what about love?

What is love?

Many people throughout time have attempted to describe what love is. Poets, philosophers and scientists have all had a go, but love remains a complex mystery.

If you're the romantic sort, love is the greatest thing ever. It makes the world a more beautiful place. Birds sing more clearly, flowers smell better and everything is wonderful. If you're not quite so romantic, love is just nature's way of getting two people together to mix DNA.

The fact that love is so difficult to describe makes it all the harder to convert into a gameplay element. To some, even the very notion of turning love into something trivial for a videogame is unthinkable.

For the purposes of this article, I'll be discussing two kinds of love. The first, and perhaps easiest to experience, is a caring, nurturing love. The second form is the romantic love that makes Valentine's Day so very expensive.

How do we create love in games?

To create a sense of love, you must give the player something to care about. Several factors make a person more likely to care about a fictional character on their screen.

Create a connection between the character and the player. Creating a common ground between the player and the character is a good place to start. You're much more likely to care if you see part of your own personality in the character.

Make the player feel important. You can foster a relationship between the player and the character by making the player feel as if what they're doing is important. For example, Tamagotchi's would get sick if they weren't properly cared for. Creating this sense of responsibility in the player makes their decisions seem important, and increases the chances that they'll care about their character.

Make the experience unique to the player. This is perhaps the biggest element into creating something special. Tamagotchi's were special to people because they weren't the same as someone else's. You become more protective of something if you believe it can't be recreated.

What about romance?

Romance is a completely different experience, and much, much harder to recreate. There are several barriers, both physical and moral. Is it right to make someone fall in love with a fictional character? Most players will be aware that "it's only a game", and won't succumb to anything more than lust for what's on screen.

A more realistic way of creating romantic love is to let the player take the role of a different character on screen, and have the romance play out between them. This approach is commonly taken in RPGs, but is often scripted and gives the player very little control over what is happening. This can create a sense of distance between the character and the player, and should be avoided if wishing to create something deeper.

The "S" word

Sex is quite popular, apparently. With adult books, DVDs, websites and more, it's only natural that games should get attention from the adult industry. The majority of sex games are overly salacious, and merely an excuse to put some porn in the form of a game. Even the Atari 2600 got some of the action (pardon the pun), with some truly awful sex games being released, such as the infamous Custer's Revenge.

With advances in artificial intelligence, and the proliferation of cyber sex in MMORPG's such as "Second Life", the future may see AI bots replacing pornographic games. It's quite plausible that such a bot may one day pass the Turing test, and fooling the player into believing they are interacting with a human may be the best way to improve the player's experience.

Conclusion

There is still a very long way to go, but using techniques from artificial life makes it easier to create a sense of love between a player and a character. It may never be the same as the love between two people, but perhaps that's for the best. However, at least you don't need to buy a computer dinner…


Creating Emotions with Music

Music can easily convey feelings and information that graphics and text can't or shouldn't. Appropriate music and sound, employed effectively, will make your island platformer more jaunty, your subarctic wasteland more desolate and your army of forty-legged robots incomparably evil.

Imagine the scene.

Your player has just hit the spider boss between the eyes with a well-aimed rocket. It screeches and falls from the ceiling of the tunnel, crashing in front of the player. The music falls from a thumping beat to a clear silence. The enemy stops twitching and stiffens. The player leaps over it and runs towards the exit, the new upgrade clearly in sight, the final key…

BOOM! A deep bass drum resonates.

You can almost hear the gulp from here.

skylights.jpg

Music's importance in mainstream games is now widely-recognised, but in terms of indie games it still seems to be an afterthought in some cases. Here's why that should change.

Make it enjoyable

Every aspect of your game should be carefully planned to ensure the player will find it appealing and enjoyable. If your music is repetitive or unsuitable, you can be sure they'll switch it off as soon as possible.

No matter what kind of game you're developing or playing, good music is highly important. Think of any genre and there's a classic game with a great tune attached:

sonic.png

bullet-announce.gif Puzzle - Tetris. Chances are you know it and like it.

bullet-announce.gif Platform - Sonic or Mario. Green Hill Zone and the Overworld theme are two of the most famous pieces of music for any game, widely recognised and admired.

bullet-announce.gif Racing - OutRun. I can say no more.

Good music will genuinely elevate the quality of your game if it's suitable, memorable and enjoyable. You work hard on making the rest of your game those things, so why not the music?

Don't waste chances

Unless you're developing for a system that includes rumble or force feedback, indie games only use two senses: sight and sound. Not maximising those senses is a waste, and severely limits the impact of your game.

Try playing your favourite game, indie or otherwise, with the music off. Does it feel different? I always feel much less interested in a game without music; there seems to be no mood, and I can hear my brain thinking "this isn't any good." It's okay, you can put the music back on now. Much better, isn't it?

"I can't do it!"

totakeke.gif

You don't have to. Hiring and collaborating with musicians over the Internet is easy; you send them artwork and they send you music. You send them money and they send you thanks. It's straightforward, the quality of music will be much higher and it leaves you with the other nine billion jobs to take care of.

The key to good music in games is…

Not to waste it. Use suitable music for the mood you want to achieve and your player will become much more involved and, as a result, enjoy themselves so much more. Seeing as that's your business, you owe it to everyone to put great music in your games.


James Newton is a writer and musician from York, England. He has written music for several independent films and documentaries, and has also created tracks for several games. You can listen to his work and read his thoughts on games and more at Prosody.co.uk.