Writing the Game

I bought myself a book in January: "Killer Game Programming in Java" by Andrew Davison, published by O'Reilly. It's been extremely useful and if you are interested in writing games in Java then I recommend buying it.

The Core Packages

Armed with this, I started the job of re-writing my current game from the ground up. I've split the game up into small, bite-sized chunks. The first of these remains two of my original packages: PdhData and PdhSprites. I've added to these with Pdh3d (almost none of the code in this is mine - I've copied it almost entirely from examples given in Killer Game Programming in Java).

Another addition is the package called PdhPlanet. This contains the functions necessary to model the physical planet itself. In good MVC tradition (Model-View-Controller, a programming approach commonly used in Java) I created a package called PdhPlanetView. To make sure this was all working I then created a package called PdhPlanetTest. This is available for download as version 0.1.001 of the game.

Adding People

An empty planet is pretty, well, pretty boring really. It's people that make things interesting. So, the next package up the line introduces human artifacts, and so I called it PdhArtifacts. This introduces a number of new classes and packages. The package PdhArrary2d holds a 2 dimension grid of data items, a useful helper class for holding information on settlements.

To view the new objects I needed to extend the PdhPlanetView package, so I created a package called PdhArtifactsView. Because one of the things we would like to look at is people, I create a class called PdhFigure. I feel another namecheck to Andrew Davison's Killer Game Programming in Java is required here, as the classes to code a this figure is lifted directly from his book. Did I mention that I bought it - it's really very good (and no, I'm not on commission!). I've changed the figure slightly to make it appear to be wearing a space suit, and next on my list is a way of animating it more smoothly, but I'm getting ahead of myself.

To see this all in action I created a PdhArtifactTest package as a runnable application. You can download this as version 0.1.002 of the game.

Lights, Camera, Action!

We've got the basic components in place, now we need to make things happen. This is the next package: PdhActivePlanet. This will contain the classes on what happens in the game, the activities people carry out, what they do and what they find out. The associated view package, which I'm currently working on now, contains the classes for viewing these activities. This is where the figure animation happens.

Talk to Me

The final package will cover the interactive elements of the game: how a player will interact with the characters as well as how the characters will interact with each other. The designing the conversation model has been a challenge which I hope I can rise to: I believe it's crucial to the game. The game is based on a scenario in which a few individuals have to spend a long period of time together. The interperson dynamics are very important, and if relationships break down then the success of the mission could be in jeapordy.

At the moment though, this is a problem for the future.

Patrick Haston
7 February 2008 (updated 11 February 2008)