Showing posts with label Games. Show all posts
Showing posts with label Games. Show all posts

Saturday, November 24, 2012

Defence versus Attack

In several games, in particular RPGs, defence is quite boring when compared to attack. I tend to skip defensive skills or traits, unless death is penalized in gameplay.

Imagine two characters, one who specializes in defence, and the other attack. If properly balanced, we expect both characters to be equally successful in combat. Yet, most probably the attack specialist preferred by far. Why? Because killing the enemy is more enjoyable than surviving the enemy. This is particularly true if combat is repetitive, or if it is necessary to fight some trash mobs. Defensive skills simply extend the length of combat.

Wednesday, December 08, 2010

Google AI Challenge

For the past month or so I've been participating in the Google AI Challenge. The contest itself is quite interesting; you're supposed to write an AI to play a game similar to Galcon, and your bot will be pitted against other bots.

Now, the game is not quite as abstract, because what you're doing is moving ships around and attacking or defending; you can sort of explain or rationalize each move, or imagine some flavor or dramatic backstory to it. I find this to be good because you can actually do pretty well with heuristics or relatively simple decision rules.

Let me spend some time crowing about my bot, which I think did pretty well (446/4617 entries, or 90th percentile). To be honest, it's not all that elegant, being cobbled together from many generations of bots. The core algorithm is simple to describe: For each turn, each planet sends all (all!) its ships to attack a suitable target, which is determined by its distance, growth rate, owner, and number of defenders. There's also a simple defence algorithm in place to assist planets that are under siege, and a routine to expand optimally during the first turn. Surprisingly it did quite well, though I don't forsee it evolving further due to its limiting framework.

You can review some of the final matches at the bot's history page. Just click on "View Game" to view a game.

Wednesday, May 26, 2010

Auction Game

I am keen on running a game that has some elements of game theory. The particulars of the game are described below.

The game is an auction game, where each player aims to end up with the most amount of money. The items to be auctioned are bundles of money. As with typical auctions, the highest bid win the auctioned bundle of money. However, there are two important differences. Firstly, the auction system is sealed-bid, meaning that each person places his bid in secret. Secondly, the auction is all-pay, meaning that everyone pays the amount they bid, regardless of whether they won anything. Hence, the auction is an all-pay sealed-bid first-price auction.

Thus, the rules are:

1) Each player starts with the same amount of money, S dollars.
2) The X bundles of money, and their denominations, are announced in advance.
3) Each player may place, secretly, up to one bid per bundle of money, so long as the sum of his bids is equal to or less than S. Each bid must be a positive integer.
4) Everyone pays an amount of money equal to amount they bid.
5) After each player has placed his bids, for each bundle of money, the person(s) with the highest bid(s) share the bundle of money equally.
6) Any remaining unclaimed bundles of money are forfeited.
7) The final score of each player is equal to the total amount of money he has; i.e., the sum of money won and money not spent during bidding.
8) The final score is used to rank the players in the game.
9) No communications are allowed between players before or during bidding.

An exception to rule 9 is that before the bidding begins, each player may issue at most one public statement, viewable to all players. The public statements are displayed on a first-post-first-displayed basis.

10) At any point before the bidding phase, each player is allowed to make at most one public statement which is viewable by all players. The public statement will be displayed immediately.

A trial run of the game is provided below.

Preparation Phase:

There are three players, A, B, and C competing. They have $10 each.

There are 4 items being auctioned. The items are:
#1: $3 note.
#2: $5 note.
#3: $5 note.
#4: $12 note.

Before the bidding begins, it is possible to make public statements. C makes a first public statement, “Hello, I love money.” Everyone is notified of C’s statement.

A also wishes to make a public statement, “I will not make any bids.” Everyone is notified of A’s statement.

B forfeits his right to make statements as he does not wish to make any statements.

Bidding Phase:

The bidding phase begins. Each player independently and secretly makes their bids for the items.

A bids $2 for item #2, $2 for item #3, and $6 for item #4.

B bids $10 for item #4.

C bids $2 for items #1, #2, #3 and #4.

After each player has submitted his bids, the bidding phase ends. Each player pays for his bids. A pays $10 for his bids, and he has $0 left over. B pays $10 for his bid, and he has $0 left over. C pays $8 for his bids, and he has $2 left over.

Settlement Phase:

It is time to settle the auctions, and compute the final scores. Item #1 is won by player C. Item #2 is won and shared by players A and C. Item #3 is won and shared between players A and C. Item #4 is won by player B.

Player A has $5 in the end.

Player B has $12 in the end.

Player C has $10 in the end.

Player B has the most money, and wins.

If there are any willing participants to try this game, please contact me by some means. I will post more details if/when there is sufficient interest.

Monday, January 11, 2010

Chinese Blackjack (Ban-luck)

Chinese Blackjack, otherwise known as "Ban-Luck" to some Singaporeans, is interesting in that it is an almost symmetric game between the player(s) and the dealer. This is because the payouts and scoring rules are identical for both player and dealer, which contributes to the simplicity of the game. In fact, if the dealer chooses to play in a particular fashion, namely hitting his cards before revealing the players' hands, then it does become a perfectly symmetric game.

Conversely, a dealer's house advantage comes solely from being able to selectively reveal some players' hands before hitting. In other words, the dealer has an advantage in that he is able to first beat hands which are likely to be weaker (by being busted), and that he is able to further build up his hand to confront stronger hands.

Out of a pure curiosity, I was considering some potential strategies for Chinese Blackjack. However, most player strategies are likely to have a minimal impact, due to the inherently limited strategic nature of the game. Chinese Blackjack forces the player to draw til at least 16, in which case it is (by statistical reasoning) unwise to draw further. The only exception to this rule is when one has a 'soft' hand, comprising of one Ace. Though I have yet to perform a through analysis of the mathematics, I believe that it is better to hit in this case. There is a small chance of improving one's hand, but the main issue is to confound the dealer's opponent model by tricking him into believing that you have a busted hand.

As a dealer, there is much more room for strategic analysis. It is quite possible to compute, via extended Monte Carlo simulation, the probability of a 4, 3 card hand being busted (assuming the basic opponent model given by the hit-til-16 rule). Furthermore, with some computing power or pre-computed tables, it is possible to obtain the precise odds of a player's hand being superior to yours, and the odds of a drawn card improving your hand, given the already exposed hands. However, I have my doubts regarding the feasibility of such implementations.

Sunday, May 25, 2008

Battleship Solitaire

Recently, I've been playing a type of puzzle called Battleship Solitaire. Basically, this type of puzzle involves a battleship grid, and numbers along the sides of the grid. Based on these numbers, you are supposed to work out the locations of the ships.

In principle, the game works out to be similar in some areas as Paint By Numbers, and hence some strategies which I discovered earlier were viable for this game too. However, this game is probably (at my present skill level) partially dependent on luck, since some puzzles I played were ill-posed, having 2 possible solutions. Of course, this is almost certainly due to the puzzle generator, which does not check for the uniqueness of the solution.

Some sample shots of a new game and a solved puzzle follow.

A puzzle with 9 starting hints.

A solved puzzle.

The rules of the game (copied from this website), for reference, are :

The computer hides the ships in the grid and a few 'shots' will be fired into the grid to get you started (Hints). The ships will be hidden in the grid with the following rules.
  • The ships will be orientated in either the horizontal or vertical direction only.
  • No two ships will be adjacent in any direction including diagonally
  • There is one battleship (4 squares in length)
  • There are three cruisers (3 squares in length)
  • There are three destroyers (2 squares in length)
  • There are four subs (1 square only)
  • The numbers in the right column indicates the number of grid squares occupied by ships in the horizontal direction for each row.
  • The numbers in the bottom row indicate the number of grid squares occupied by ships in the vertical direction for each column.

Friday, February 15, 2008

Cursor*10

I found a game with a very unique and interesting gameplay, one which was so fresh that I had never seen before. I was so impressed by the game that I had to introduce it here.
I can't reveal much about the game without spoiling it. All that I can say is that the game requires you to "Cooperate by oneself ?!".

By the way, my (unimpressive) high score is 139. It is probably easy to beat this, but I don't want to click madly again.

Hope everyone enjoys this short game.