Monday, April 09, 2007

This past Easter weekend I had my first chance to dabble in an MMORPG (Massively-Multiplayer Online Role-Playing Game) called 'The Lord of the Rings Online - Shadows of Angmar”.  I've long resisted playing these games (though I flirted with the Star Wars Galaxies game for about 2 hrs) for a multitude of reasons, not the least of which is the potential time-sink it would become.

I was initially turned on to the game by a good friend, Eric Tolman, and the screenshots that he took while in-game.  I thought I'd bite the bullet and install it and give it a trial run during a free, open beta they're calling 'World Tour'.  I can honestly say - WOW (and no, not World of Warcraft).  The game is pretty amazing.  I played for a few hours, completing quests, gaining levels, interacting with other players, formed a fellowship, and helped save the town.  It was a lot of fun.  Like I say, though, I don't have much to compare it to since I've never really played the other games like it.

Though I'm not sure I'll ultimately subscribe to the service (when do I really have time to play games?), I can honestly say I'd have fun if I did.  I still have another 14-odd days left in the World Tour beta before the game goes live, and I intend to enjoy them.

Monday, April 09, 2007 3:51:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Saturday, March 18, 2006

We had, today, our first board gaming session in which we tried something completely different.  For some time now we've wanting to play Puerto Rico after hearing so much goodness about it.  In our usual monthly get-togethers we play Settlers of Catan, Carcassonne, Shadows over Camelot.  This time, however, we opted for a completely new game, seeing that one couple wasn't able to make it tonight.  Not one of us had ever played it so we were on even ground to start, which made for a lot of fun and discovery.

Wow! What a cool game!  At first the rules looked daunting - even after having read them some 3+ times.  They didn't really make a lot of sense until putting them into practice and then it was oh so simple!  The game was extremely well balanced and everyone had a great time.  We will definitely need to try the 6-player unofficial variation when we get together in our normal 3 couple gatherings.

If you're a board gamer and haven't tried it out, or are wanting something quite different and a blast, I highly recommend Puerto Rico.  I can't say that I've developed a strategy yet, as the first two games have been focused on learning the rhythyms and patterns in the game and learning how what I do and choose affects all the other players (and myself), but I'll be watching for more of the subtle nuances and tricks in future games.  I'm looking forward to it!

Saturday, March 18, 2006 5:05:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, January 01, 2006

In keeping with the tradition we established last year, we had some friends over to commemorate the coming year.  This time, however, rather than watch a movie marathon we decided to do a boardgame marathon, though much more abbreviated than last year's movie marathon.  We had Eric and Kimberly Tolman over to eat dinner and play games, and play we did.  We tried some new games which were loads of fun.

We played:

  • Speed Scrabble - A variation on Scrabble that the Tolmans taught us consisting on building out your own private set of tiles before everyone else.  I love Scrabble so this is a welcomed addition to our gaming repertoire.
  • Mystery of the Abbey - a whodunnit mystery game similar to, but quite distinct to Clue.  That was a good time.  Oh, it was Brother Harold whodunnit you know, the thin, hooded, clean-shaven Brother Templar.  Just as I suspected.
  • Shadows Over Camelot - a fantastic game that works hard against you.  It whooped our butts.  We need to develop a strategy for beating this game.  I look forward to the next time we can play this.
  • Carcassonne - A now-staple game around our house which we discovered nigh a year ago now, we played with the Inns and Cathedrals and the Princess and the Dragon expansions.  Lots of fun.  Carcassonne is a wonderful tile-based game.

All in all we had a great time!

Perhaps I should post something about setting goals, my personal goals, etc in a post such as this, but I just wanted to report on our evening.  I'll be touching on other more lofty topics in the days to come.

Happy New Year!

Sunday, January 01, 2006 4:37:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Monday, September 12, 2005

Today I am excited to have received a copy of the Carcassonne Almanac from www.spielbox-online.de which I ordered way back in April for 8 EURO (the actual product link is here)  I preordered the product (which just recently became available mid August).  The product (which is essentially just a glorified newsletter) contains a copy of the expansion Carcassonne - Die Katharer (The Cathars).  That was, in fact, the primary reason I made the order in the first place.  Previously, the expansion was only made available to a select few subscribers to a game magazine in Europe.

Carcassonne is an awesome tile-based board game and I look forward to trying out this expansion!

Monday, September 12, 2005 7:30:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, January 30, 2005

All my life I've been something of a boardgame nut...probably always will be.  Recently, I discovered a new boardgame that I very much enjoy and like to show to people.  It's called Carcassonne.  This game is a tile-based game in which players take turns strategically placing tiles on the table, ultimately creating a large map of cities, roads, and farmlands.  The game is fantastically addictive.  The game, not including its various expansions contains 72 tiles.  I had some spare cycles today and wondered if I could place all 72 tiles together to form a square board, and have all tiles legally placed.

As it turns out, this was easier that I thought it might be, only taking about 10-15 minutes.  One primary goal was to set the board up such that it was completely contained; that is, set up such that no cities and roads led off of the board.  Well, the result wasn't quite what I was aiming for, but I'll probably give it another try in the coming days (hrs).  Please forgive the blurriness of some of the tiles - I took the photograph at an angle so as to minimize the flash's glare and then photoshopped it with a perspective distortion and a stretch.

Update January 31st, 2005:
Here's an updated one that took a little more time.  As you can see, all of the roads and cities are completely self-contained on the board with the exception of the lower left corner.  Oh, well, it was fun while it lasted.

Sunday, January 30, 2005 5:32:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, January 04, 2005

Well, I knew this day would be here, sooner rather than later.  Microsoft has come out with a PC version of Settlers of Catan, the award winning and thrilling game by Klaus Teuber.  In all honesty, when I found out about MS's endeavors in this area a few months ago I had some moments of depression and despair because I (along with a few friends) have been working pretty hard on a version of the game for about 10 months in our spare time (that is, 1 night a week) and have made great in-roads to its completion.

Well, when I found out today that it had already been released, I had to give it a try, so I downloaded it.  Upon playing it for a while to test it out I can honestly say I was pleased.  Pleased that the one we've been working on is far superior.  It is both graphically superior as well as much more engaging.  I find that the MS version drags (a lot) especially in the Trade dialogs - there's no tension or aggravation or banter - aspects of the real board game that we've worked hard to bringing into the game.  That said, however, there are some things that I think they did well and others not so well.

The Trade window, while slow and tedious, is difficult to get used to...I had to read it over and over and over again before I would initiate a trade because I was never really sure what I was giving and what I was getting.  There is no feedback on the window, so you have no idea what the other players are doing.  Even then I'd miss out on a trade while making sure I knew what I was giving up because of a built in timer that seems to expire automatically without any warning.

I like how the player list appears on the right side - it consolidates the information nicely and is quickly readable.

When hit by a robber the dialog is not intuitive at all...I ended up getting rid of cards I didn't want to drop and I could never recover in the game.

With respect to our spin-off (which isn't quite the same game, but very close in some respects), I'll keep everyone posted on our progress and make the bits downloadable once completed.  Thanks, Microsoft, for not overdoing it and making my despair and discouragement moot points. :-)

Tuesday, January 04, 2005 8:42:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [21]  |  Trackback
 Friday, December 31, 2004

New Year's Eve was a good time!  We had over several friends over for what my brother affectionately called a 'Nerd-fest'.  In fact it was more of a Lord of the Rings marathon.  Ever since these movies came out we've been wanting to watch them back-to-back-to-back, but time and energy have never been on our side.

Yesterday, however, we got together at about 12:30 PM and started in on the extended versions.  It was a blast, though I can honestly say that I've NEVER sat and seen that much TV in a day, much less in a week.  Had we not taken a break that lasted for about 10 minutes, I think we would have finished the movies at 12:00 AM on the dot.

Despite today's complete lack of exercise, we had a good time with friends and I plan on never ever doing that again - it's just too much TV - even though they are the my favorite movies of all time.

Friday, December 31, 2004 5:47:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, June 07, 2004

While flying back from Santa Barbara I had a few minutes to sit back, relax, and work on my PC version of The Settlers of Catan.  The coach steward noticed it and was amazed by it.  We spent several minutes talking about it and how it's just a fun game.  This was quite reassuring.  I guess this game's popularity is just booming, especially here in Utah as I now see it almost everywhere.  I'm now even more envigorated and want to see it through to completion.

Today (rather, tonight) I focused on aspects of the player's turn and UI state.  Also, I began work on a different type of hexagon hit test.  You may have read what I posted previously on hexagon hit testing.  This is kind of test, rather that checking for a hit test on the hexagon itself, focuses on hit tests against the corners and the edges (with a certain allowance on either side to make the selection easier).  I'll post my code when I have it working...should be soon!  Also, I extended the hex hit test further to allow (or deny) certain type of hexes to be selected.  This is important for game play because there are times where only water hexes or only resource hexes can be selected.

Monday, June 07, 2004 6:18:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, June 02, 2004

I owe lunch to a great friend of mine for helping my solve this.  Jason Walker (a fellow member of our .NET User Group leadership) was kind enough to research an issue I was having.

The team up at Redmond was kind enough to include a method called EnableVisualStyles() in .NET Framework v1.1.  This method alleviates the need to include .manifest files for each .exe for which you want the sleek, cool Windows XP look and feel.  This method should be called prior to any UI or control being presented so it is routinely the first line of code in your app's entry point.  I suppose (for I haven't looked deeply into it yet) that calling this method internally performs a PostMessage() operation which is an asynchronous, fire and forget method (vs SendMessage() which is synchronous).

Through heartache and pain I have found that if your application displays a modal dialog window an exception will be thrown when the dialog closes down.  Well, I was programming along and all of the sudden I was greeted by a very noxious-looking and uninformative System.Runtime.InteropServices.SEHException when a wizard that I had written (which is displayed as a modal dialog) shut down.  It didn't occur to me that my call to EnableVisualStyles() was the offender of this obscure error.  I was trying to figure out whether it was something to do with some custom non-UI to UI thread marshalling or something of the like.  The stack trace revealed the following:

SEHException at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(...)
...

I should have read the stack trace more closely before applying my own rationale to solving the problem.

The solution is to call Application.DoEvents() just following the call to Application.EnableVisualStyles() so that the message posted has a chance to complete before proceeding.

Wednesday, June 02, 2004 7:17:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, April 18, 2004

In writing my Settlers of Catan computer version, I came upon the following conundrum: how do I perform coordinate hit tests on a hexagonal grid?  Dealing with cartesian, square grid is very simple and well understood.  A hex grid, in reality is not very much more complex, but does throw a few curve balls (i.e. there are angles to consider, cells overlap, etc).  I did a little online research and my search wasn't too fruitful, but what I did find confirmed some ideas I already had which I'll outline here.

A few points of interest with respect to hex grids:

  • There are two ways of rendering the grid (flat-side up and point up).  Each of these presents a different algorithm and a solution to the point hit test problem.
  • If the flat-side-up orientation is chosen, you will actually end up with fewer hexes visible on the screen at a time.

Here is the scenario I ended up with:

  • I chose the point-up orientation of the hexes.
  • Each successive column/row of hexes overlaps by one pixel on its neighboring hex to provide a seamless edge - this greatly simplified the creating of hexagonal tiles.
  • My hex-grid (map) is rendered graphically offset from the upper-left corner of the image so we must take that offset into consideration during our hit test.

In solving the problem, I made the following assumptions and assertions on my code:

  • My hex tiles are a fixed size: 153 x 177 pixels
  • The origin (0, 0) of the map is offset to the upper right of (1, 0)
  • In order to provide graphical symmetry in my maps, every other row starting with 0 (continuing with 2, 4, 6, etc) has one fewer column than the odd rows (1, 3, 5, etc).
  • We have to take the 'missing' column as well as points that fall off of the grid into consideration while performing our hit test or we might return invalid coordinates.

Now to the solution:

In order to perform the hit test, I decided to treat the entire map in a traditional, grid-based manner, dissecting the map into a grid where each square was 153 x 133 (or MAPTILE_WIDTH x MAPTILE_HEIGHT * .75).  Each square then contains points that belong to up to three hexes.

If my y coordinate falls on an 'odd' row, then the lower 66% of the square belongs to two adjacent hexes.  The upper 1/3rd belongs to three hexes.  If the y coordinate falls on an 'even' row, the lower 2/3rds of the square belong entirely to a hex and the upper 1/3rd belongs to two other hexes as per the diagram.

The other issue to resolve is that of calculating points in relation to a given slope (very easy using the point-slope equations that I learned back in junior high-school).  If you observe the code you'll see that I cheat a little...I preresolve the slopes (since they are constant and I don't want to have to reevaluate a known value repetitively).

I'm not going to give a play-by-play of my code, but if you have any questions, feel free to let me know; I've commented that which I felt was important to comment and have included it below.

Just a few points of interest about my code because it does target my game and isn't entirely generic, though breaking it out to be completely generic would be a no-brainer, I don't have the immediate need to do so:

  • Map.Current is a singleton instance of a Map object (defined elsewhere) that represents the map in question.
  • Several of the constants that I use in the code are defined in a Constants class.
  • InvalidPoint is a point object (defined as private readonly Point InvalidPoint = new Point(-1, -1)) and represents any coordinate position on the map that doesn't correlate to a coordinate on the grid.

Undoubtedly, there are better algorithms for detecting hit tests against a hexagon and I'd love to see them...this merely represents a first-go at the problem and I think it addresses it well.  This function is intended to return a Point object containing the map x-y coordinate pair as resolved against a pixel x-y coordinate pair (e.g. from the current mouse position).

Ok, here's the code:

private Point getHex(Point pt) {
  
if ( null == Map.Current ) return InvalidPoint;

  
// precalculate the 'hotspot' regions
  
const float MAPTILE_HEIGHT_HOT = Constants.MAPTILE_HEIGHT * .75F;
  
const float MAPTILE_UPPERTHIRD = MAPTILE_HEIGHT_HOT * .33F;
  
const float ANGLE = 0.589F;
  
const float ANGLE2 = 1.8095F;
  
const int MAPTILE_LEFTHALF = Constants.MAPTILE_WIDTH >> 1;

  
// subdivide the map up into squares.
  
// each square contains 1/2 of two opposing hexes horizontally and a portion
   // of one or two hexes vertically
  
// for ease of calculation, offset the point by the map margins
  
pt.Offset(-MAP_MARGIN, -MAP_MARGIN);

  
int row = (int)( (pt.Y + ( pt.Y / MAPTILE_HEIGHT_HOT )) / MAPTILE_HEIGHT_HOT );
  
int col = (int)( (pt.X + ( pt.X / Constants.MAPTILE_WIDTH )) / Constants.MAPTILE_WIDTH );

  
// convert the point (mouse coord) to coordinates relative to the current square
  
pt.X -= ( col * Constants.MAPTILE_WIDTH ) - col;
  
pt.Y -= (int)( row * MAPTILE_HEIGHT_HOT ) - row;

  
if ( pt.Y < MAPTILE_UPPERTHIRD ) {
     
if ( row % 2 == 0 ) {
        
if ( pt.X < MAPTILE_LEFTHALF && pt.X * ANGLE > pt.Y )
           
row--;
        
else if ( pt.X >= MAPTILE_LEFTHALF && ( pt.X - MAPTILE_LEFTHALF ) / ANGLE2 < ( MAPTILE_UPPERTHIRD - pt.Y ) )
           
row--;
        
else if ( pt.X < MAPTILE_LEFTHALF )
           
col--;
     
}
     
else {
        
if ( pt.X >= MAPTILE_LEFTHALF && ( pt.X - MAPTILE_LEFTHALF ) * ANGLE > pt.Y )
           
row--;
        
else if ( pt.X < MAPTILE_LEFTHALF && ( pt.X / ANGLE2 < ( MAPTILE_UPPERTHIRD - pt.Y ) ) ) {
           
row--;
           
col--;
        
}
     
}
   }
  
else if ( row % 2 == 0 && pt.X < MAPTILE_LEFTHALF ) {
     
// if the point of interest is within the lower 2/3 of the hex, then there are
      // two possibilities - even rows (0, 2, 4, ...) contain 
two hexes, whereas odd
      //
rows (1, 3, 5, ...) have only one hex.
     
col--;
  
}

  
if ( col < 0 || row < 0 || row >= Map.Current.Rows || col >= ( ( row % 2 == 0 ) ? Map.Current.Columns - 1 : Map.Current.Columns ) || pt.X < 0 )
     
return InvalidPoint;
  
else
     
return new Point(col, row);
}

Sunday, April 18, 2004 11:26:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Wednesday, April 14, 2004

Hey, it finally feels like I made some progress!  I have never taken the time to really sit down and use the Xml objects built into the .NET framework.  It sounds asinine, I know, but honestly I have never had/found a need to use them.  I've used the DomDocument before in very limited ways in VB and Javascript, but never had broken down to use the .NET stuff.

Well, long story short, I got the ScenarioEditor utility to save and load my xml scenario files.  Plus they get validated on load against my schema file!  Hey, this is progress for me.  Previously, I would have saved the data to a binary file with my own proprietary data structure.  That would have been way to much for what I wanted to accomplish for such a small utility that didn't need such functionality.  I wanted scenarios to be creatable in tools such as Notepad.

I have yet to profile the code and go back over a few loose ends, but the utility is now in a functional state and ready to save scenarios for the game - that is goodness!  I'll get some screenshots posted shortly.

Wednesday, April 14, 2004 6:30:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, April 12, 2004

A good friend, Josh McCord, and I get together to code every Monday night.  It's been an on-going tradition now for a couple of years.  While I'd like to say we've made a lot of progress and released lots of code that would be misleading.  We've had aspirations of writing a MMORPG - in fact we made LOTS of headway towards that goal last year.  However, as many personal project go, the scope kept creeping up and expanding.  We tried to reign it in and have well-defined goals...alas, our efforts seemed in vain.  Eventually, we decided to put on hold all that we had been working on.  We have never intended to discard the code, mind you, but instead to leverage what we've done so far in new projects.  And we have been successful at bring forward the components that we developed for the MMORPG (such as a very cool networking infrastructure, as well as some general purpose utility classes and libraries) into our current game project.

We decided to tone back our efforts just a bit and write a multi-player computer game where the rules have already been defined for us.  We've had a tradition of playing Settlers of Catan for the last while and thoroughly enjoy the game so, why not?  We decided to create a computer version of the board game - especially after seeing what was already out and available on the Net.  Not to say anything particularly bad or negative about the already extant versions, but they sure need a lot of work.  Sure, the game mechanics are there, but presentation is a HUGE part of any would-be successful app and that seems to be an area in which they all suffer.

So far, we have the networking infrastructure (TCP/IP, sockets-based) already fully in place and implemented.  Additionally several game mechanics are operational along with about 80% of the graphics.  Today's focus was finalizing the Editor utility and getting real-time stats for in-game display.  The Editor utility allows us to generate graphically a Settlers of Catan scenario file (xml-based) that can be loaded into the game at runtime.  The tool is complete but for the actual 'save' process which I don't anticipate should be a big deal.  I have a feeling it will write itself.

Monday, April 12, 2004 8:07:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback