Quantcast
 Friday, November 12, 2004

OK, let's geek out in the technical way for a bit.  Patrick mentioned that I pointed him to Ruby, and more specifically to Ruby on Rails.  I'm quickly falling in love (in a geek sort of way) with the language and framework.  I've been a long-time fan of Python (check out this discussion on Python vs. Ruby), but there's something about Ruby that just clicks for me.

Side note: Patrick, you asked about doing web services / SOAP on Ruby.  Check out soap4r.  Looks like a decent framework and some of the basic tests seem to work.

Other side note: When you search for ruby “web services” you get tons of hits for Sam Ruby.  Best to exclude Sam when looking for more info on this topic.

Rails is a model-view-controller (MVC) framework that strives for simplicity, elegance, and “Principle of Least Surprise”.  The most interesting component of Rails is ActiveRecord, the simplest object-relational mapping framework I've ever seen.

I'm doing a personal project to aggregate boardgame pricing data from various online vendors.  To do this, I need to have a master database of games that I can easily keep up to date.  Enter BoardGameGeek - I'd love it if they would offer a web services interface, but for now I'll have to resort to screen-scraping their HTML output.

Now, for some code.  First, some SQL DDL to define the games table:

CREATE TABLE games (
  id int(10) unsigned NOT NULL auto_increment,
  title varchar(50) NOT NULL default '',
  boardgamegeekID int(10) NOT NULL default '0',
  publisher varchar(255) NOT NULL default '',
  updated_date datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (id),
  KEY title (title)
) TYPE=MyISAM;

I then use a Rails script to generate the model, which is a class representation of this table structure.  Rails uses Ruby reflection extensively, so the code for the model is almost laughingly simple:

require 'active_record'
class Game < ActiveRecord::Base
end

Yes, that's it.  ActiveRecord will automatically use metadata from the database to determine what attributes to provide, how to generate SQL for CRUD operations, etc.

I'll talk about the controller / view side of things later, but for now I'll stick to showing some the code used to scrape BGG and populate the database:

require 'open-uri'
require 'config/environments/production'
require 'app/models/game'
yearmin = '1960'
yearmax = '2010'
puts "Searching BoardGameGeek to harvest games from " + yearmin + " to " + yearmax
searchURI = "http://www.boardgamegeek.com/search.php3?yearmin=" + yearmin + "&yearmax=" + yearmax
open(searchURI) do |f|
  results = f.read.scan(/A.href="\/game\/(.*?)">(.*?)</)
  for row in results
    g = Game.new
    g.title = row[1]
    g.boardgamegeekID = row[0]
    g.publisher = ' '
    g.updated_date = DateTime.now
    puts 'Found game: ' + g.title + ' with ID ' + g.boardgamegeekID.to_s
    g.save
  end
end

That's it.  This is just a loader and I'll need some more elegance to maintain this over time (e.g., checking for duplicate entries, leveraging BGG's numbering system to avoid revisiting games already loaded, etc.).  Pretty cool stuff, huh?

posted on Friday, November 12, 2004 9:19:20 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
posted on Friday, November 12, 2004 8:49:38 PM (Pacific Standard Time, UTC-08:00)  #    Comments [3]
 Thursday, November 11, 2004

Thanks to Jason Ungerleider, there's a nice little Firefox search plugin for searching BoardGameGeek.  Nice work Jason!

posted on Thursday, November 11, 2004 6:05:31 PM (Pacific Standard Time, UTC-08:00)  #    Comments [4]
 Sunday, November 07, 2004

I'll have a sizable post tomorrow about the playtesting we conducted over the weekend, but till then here are a few games played over the weekend.

I managed to be in the office again for some Friday lunchtime gaming, and we decided to try Acquire again.  Eric was in Columbus for a minis tournament, so it was Paul, Arron, Jason, and me.  The last time I played Acquire, I managed to be in on just about every deal and ran away with the victory. This time the near opposite was true and Jason and Paul fought it out hard for 1st place with Jason coming out on top.  I was easily in third place most of the game, but Arron started showing hints of crying again so I eased up a bit and even managed to slip him some of my stock mid game so that he would get a few majorities and not embarass himself again.  Thankfully he finished 3rd, slightly ahead of me, and we avoided a difficult tantrum.

Most of Saturday was spent playtesting some of KC Humphrey's game designs.  At the end of the day we had about an hour to play some of the new games purchased from and hand-delivered by Tom at Boards and Bits.

Doug and I sat down to try the newish Lightning D-Day from Decision Games.  This is a two-player card game somewhat reminiscent of Battle Cards: World Conflict.  I've heard some great reports on this game but so far I'm not terribly impressed.  The rules are vague in many places, though reading the FAQ online is helping a bit.  They certainly could have used some of the white space in the ruleset to further explain how action cards work and talk through more examples of play.  I'll need to play this a few more times before passing judgment.

Doug faces off in Lightning D-Day.  He played the Axis, I was the Allies.

At the same time, Mike, Bill, Greg, Tom, and Jacob gave the new Cathala/Faidutti game Boomtown a try.  I don't believe they finished the game, but everyone appeared to be having a good time and Jacob is anxious to play again.

Boomtown!

Not much gaming action today as Julie and I spent most of the day catching up on some personal work.  Late afternoon as I was putting some games away in the closet, I asked Matthew to try out Buyword.  This is a Sackson design published this year by Face2Face games and was the winner of the 2005 Games Magazine Game of the Year.

Julie helping Matthew out with his letter tiles.

First, a comment about the quality of the components.  Like others, my box came without the scoring table, the money was scattered throughout the box, and many of the letter tiles were stuck together.  The quality of the printing finish on the tiles is also not consistent. The box and the letter bag are first rate though.

This is a great word game with a very creative mechanic.  Players buy letter tiles in groups of 2-5 depending on the die roll, and they pay the square of the sum of the “pips” on the letters they buy.  Letters that occur less frequently (think J, Q, and Z) have more pips.  So if I draw 3 tiles and there are 8 pips on them, then I pay $64 to get the tiles or discard all of them.  After buying the tiles, you then have the opportunity to form a word, scoring (you guessed it) the square of the sum of the pips.  This is a “buy low sell high” game and there are some tough choices.  If you like word games pick this one up - I think it is right up there with Scrabble and Boggle.

posted on Monday, November 08, 2004 4:03:10 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Saturday, November 06, 2004

I took off for the east side of Portland to help Rita setup for a games playtest day we are running today to showcase and evaluate 4 of KC's game (Pizzza, Havoc, Northwest Trek, and Tres Amigos).  I'll post a report tonight or tomorrow on how things go today.

After setup, I joined KC, Rita and their kids along with Jeff and Jason, who drove up from Medford, for some Thai food.  Afterwards, we hopped over to KC's home for some gaming. I requested something shorter so I could get back home across town at a decent hour, and KC suggested we try his new design, currently named Metro 2.  This game is an extension and rework of the fine Dirk Henn game Metro.

Rita, KC, and Jeff (still munching on some Pad Thai) playing Metro 2.

KC happened upon the design while working on a square-tile variant (as opposed to the original cairo-tile design) of his tile placement game Northwest Trek.  This variant uses offset squares, leaving smaller squares distributed throughout the board (see the closeup of the board below).

Closeup of the Metro 2 board.

These smaller squares either represent 2x ending points (like the central station in Metro) or, if blank, waystations that can be built out as the game proceeds.  These waystations provide both a way to score more points and diminish the points earned by your opponents.  The geometry is also quite a bit different than the original metro, allowing the potential for head-on collision's (only allowed at the end-game if there's no other option).  Everyone that played enjoyed it, though it is a bit more cut-throat than the original game.  I think this is a positive as it leads to a bit more player interaction than Metro.

posted on Saturday, November 06, 2004 1:40:08 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0]
 Thursday, November 04, 2004

My friend and co-worker Travis is (!) taking a week off to play GTA: San Andreas.  He's, very humorously I might add, documenting his week there in the first person.

posted on Thursday, November 04, 2004 1:33:05 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0]
 Tuesday, November 02, 2004

There's been quite a bit of talk about the pros and cons of PodCasting.  Part of this issue is that people get too wrapped up in the technology as opposed to the content.  What does PodCasting have to do with the iPod?  Escapes me...

Anyway, Aldie and Derk over at BoardGameGeek recently launched an audio series called GeekSpeak.  I listened to episodes 1-6 while flying around the country last week, and I was very much impressed.  The interviews are well done and both Aldie and Derk are engaging.  99% of the population (ok, 99.99%) could care less about this content, which makes this model all the more impressive: there's no other way to broadcast this sort of material.  Keep it up guys.

posted on Tuesday, November 02, 2004 8:14:04 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0]

Well, sort of.  Julie and I voted last night while the kids were out trick-or-treating.  Julie dropped the ballots off at the library today.

Ole and Dave: you are not alone.

I support Bush.

There, I said it.

posted on Tuesday, November 02, 2004 4:26:41 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [4]
 Monday, November 01, 2004

The November issue of The Games Journal is out.  My favorite article this month is “Living the Dream 2.0: Promotion.”  Check it out.

posted on Monday, November 01, 2004 8:34:29 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0]

My friend and co-worker John Hibbard has documented his transformation, self described as From Morbid Obese to Ironman.  Best of luck John next week at your Ironman this Saturday - we'll all be pulling for the success you deserve.

posted on Monday, November 01, 2004 3:26:21 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0]