Archive for August, 2008

Forests and Phases

August 17, 2008

Last week I wrote about having different game phases. I realize now that “phase” was not the right word; What I meant was really “state”. The game does not have any phases in the right sense of the word. It has state, though–like every game–such as whose turn it is and whether the user is in the process of moving a unit. That part works pretty well now. Tanks can only be moved once per turn and only by their owners. The troops available for deployment can be restricted to arbitrary sets of troops and the interface is easy to use. You just click where you want to deploy a unit and if allowed it appears there and disappears from the troop deployment panel at the bottom. You can undo deployment decisions by clicking at the tank you want to move back into the undeployed set.

What’s missing now is the ability to end turns. There’s no button for it, so you have to evaluate a Scheme statement to end your turn =)

I have also been sketching on more types of terrain (forests and cities). I’m far from satisfied, but it’s a start. See the screenshot.

Other news is that Cairo is a bit slow and I have started thinking about learning OpenGL instead. The root causes are that Cairo’s rendering quality is too high (antialiasing is not necessary when zooming, for instance) and that it doesn’t use hardware acceleration.

The decision to use Scheme seems to have been an excellent one. With SWIG and Tinyclos I have complete control over the scene graph even from interpreted code, and I haven’t had any performance problems at all so far from Chicken.

Where the Game is Heading

August 16, 2008

As I wrote in my first post, the game takes a lot of inspiration from Panzer General. For those of you who have missed this classic, that means we are talking about a turn-based strategic war game set in Europe during World War Two.

In Panzer General, your task it is to complete some given mission in the allotted time frame. You control the divisions (or whatever the troop units represent) but are not allowed to make decisions about which country should be invaded or not.

My first goal is to have something very similar to Panzer General, only with vector graphics. It will probably have a lot fewer equipment types initially than Panzer General had, since I guess it will take some effort to research the military history of all involved nations =)

When that goal has been reached I want to update it to take advantage of the technological advancements that have been made since then–I want it to be networked and multi-player; I want huge maps. And I don’t want to play a mere general–I want to be the supreme commander, to make all strategic decisions.

I imagine players logging in to a server and setting up game parameters, such as the number of turns and how many turns you can play in a day. Then they wait for others to join and play for weeks or hours, depending on how the parameters were set. Computer opponents are always there if you cannot find human opponents.

Well, that’s my vision. It may change down the road.

And by the way, I plan to make it a commercial game. If the guy running Sillysoft can support himself selling what appears to be spiced-up versions of RISK, then a spiced-up version of Panzer General should be able to generate some cash too.

Troop Deployment Phase

August 10, 2008

I have started work on having more than one game phase. You can’t even end your turn now. What I’ve been working on this weekend, though, is the troop deployment phase. Before the first turn, each player should be presented with a set of troop units and a set of places on the map where he can deploy them.

In this screenshot, the player has deployed one tank already and has four more tanks to place, shown at the bottom of the window. He can only place them in the highlighted area in the middle.

(to anyone about to tell me that I should use brighter colors: this screenshot shows a state where 90% of the screen is grayed out. Most of the map is supposed to look dull here, to make the highlighed area stand out more.)

The scenario I imagine is that Denmark has surrendered and Germany uses them as a springboard for an attack on Sweden. That is why the troop deployment area is near the Danish coast.

To make this work properly I have to do some work on automatic layout of buttons and the mapping from mouse clicks to scene graph nodes, and give the Scheme code more fine-grained control over the scene graph.

Attacking implemented

August 3, 2008

Tanks now have owners and it is possible to attack the opponent’s tanks. The loss calculation algorithm is very simple, but good enough for now.

I have also drawn another tank, which is supposed to look like the Swedish m/40.

In the screenshot, a group of German tanks are trying to make their way east to the Swedish naval base at Karlskrona, but their path is blocked by a lone Swedish tank using the lakes for protection.

I gave the Swedish tank a slightly different color to make it easier to tell friend from foe.