Pagini

Wednesday, September 26, 2012

RIP Sven Hassel

It is with a deep sorrow and a void in our hearts that we inform you of Sven Hassel’s passing, this Friday September 21st, at 95 years of age. Sven’s health had been deteriorating rapidly, especially in the last few days, and although he fought bravely till the end, his heart finally gave away. It lightens our grief to know that he is now finally at rest and reunited with his beloved wife.

svenhassel.net

Loved his books when I was young.

Monday, September 17, 2012

The Map Editor - Part I

Panzer Division Map Editor 1

I'm working on the Map Editor for the Panzer Division for a while now. It's not done yet but I decided to share some of the experience, maybe somebody will find it useful or maybe somebody will spot something horribly wrong and let me know.

To understand some of the decisions we took is important to know that:

  • Panzer Division is made with HTML5, CSS3 and JavaScript.
  • Panzer Division is supposed to run even on the first iPad (where we are facing tough constraints especially related to the maximum canvas memory.)
  • Panzer Division maps have pointy hexagonal tiles.

Intro

In Panzer Divizion the first thing you'll have to do is to choose what to play: a campaign or a scenario.

  • A campaign has an associated set of scenarios.
  • A scenario has an associated map.

Before we can create campaigns, we need to have scenarios. And in order to create scenarios we need maps. (Actually with one map we can create multiple scenarios, and those scenarios can be used to create campaigns.)

To create maps we need a Map Editor.
To create scenarios we need a Scenario Editor.
To create campaigns we need - what a surprise - a Campaign Editor.

The maps, scenarios and campaigns are kept on disk in some format like JSON. When the user chooses a scenario, the corresponding scenario file and map file are loaded from disk.

All the three editors have to:

  1. read and parse the file and generate data structures to be used by the game.
  2. allow the user to modify the data.
  3. save the data back to the file.

For the moment we work on the map editor, the others are to be done later. Panzer Division Map Editor 2

The Map Files

The purpose of the Map Editor is to read, modify and save map files.

A map file contains the following information:

  1. map size - number of rows and columns.
  2. tile data for each of the tile - indicates how a specific tile must be rendered (e.g as sea, forest, shore, etc).

Map file example:

"numberOfColumns":30,
"numberOfRows":20,
"tiles": [
 [0,0,0,0,0,0,0,0,0,0,5,11,11,11,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,0,0,0,0,0,0,0,10,106,106,106,106,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,0,0,0,0,0,0,10,193,176,169,159,23,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,0,0,5,11,6,5,16,188,217,178,178,172,106,1,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [5,6,0,5,16,33,106,22,106,193,218,238,178,156,106,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,106,17,16,106,106,64,106,106,188,189,208,207,196,24,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,175,158,114,110,133,100,133,117,192,199,106,191,106,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [9,155,178,165,106,130,106,64,106,106,106,106,106,24,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [9,161,160,106,145,117,106,63,106,13,14,106,106,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,9,106,128,119,106,163,60,106,18,0,3,8,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,9,113,106,106,157,174,31,106,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,3,14,106,157,178,179,165,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,15,162,178,167,160,106,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,4,106,20,160,13,14,106,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,3,2,3,2,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 
 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ]

The tile information must also be used by the game logic to influence the unit movement (e.g rivers or swamps reduce it) or to prevent movement (e.g battleships cannot go over forests) so is important to spend a while to think about various ways to do it.

We also need a tile set image - a big image that contains all the terrain tiles. We now have a big problem: the tile set image can be very different based on the choises we make so we need to spend as little time as possible on making that tile set for the moment. My advice is to use obvious colors and big brushes to create a rude version of the tile set. I lost lots of time trying to create nice, detailed tiles only to throw them away later because I realised I need a different tile set.

Defining hexes

The map is composed of pointy hexagonal tiles. Each hex has 6 corners and 6 sides.

 S6  /\  S1
 S5 |  | S2
 S4  \/  S3

We can use either to describe the tile, for example we could use 1 for the side that matches forest and 0 for the side that is not forest.

Since there are 6 sides/corners, so we have 64 possible combinations for each type of tile, the sides index is: 000000-111111 (00-63)

The side 1 is the last significant digit, side 6 the most significant digit, like this:

S6 S5 S4 S3 S2 S1
1  1  0  1  1  0 

Panzer Division Map Editor 3

The many facets of the terrain

There are forests, mountains, rivers, shore, etc. How can we encode more than one terrain type in one tile data? That will be discussed in another post.

Wednesday, August 15, 2012

Mircea, a three masted barque


I was in a well deserved vacation the other days.

One day I had the surprise to see a ship on the horizont. It was the Bricul Mircea, one of the most beautiful ships still in service.

During the WWII the ship stayed hidden near Braila and after the war was "taken" by the soviets. Only after repeated interventions was returned to Romania.

Monday, July 16, 2012

Pointy hex grid




Our initial approach when we started developing The Panzer Division was to use the Panzer General I look. That meant that units were 2D icons, facing either left or right.


The original Panzer General look


Panzer General II came with a better approach, displaying the battlefield from an oblique angle, and the units had a 3D look. Of course, the game was not really 3D, but it looked better anyway.


The second Panzer General game looked better with pseudo-3D units and terrain

The units could rotate to twelve different directions, six of them facing the hex sides and the other six pointing toward the hex corners.

Back when we started developing our game, we used the original Panzer General artwork . This has helped us a lot, not having to bother with a map editor and such. But after we implemented a great deal of the game mechanics, we said it's time to create our own artwork.

I started designing the units graphics, and I used a great tool for this: Blender. It's a free 3D modeler and in the past few years it has improved a lot, especially in the user interface area.

I began modeling some panzers and rendered them into 2D images from the sides. I managed to get them to look like the original PG units. But as long as we have the units modeled in 3D, it is a breeze to render them from an oblique angle and facing different directions, as they are in PG2. So we decided to take that route, and use a pseudo-3D look for our game.

The Panzer General games use a hex grid, which is obvious by looking at the screenshots above. But the hexes are aligned in vertical columns, the hexagons lying on their side. That means that the directions facing the hex sides include pointing up and down, but in our opinion, a unit facing north or south doesn't look so good.
Units facing north or south (up/down) do not look so good


So, we changed the way the hex grid is oriented and make it have the corners pointing up and down, as you can see in the image below.

With a 'pointy' hex grid, units are never facing up or down

This way, the units would never be displayed from front or back, making it easier to recognize the differences between various units of the same type.

Tuesday, July 10, 2012

Best Anti-Tank Gun of WWII: the German 88


© S H Photos

While the best tank of the war is controversial, I think we can find more agreement on the best anti tank gun of the WWII: the 88mm Flak.

Originally used as anti aircraft gun, the 88mm Flak became famous when used as a anti-tank weapon.

Here is an example about its efficiency. The Real Reason for the 88’s Success:

During Operation Battleaxe from 15th to 18th June 1941 the Commonwealth forces are known to have lost 92 AFVs including 82 tanks to the I./Flak-Regiment 33, a Luftwaffe mixed flak battalion with 12 88s.(7) The only other heavy flak battalion available to Rommel through 1941 was the identical I./Flak-Regiment 18. By the end of 1941 these two Luftwaffe flak battalions (authorised a total of 24 88s) had destroyed 264 tanks and 42 aircraft.(8) During this period the Allied forces had over three times as many 3.7inch AA guns available as the Axis forces had 88s, yet the German and Italian tank crews probably never even got to see one.(9)

Saturday, June 23, 2012

Game Music


© @Doug88888

When you develop a game there are so many little details that set you back. One of these details is the music for the game. It can be unbelievable hard to find the best fit for the game. Especially when you have no idea what you should do.

Since Panzer Division is a WW2 game, a historical game, my first choice would be a epic background music, maybe something symphonic. But you know what? I might be wrong.

One of the best game music I ever heard is the one created for Machinarium. The game, which features the adventures of a robot in a town full of robots, has a great jazz soundtrack. Who would pick that? When you think future, robots, technology, computers what music you think would fit? Maybe electronic, maybe psychedelic, but jazz?

We have two options:

  1. Find some music online. There are some nice sources - but we might choose something that others might also choose.
  2. Find somebody to create the music for us. I have two musicians who might compose the music - thus creating something unique - but I'm afraid they will not create what I need.

We'll have to think some more.

UPDATE: Mr. FunkyLand has some nice proposals, check them out:

Thursday, June 7, 2012

Panzerlied

Who knew there was a song for the Panzers?
The song starts at 1:30, but the rest of the movie provides a nice context. I was curios what is says, so here are the lyrics in case you are curios too:
In blizzard or storm,
Or in sun warm and bright,
The day hot as hell
Or bone-chilling be the night,
Our faces may with dust be laid,
But spirits never fade,
No, never fade;
Relentless, our tank
Thunders out on a raid.

With engines a-howling,
Fast as is the wind,
We head for the foe,
Safe, as we're in armor skinned.
Our comrades still behind us roam;
We fight the foe alone,
Yes, fight alone.
We stab through the line
To break the foes backbone.

Whenever the foe
May appear in our sight,
We'll ram throttle full,
Then we'll humble all his might!
Of what use is our life if we
Our country serve freely?
Yes, serve freely!
To die for our country,
Our honour shall be.

With tank traps and mines,
Our foe tries to impede.
We laugh at his ruses;
We know he'll not suceed.
And when, in threat, his cannons stand,
Half hidden in the sand,
Yes, in the sand,
We can find our way
Over much safer land.

And should at long last,
Fickle Lady Luck leave,
And we remain here,
Leaving family to grieve,
A bullet with our name on it,
Find us and seal our fate,
Yes, seal our fate,
Our tank will our grave be
On that final date.