بسم الله الرحمن الرحيم

November 16, 2010

French touch

On three French web sites I discovered three different designs for pasang board.

2 Tours de Jeu, a site documenting rules for strategy games, exhibits a simple makeshift pasang board. The pieces are placed inside squares (just like checkers and chess), a departure from the conventional placement on grid intersections. This is not really unusual; an early non-libre version of Pasang Emas included a theme which departed similarly from the convention. What is really unusual is the set of rules for the game. It is totally different from what Pasang Emas implements. This unusual version of pasang is described by R C Bell in his book "Discovering Old Board Games".

Some people dispute the accuracy of Bell's account. But I do not currently wish to go into that debate. I wouldn't be surprised either way.

Association pour Vivre l'AutoGestion, a social club for family entertainment, has this catalogue of rental games. Page 25 of this catalogue shows an ornamented pasang board. You have got to see it to believe it. The French are adding a dash of their own art to the Brunei game. That's truly multi-cultural.

Geoludie has an online catalogue of world games for sale. It includes what appears to be a modern looking pasang board with small plastic marbles as pieces (unless my discernment has failed me and those are actually computer generated). Geoludie's pasang has 2 sets of rules: the one described by Bell and the one implemented by Pasang Emas. (Geoludie actually contacted me in 2006 regarding the irreconcilable differences between the two versions. So, they are in business of selling pasang for a long time already). The unusual use of marbles (placed presumably inside shallow cups on the board) is based on Bell's description of the game. Having played Chinese checkers using marbles on a holey board, I can attest the practicality of that design.

17 March 2018: Edited to replace broken links with Wayback Machine

November 11, 2010

Game complexity

I instrumented Pasang Emas to collect statistics on its games. I set the demo mode to play weak against weak, weak against strong, and strong against strong. The following results were gathered from observing more than 3,000 games and more than 170,000 board positions. The results are not sensitive to the strength of the players.


Branching factors

In the opening stage, exactly 11 possible moves are available for the first player and 10 for the second.

In the kas selection stage, an average of 31 possible moves are available. The number will be less if we "merge" different moves that result in identical situations. Theoretically, the maximum branching factor during this stage is 50. This was indeed witnessed during the experiment.

In the rest of the game, a player has an average of 6 possible moves to choose from at each turn. This is very much less than the theoretical maximum of 40. Indeed, the maximum seen during the experiment was only 26.

Overall, the average branching factor is 7.


Game length

Since there are 118 pieces to capture, and each move is a capture move, the game obviously cannot exceed 118 plies. The longest game seen was 94 plies.

On average, a game takes 56 plies.


Complexity

The mode (12%) of the branching factors is 5. So, we can estimate the size of the game tree (ignoring the "zeroth" move, that of choosing a pattern to start the game) as 556, which is approximately 1039.

If we use the mean value 7 for the branching factor, the estimated tree size is 756, or approximately 2 x 1047.

A better estimate is to use the distribution of the branching factors. Here is a breakdown:

   branches   frequency
  1  3%
  2  7%
  3  9%
  4  11%
  5  12%
  6  11%
  7  10%
  8  8%
  9  6%
  10  6%
  11  5%
  12  2%
  13  1%
  14  1%
  15 or more  8%

The above distribution is used in the following Ruby code to estimate the tree size:

    f = [3, 7, 9, 11, 12, 11, 10, 8, 6, 6, 5, 2, 1, 1, 8]
    s = 1
    f.each_with_index { |n, i| s = s * (i+1) ** (n/100.0 * 56) }
    puts s

The above code gives an estimated game tree size of 6 x 1042. (Using a more accurate breakdown from the raw data does not significantly change the result).


Average capture

Since there are 118 pieces to capture and the average game length is 56 plies, the average number of pieces captured by a move might be mistakenly taken as 118/56 = 2.1. But this is not the case. About 50% of the games observed during the experiment ended up in suntuk. The average number of pieces captured per move was only 1.9.

August 11, 2010

Pasang Emas won awards

Pasang Emas won the following BICTA 2010 awards:
  • third place in the "industry" category, and
  • the Made-in-Brunei Award.
Media coverage:

July 31, 2010

Official boost for Pasang Emas

The Authority for Info-communication Technology Industry of Brunei Darussalam (AITI) hosted a ceremony to hand over copies of Pasang Emas to the Ministry of Education.

Media coverage of the ceremony:
Our photographer was unusually negligent during the ceremony. After the ceremony, we had this photo taken of the three people who made Pasang Emas a reality: the initiator, the developer and the mentor.

July 27, 2010

Lilliputians play pasang too!

"Majlis Ilmu" is an annual event to commemorate the birthday of His Majesty the Sultan of Brunei.


This year, pasang was featured rather prominently in the exhibition gallery of Majlis Ilmu. Three different renditions of the game were exhibited. There were the usual,


the giant,


and the electronic.


There was also a luxurious board, placed high on an exhibition rack, away from naughty hands that might tarnish its beauty.


Another traditional game, congkak, was also exhibited.


On a pasang board, there is usually a square cup in the middle called "gadong".


The "gadong" is not really significant to the game. It is used to keep pieces, or, if you make it large, to restrain playful kids!


After successfully testing that unorthodox feature, the kids were released unharmed. By then they were subdued enough to give a good demonstration of the game.


 They were playing against a pair of formidable opponents.


Visitors witnessed a fierce battle. Capture! Capture! No mercy!


After the throng of visitors subsided, two key people in the development of Pasang Emas posed in front of their baby.


And the four fighting kids were friends again.

July 8, 2010

Network play

Pasang Emas version 3.0.0 comes with a new feature. It is now possible to play against your friends across the network. Here is a screen shot of the network dialog:


The game server was running in the same computer from which I took the screen shot, thus the name "localhost" for the server. The server currently does not perform authentication, thus the missing entry box for password.

Five other players were already logged in. The three players with status "Waiting" were really netcat session. I used netcat to debug the game protocol and preserve my sanity. The two players with status "Playing" were actual Pasang Emas sessions running on separate computers in a lab.

May 24, 2010

How it really looks like

A primary school teacher posted this blog entry containing many pictures showing pasang boards the way they are traditionally made. Notice the "cup" in the middle of each board. This cup, called "gadong", plays no part in the game. The first player is supposed to accumulate her bounties in there, while the second player puts hers on the table. The game is in no way affected if this purely ornamental rule is not observed. In fact this cup actually blocks from view pieces near the centre.

When I learnt pasang, my mentor lent me a set with wooden pieces. I think that's the way they were traditionally made. But the bulky wooden pieces, which must have been a hassle to make, gave way to the more convenient and cute coat buttons, conveniently available at the nearest supermarket at a very affordable price. Two themes in an early version of Pasang Emas parodied this button-using trend. Notice in some of the pictures the use of red and bluish buttons for the kas. Red and blue combination is a convention introduced by Pasang Emas.

Jabatan Muzium-Muzium (Department of Museums) published reference cards showing traditional opening arrangements. You can see these cards in some of the pictures.

A secondary school posted this blog entry showing pictures of students learning pasang. Here again we can see the unmistakable traditional board dotted with tailor buttons. The man with the white cap must be the instructor. Indeed he must be. He is my pasang mentor.

May 17, 2010

Create your own opening patterns

Pasang Emas version 2.1.0 has a new feature. It is now possible for players to create their own opening patterns. Clicking the menu item [Game | Custom Patterns] opens up the pattern editor.


The editor is so simple that I didn't bother to write a user guide for it. You may create as many patterns as you wish. Each pattern must consists of exactly 60 white pieces. To use the patterns simply click [Apply].

The screen shot below shows a game opening using a custom-made pattern.


Here are some patterns that I composed:


All of them, except the last two, have symmetrical 6x6 (overlapping) tiles. Some are "pairs" that use the same tiles but arranged differently. The first pattern also has a night-and-day symmetry where the pattern and the background form the same shape.

May 10, 2010

Random patterns

Pasang Emas comes with 6 buttons to generate random patterns. The pattern generator behind these buttons is programmed to produce patterns with the same kinds of symmetries found in the traditional patterns, except for finer symmetries within 6x6 quadrants, though such symmetries may arise purely by chance. The generator is also programmed to produce other kinds of symmetries not found in the traditional patterns.

A technique employed by the generator that works rather well in composing pleasing patterns is to intentionally break an otherwise highly symmetrical arrangement.

The following are samples created by the pattern generator. Some are worthy rivals of the traditional patterns.


Square symmetry

The first pattern generator button is configured to produce patterns with 4 mirror axes, as shown in these samples:


The patterns in the first 2 rows have quadrants with 4 mirror axes. The ones in the first row are night-and-day arrangements where the pattern and its background form the same shape. The third row shows patterns having quadrants that are diagonally symmetrical. The fourth row shows patterns that almost belong to the first 2 rows, but their symmetries are broken in the centre. The last row lacks finer symmetries.


Night-and-day symmetry

The second button produces night-and-day patterns with a 4-fold symmetry. Here are some samples:



4-fold symmetry

The third button issues patterns with a 4-fold symmetry, such as these:


The first row shows patterns with quadrants having their own symmetries. The second row shows patterns that almost have mirror symmetries, but are broken.


Horizontal and vertical symmetry

None of the traditional patterns currently known to Pasang Emas have only horizontal and vertical mirror axes. The fourth button fills this gap, creating patterns such as these:


The patterns in the top row have symmetrical quadrants or symmetrical halves. The patterns in the middle row are almost diagonally symmetrical.


Diagonal symmetry

The fifth button composes diagonally symmetrical patterns, such as these:


In the first row, quadrants are translational images of each other. The second row shows patterns with broken horizontal and vertical symmetries.


2-fold symmetry

The sixth button produces 2-fold symmetrical patterns. A 2-fold symmetry is the least symmetrical arrangement that still fairly divides the playing pieces between the top and bottom halves of the board. Here are some samples:


The patterns in the top row have symmetrical quadrants or symmetrical halves. The second row exhibits patterns that almost have further symmetries.

May 2, 2010

Symmetries in traditional patterns

There are more than 30 traditional patterns to start a pasang game. All of them exhibit some forms of symmetry.

Perfect symmetry

The following pattern is the most symmetrical. In traditional embroidery, it is used for dithering.

Square symmetry

Most traditional patterns have mirror symmetries with 4 axes, such as these:


Among such patterns, some have finer symmetries in their quadrants. The following have diagonal symmetries in their 5x5 quadrants. The last one also has vertical and horizontal symmetries in its quadrants.


The following pattern is rather unique. Apart from the perfectly symmetrical dithering pattern, it is the only traditional pattern having 6x6 (overlapping) quadrants that are diagonally symmetrical.


4-fold symmetry

Some patterns have 4-fold (90-degree rotational) symmetry, such as these:


A few of such have almost mirror symmetries, but they are broken in the centre.


Diagonal symmetry

One particular pattern has only mirror symmetries diagonally.


Night-and-day symmetry

Two patterns have night-and-day symmetry where the pattern and the background form the same shape of different handedness.


Building unit

A few patterns are made up of units larger than "dots". In particular, the following patterns are made up of, respectively, v's, w's and pluses.

April 26, 2010

Unleash your computer graphics talent

If you are a student looking for a small project for your Computer Graphics course, or just someone with an artistic bent looking for new venues to unleash your creative talent, I suggest you try creating new themes for Pasang Emas. The level of challenge is somewhere between designing static icons and short animations.

Pasang Emas comes with a theme named Wooden that you can use as a guide. Simply select this theme and click its path link (highlighted in the figure below). This will let you browse the directory that defines this theme.


The creative part of a theme goes into these five graphics files:
  • board.png / board.svg
  • red.png / red.svg
  • blue.png / blue.svg
  • black.png / black.svg
  • white.png / white.svg
For example, red.png of Wooden looks like this:
to define a 20-frame animation sequence.

You can also specify the following optional text files:
  • theme.prop
  • a license file
The file "theme.prop" defines several optional parameters and allows theme artists to give themselves credit and specify a license for the use of their creation. The license can be elaborated in a separate file, if necessary.

The file "theme.prop" in Wooden contains further documentation to guide theme artists.

If you have any cool theme to share, you may announce it in the comment section of this blog entry. If I like your theme, and the license permits it, I may feature it in Pasang Emas project page.

April 12, 2010

Air muleh: a traditional border decoration

Several Pasang Emas themes feature a Brunei traditional decoration called air muleh. It is a frieze pattern (group 2) formed using a sinusoidal backbone with tendrils curving back.

Here is an example:



Here is another example from the non-free version of Pasang Emas:


This version of air muleh adorns the mihrab and minbar of the mosque of Universiti Brunei Darussalam. It is also widely used to decorate university publications such as ceremony programme booklets.

It features simpur (or simpor) leaves and flowers, a kind of wild tree found in the jungle of Brunei. The leaves of the simpur tree are used to wrap food such as tapai (that's green packaging for you, no plastic waste). The simpur flower, though not prominent in this air muleh, is the national flower of Brunei.

Simpur is not the only plant used as a theme for air muleh. The logo of Brunei History Centre uses an air muleh border that prominently features keramunting flowers. Keramunting is a kind of wild berry, with red yummy flesh.

15 March 2018: Edited to fix broken link to Brunei History Centre.

April 3, 2010

It runs on Mac

The development version of Pasang Emas has been successfully compiled on Mac, thanks to MacPort. However "Help" didn't work because of an "Operation not supported" error. I have to install something to make "Help" operational. But, even without this feature, the game is fully playable.

Here is the obligatory screen shot:


Other non-essential features that failed to work:
  • localization: the translation files could not be located;
  • hyperlink: no file browser was registered to handle links to directories.

March 24, 2010

The birth of Pasang Emas

Pasang?

That's a typical answer you would get if you ask somebody about the pasang game, even in Brunei from whence the game originated. The accompanying deep frown would make a good background texture for web pages.

That was my answer in year 2000 when a former student suggested to me to write a computer program to play pasang. If he brought his camera with him, he could have a nice looking wrinkly background texture for his blog.

I accepted his suggestion. Unfortunately, his exposition on pasang, scrambled on a cafeteria napkin, was too sketchy. Fortunately there was a library book on pasang. Unfortunately, the book was rather vague and inconsistent. Fortunately, I knew someone who turned out to be a veteran player. I learnt pasang under his guidance and finally produced a working program.

The first version was playable, but looked unappealing. The user interface was in Malay tinged a bit with Brunei dialect. Here is a screen shot:


An eyesore! An insult! Having these two additional themes didn't save the day:


But that last theme... ignore its ugliness... doesn't it tickle your artistic fancy? The playing arena doesn't have to be a conventional board strewn with tangible pieces. It can be a field with rubbish to be collected, or a galaxy with planets to be explored, or a gloomy night scene with haunted houses to be exorcised, or (for the sadistic players) a savannah with wandering animals to be hunted. No... cancel that last one. Rest assured, I won't create or distribute any grotesque theme.

Not that it matters much for the first version. Themes were hard-wired to the program code. There was no easy way for even the geekiest user to modify or add themes. It was like having a TV with fixed channels (search your attic, may be you have one).

This first version had a very limited circulation. It had a brief public exposure in Inforama 2001 (Inforama is an annual national competition) when a team of students kindly put it into showcase in their booth. The number of wrinkled faces they witnessed passing their booth must have been a world record.

Computer programmers understand that the first version of a program is meant to be thrown away (and I'm not making this up as an excuse for my own sloppy first version). This I did. In its place was a much improved version. Like an organic being, Pasang Emas grew.