Archive for category General

Dark Souls

I heard about Dark Souls when it came out because it was said to be incredibly difficult. I made a mental note of trying it out one day and then forgot about it. A few weeks ago, two good friends mentioned it to me again with high praises, so I decided to give it a shot. I dusted off my Playstation 3 (I’m pretty much exclusively a PC gamer), grabbed the game ($35 on Amazon, quite a bargain) and launched it with an open mind.

Nothing could have prepared me for what happened next.

Be prepared to die. And die again. And again. And again.

While the game starts with the standard tutorial on how to use the controller to move your character about and how to fight, I wasn’t exactly ready to face a boss five minutes into the tutorial and immediately die. Then try again, and die. And die, again and again. Ever time I fight it, I chip at his health a bit more but I realize that my sword hilt is barely damaging it at all, and at this pace, it would take me a very, very long time to kill it, assuming I manage to stay alive for that long.

I don’t want to spoil the game so I’ll just say that there is a way out, obviously, and once you figure it out, you realize that the game wasn’t being “stupidly” hard, it was just being “hard but fair”. It was giving you a small taste of what lies ahead. And that looked not just deliciously refreshing but quite enticing as well. You will die a lot in Dark Souls, but most of the time, it will be your fault and you will learn from it. And the next time you try, you’ll get a bit further.

Having said that, limiting the description of this game to this simple observation doesn’t come even remotely close to doing it justice.

Much, much deeper than it looks.

First of all, Dark Souls has the best combat system I have ever seen in more than thirty years of gaming. It’s not even close. Not only do you need to learn to hit, but also to dodge, to parry, to roll, to position yourself correctly, to backstab and to riposte. You also need to learn your opponent. Each of them (trash and boss) have cues that tell you what the next attack is going to be, and each of these attacks can be mitigated or completely avoided if you know what to do.


A bonfire, your best friend in the game.

Next, you have the enemy population. I’ve been constantly impressed with the level of attention that the developers have put in making the game challenging but manageable. There is only one level of difficulty on Dark Souls (with a small caveat, see below), so you don’t get to choose how hard or how numerous the enemies are. But they are planted along your way in very, very calculated ways that will make you want to be extremely mindful when you progress through new areas. This is not the game where you rush in a pack of enemies and mash your controller buttons until you are surrounded with carcasses. As a matter of fact, dealing with more than one enemy at a time will very often result in a quick death.

The leveling is also quite innovative. As opposed to most RPG/MMORPG’s, you are in complete control of how your character progresses. When you kill enemies, you earn “souls” which you can then use either to level, buy things or upgrade your existing gear. There is never a better path on what to do with all these souls, and the game is so well tuned that you can put all your souls into equipment upgrades and complete it at level 1.

When you die, all your souls drop on the ground and you need to run back there to retrieve them. However, if you die on your way to retrieve them, these souls are lost. This is a very simple mechanism (halfway between World of Warcraft and Everquest, which was very punishing) but one that creates a very palpable and constant tension. You don’t care too much about dying when you’re walking around with a small number of souls, but as you progress, that number grows and very soon, you start wondering if pressing ahead is not too risky and if you shouldn’t turn around, go back to a check point (bonfire) and spend these souls, which you can’t bank. Obviously, the fact that in new areas, the mobs are strategically positioned to kill you if you’re not careful makes for some very tense moments (“do not die, do not die!”). It’s not very often that playing a game raises my heart rate and hand clamminess, but Dark Souls definitely has this effect on me on a regular basis.

Who’s the boss?

The bosses are probably the least innovative aspect of Dark Souls. Don’t get me wrong, it’s nowhere near “Deus Ex Human Revolution bosses” bad: the Dark Souls bosses are still fairly challenging to the point where initial encounters usually result in a oneshot death within thirty seconds, but so far, I haven’t seen incredibly innovative mechanics. The bosses are still a lot of fun to figure out and I strongly recommend not reading any strategy beforehand, because killing bosses after figuring them out all by yourself alwas makes for an amazing feeling of elation. I do think the value of Dark Souls is more that the attention to combat details applies to all the mobs and not just the bosses.


The Hydra, one of the many, many bosses you will encounter.

Here is another innovative aspect of Dark Souls: when you reach a bonfire, all the enemies respawn (except bosses and a few special enemies). I was quite baffled when I discovered this, but I’m now realizing how important this aspect is to the Dark Souls atmosphere and philosophy. I won’t dig too deep in the details, but this aspect opens up the possibility of farming, which gives you an always available option to improve your character in case you think it’s not strong enough for the area you’re trying to explore.

Tools of the trade

Do you enjoy gearing up and tuning your weapons and armor? Dark Souls has plenty to offer in that area as well, with a mindbogglingly number of items to find and a lot of varied ways to enchant them the way you want them. Like many things, there is not a single true path there and it’s much more important to use and tune a weapon that fits your play style than picking up the one with the highest numbers.

Dark Souls is also very open in terms of character evolution. When the game starts, you get to choose the class that you want, but this class is not much more than a set of stats that are precalculated for you. When comes the time to level, you are free to put these souls into whatever stat you feel like, and if you started with a Knight but decided that you wanted it to cast a decent number of spells or wield daggers and move around very fast, just allocate the points in the correct categories (Faith and Dexterity) and you’ll create the character that represents your style of play. This flexibility of character build is what is prompting players to restart the game many times over and experiment with various builds. However, many choose to continue on with the same character, which is another intriguing aspect of Dark Souls.

Here is how it works.

Beyond the first play through

I haven’t completed the game yet, so I’m only repeating what I’ve read, but once you beat the final boss, you can reset the entire game and start from scratch. The new game (referred to as “NG+”: New Game Plus) features tougher enemies and bosses, and obviously, better rewards in gear and souls. Quite a few people seem to enjoy this aspect of the game as well since I’ve seen many say that they were on their third, fifth or tenth (NG+10!) play through.

Two is a crowd

One final noteworthy and innovative aspect of Dark Souls is multiplayer. First of all, you can play the entire game offline without any problems, but you will miss out on some very neat features of the game. If you choose to play while signed in, a few interesting multiplayer options open up.

On top of the traditional duels against human opponents, you can invade someone else’s game or be invaded. These invasions can be either co-operative or hostile.

For co-op play, you can leave a mark letting everyone know that you are willing to be summoned. If a player chooses to summon you, you will materialize in their world and, most likely, help them out with a boss that they’re having trouble with. Being summoned this way gives you a chance to observe that boss more carefully so you are more prepared to kill it on your own. Alternatively, you can ask for help, which can come either in the form of another player or from certain NPC’s, which are made available throughout the game for specific bosses.

Invasions can also be hostile, but you need to explicitly make yourself available to them in order for PvP to occur (like flagging yourself at WoW). In Dark Souls, you do that by “regaining” humanity. By default, you are not human (the game calls this state “hollow”). Regaining humanity will net you added rewards but it will also make you available for PvP, which means that other players can then invade you. When this happens, the current area becomes sealed and the PvP phase will only end when one of the two players dies (or the phantom withdraws). I’m not much of a PvP person myself, but I have to say that receiving the suddent notice that “Player xxx has invaded!” on your screen is always a bit stressful, and you start getting paranoid trying to locate that person before they find you.


In red, a phantom that has invaded your world.

A couple more interesting aspects of the online play: 1) players can leave messages for everyone else to see (“Chest ahead”, “Be wary of left”, etc…) and 2) you can see where and how other online players died by touching their bloodstain. In theory, this is supposed to give you an idea of the kind of trap or trash pull that lies ahead, but in practice, I can’t say I’ve found much value in bloodstains.

To the top with you!

I have played more than one hundred hours so far. I’m probably about 2/3rd through the game, and I’m still loving every minute of it. In more than thirty years of video games, I can only think of two games that I ever played more than one hundred hours: World of Warcraft and Civilization. Dark Souls has definitely earned the title “One of the best games I have ever played” with its mix of innovative features, amazing tuning, clever mechanics and engrossing world. Both WoW and Civilization have given me incredible amounts of satisfaction and fun, but Dark Souls goes beyond this by making me stressed, tense and incredibly elated when I finally overcome a difficult part.

It’s currently available on Playstation 3 and XBox 360, but a PC version is in the works and scheduled to ship this summer.

Solution to the “Power story” challenge

Here is the solution to the “Power story” non coding challenge:

When the power went out, Ann open the wireless settings of her laptop, scanned the area but couldn’t find a single wireless access point in the neighborhood.

This is actually based on a true story (mine, yesterday). I can usually see a dozen access points at any time, but they were all gone after the power went out yesterday, which gave me the idea for this challenge.

We had a few good answers, some that came close and a few more that answered without reading the problem carefully :-) .

I have approved all the moderated comments on the original challenge.

A new coding challenge

It’s been a while since I proposed a coding challenge, so I’ve been thinking about another one. Coming up with original problems that are not solved with a simple Google search is not easy, but I think this new one, while not especially hard, should produce some interesting and creative results.

This problem comes in two parts. The first part is more of a warm up since it’s very easy to look up, but the follow up question will, hopefully, be the source of innovative answers.

Here it is:

1) Write a function which, passed an int n, returns an array of size n containing all the numbers between 0 and n-1 in random order. For example, with n=5, valid answers are [0, 2, 3, 1, 4], [4, 1, 2, 0, 3], etc…

2) Prove that the function you wrote in 1) returns “really random” arrays.

I’m being intentionally vague on how to answer the second question in order not to lead the answers, but hopefully, the question is specific enough that no further clarifications is needed. Feel free to ask in the comments otherwise.

All languages welcome, and I suggest you use pastebin to submit your code.

The only sure way to lose is not to play

Google’s recent letter to the IEEE about their position on the current lawsuits between Motorola Mobility and Apple seems to spark some outrage across the mobile land. And I’m puzzled.

First of all, I don’t think any specific company is innocent in this dance, starting with Apple themselves. In their letter to the ETSI, Apple stated (quoted):

Apple’s letter then moves on to propose a solution based on three specific principles: appropriate royalty rate; common royalty base; no injunction.

That’s a nice thought, but it’s making quick work of Apple’s recent attempts at obtaining various injunctions against its rivals in the recent past, most notably Samsung.

So what’s going on, here, now that the injunction course of action didn’t work for them, Apple thinks injunctions should be disallowed for everyone?

This whole patent war is ugly. Ugly, ugly, ugly. When Apple fired the first shot against Samsung in April 2011, the entire community seemed to be in wide agreement that this was a crazy move, one that could only lead to the mutually assured destructions of all the parties involved. Obviously, Apple had weighed these risks and they came to the conclusion that either they could afford the collateral or that this collateral would be very small anyway, since they thought that innovation was on their side.

As the events since April have shown, things are obviously not so clear cut and innovation seems to be spread quite evenly among all the parties involved. The result of Apple’s opening salvo has been a flurry of suits and counter suits which, frankly, have led nowhere. All the companies involved are poorer than before, their patent attorneys are much richer and the whole field is an intellectual property war zone.

In the letter mentioned above, Google is simply stating that they won’t change anything to the legal actions that Motorola Mobility had underway before Google acquired them. That’s it.

It makes as much sense getting upset about this as it is to be outraged at someone because they play chess viciously.

Now that the war is full on, I can’t find anything wrong with all the players trying to fight as much as they can and let the courts decide who’s right and who’s wrong. The only stupid move in this conflict would be not to play.

Ground control to major Tom


This could be you!

Who hasn’t dreamed of becoming an astronaut? Well, now you can. The NASA has an open position for an “Astronaut Candidate” for the International Space Station in Houston, TX. The requirements are pretty interesting.

The training will take two to three years and will require a lot of traveling, probably mostly to Russia, since they will be using Soyuz to travel to and from the ISS. The required education is fairly broad, and more interestingly, the list of degrees that are not applicable is fairly short (technology, psychology, nursing(!), etc…). It looks like a CS degree is good enough, and you can make up for the lack of flying experience with an MS or better, a PhD.

“Correctable” 20/20 eyesight is required, which means that contact lenses and Lasik are accepted (I wonder how hard it is to put contact lenses on in zero gravity…). The ad also takes the time to explain each jargon occurrence: “Extravehicular Activities (space walks)”, “the extravehicular activity mobility unit (space suit)”.

Although the ad will only be open for the next couple of months, the selection process takes a while since the selection will be announced in the spring of 2013.

I was fortunate to be able to experience a Zero-G flight a few years ago, I can’t say I’m not tempted to apply :-)

Table of contents in Javascript

This is my week end project: a table of contents generator. Well, technically, it’s more like a two hour project interrupted four times over the course of a Saturday but I guess it still qualifies as a week end project.

I got tired of managing the table of contents of my documentations manually and in particular, of having to modify all the section numbers by hand whenever I moved things around. This short Javascript program now automatically takes care of it for me. Here is the quick documentation:

// A simple HTML "table of contents" generator.
//
// 1) Include toc.js in your HTML file:
//          <script type="text/javascript" src="toc.js"></script>
//
// 2) Call generateToc() in your onLoad() method:
//           <body onLoad="generateToc();">
//
// 3) Declare a div with the id "table-of-contents" where you want
// your table of contents:
//           <div id="table-of-contents"></div>
//
// 4) Put each of your sections in an <a> tag with class "section",
// specifying an "indent" representing the indentation of that section.
// Only the length of the indent matters, now its content. If no indent
// is found, a string of size 1 is the default.
//
// Example:
// <a class="section" name="Section 1">Section 1</a>
// <a class="section" indent=".." name="Section 1a">Section 1a</a>
// <a class="section" name="Section 2">Section 2</a>

This script now powers both testng.org and jcommander.org, go take a look there if you want to see what it looks like.

Ideas for potential improvements:

  • Make the numbering optional or configurable.
  • Have the script add CSS classes to the sections for easier styling (“section1″, “section2″, etc…), since the indenting is pretty crude right now.

JCommander 1.20

I just released JCommander 1.20. The main new feature is “parameter delegates”:

Parameter delegates

If you are writing many different tools in the same project, you will probably find that most of these tools can share configurations. While you can use inheritance with your objects to avoid repeating this code, the restriction to single inheritance of implementation might limit your flexibility. To address this problem, JCommander supports parameter delegates.

When JCommander encounters an object annotated with @ParameterDelegate in one of your objects, it acts as if this object had been added as a description object itself:

class Delegate {
  @Parameter(names = "-port")
  public int port;
}

class MainParams {
  @Parameter(names = "-v")
  public boolean verbose;

  @ParametersDelegate
  public Delegate delegate = new Delegate();
}

The example above specifies a delegate parameter Delegate which is then referenced in MainParams. You only need to add a MainParams object to your JCommander configuration in order to use the delegate:

MainParams p = new MainParams();
new JCommander(p).parse("-v", "-port", "1234");
Assert.assertTrue(p.isVerbose);
Assert.assertEquals(p.delegate.port, 1234);

Change log for 1.20

  • Added: Support for delegating parameter definitions to child classes (rodionmoiseev)
  • Added: @Parameter(commandNames) so that command names can be specified with annotations
  • Added: Support for enums (Adrian Muraru)
  • Fixed: Throw if an unknown option is found
  • Fixed: Main parameters are now validated as well (Connor Mullen)

  • Doom 3 source code

    Browsing the source code of Doom 3 comforts me in my belief that I’m simply not cut out for graphic programming.

    The new Google Reader

    Count me as one more Google Reader faithful user who really doesn’t like the new look.

    Google, don’t make the mistake of dismissing all the criticism as “They’re complaining because it’s different, they’ll get used to it, we just to wait them out” and take the time to ponder the new look.

    It’s basically black and white, with a lot (a lot) of empty space and a selection that turns the foreground (yes, the foreground, and the foreground only) of the font to red:

    I mean, the whole page seems to be using five colors total. Surely it’s possible to make a better use of colors without going all psychedelic on us?

    Any default theme of WordPress looks ten times better than Reader right now.

    Come on, Google, you can do better than this.

    Solution to the quiz

    Wow, my little quiz received a lot more attention than I thought it would. Surprisingly, of all the answers that I have read so far (over 150 between the comments on my blog and Google+), I only spotted three that match exactly my reasoning, which in itself, has to be a statistical anomaly.

    Anyway, enough waiting, here is my interpretation of the puzzler.

    This is a meta quiz: a question about a question. The first step to figure it out is to solve the “inner” question, which is determining what “right answer” or means. In other words, we need to answer “If you have a choice between four options and you pick randomly, what are the odds you’ll get the right answer?”.

    This is a very general question that can be answered easily: 1 in 4. 25%.

    Armed with this knowledge, we now focus on the “outer” question, which we can rephrase as follows:

    If you choose an answer to this question at random, what is the chance you will pick 25%?

    Looking at the choices, we notice that 25% appears twice among four choices, so you will be right 50% of the time.

    Therefore, the answer is 50%, right?

    Wrong!

    It’s B! You’re asked to pick a choice between A, B, C and D, not a percentage. Some teachers will actually fail you if your answer doesn’t typecheck :-)

    I think this is the answer that the creator of this quiz expected, however, the more I thought about it, the more I started to realize that there was a crack in the reasoning. Can you spot it?

    It’s the answer to the question above:

    If you have a choice between four options and you pick randomly, what are the odds you’ll get the right answer?

    The answer will be 25% only if the answer is present exactly once among the options. Not zero, not two, three or four.

    Do you think the meta quiz obeys this constraint? After all, 25% appears twice in the options, right? Yes, except that the correct answer is not 25% but 50%, which appears exactly once, so the quiz seems to be consistent with this caveat.

    Exercise left to the reader: can you rephrase the original quiz to close this loophole?

    Related Posts Plugin for WordPress, Blogger...