Le Havre – Week 3

With a total of 120 hours of work, I am happy to say that Le Havre is playable. There is still a lot of testing, bug fixing, and polish to do; but I’ve played through a full game.

Main progress this week:

  • All the building actions for the normal and special buildings
  • End game

I am still expecting another 40 hours or so of work on this game. I’d like to have quite a few more sound effects and player prompts and some better animation for resources being paid/received. And once beta testing starts, I’ll have usability improvements to make too.

There were very few graphics changes this week. I had to change the reference cards to include the value of the goods when shipped. Here is a screenshot of the game near the start of a five player game.

Capture

 

 

This week I spent 90% of my time putting in the building actions. The majority of buildings in Le Havre fit a pattern:

  1. Activate the building.
  2. Pay some set of resources.
  3. Get some set of resources.
  4. Repeat steps 2 and 3 1, N or unlimited times.

The rest of the buildings either provide some bonus to the player (end game points, or extra resources/energy), or have special text that describe how they work.

I wrote a set of classes to handle this standard case. A building has an activation cost and list of actions that the player can perform. Each action has a set of resources to pay, a set of resources to get and a number of times it can be done. The get/pay resources can be combined with AND or OR logic (only a couple cards use OR logic – the business office is one example). And the get/pay resources can include symbols like hammers and fishermen. There are also rules for “Energy” and “Food” which are really a collection of resources. Another complication is that you can use brick for clay and steel for iron. This makes the code and dialogs messier. The “easy” case ended up being 500 lines of code, which was more than I expected.

The buildings that provided bonuses were mostly special code, but they are all fairly straightforward.

That left the cards with special text. There were 18 buildings in this category (out of 62). I made the default classes easily extendable with lots of virtual functions, so adding these special buildings was easier than I expected. These buildings took 650 lines of code. The worst ones were the Wharf, Haulage firm and Shipping line. These required extra dialog boxes and significant code changes.

The most annoying buildings to add to the game were the Football stadium and the Luxury yacht. These are both special buildings (so they only come up once every seven games) that have a modest impact on the game but take a disproportionate amount of code. At one of my prior jobs, we had engineers who would design how the system was going to work and pass the requirements off to the developers. Sometimes the developers were told that a certain situation was uncommon or would “almost never happen”; as though that would make it easier to implement. That doesn’t make it easier to implement, that just makes it harder to test.

As of now, the raw line of code count is at 6100 plus the original 1200 lines of XML. After next week’s update most of the code should be written and I’ll include code counts for Hansa Teutonica and Power Grid for comparison.

Leave a Reply