The new Macbook (2015)

My local Apple store happened to have a Space Gray Macbook in stock, so I picked it up. I think that a lot has been said already about the new Macbook, but here are some thoughts of mine. I primarily wanted a laptop that is as small and lightweight as possible, and the Macbook fits that. People called it an "iPad running OS X" and mean that in a negative way, but this was essentially what I'm looking for. And it fits that bill - it easily fits into the sleeve of my old Asus eeePC 1000HE and thus also in my little messenger bag. And yet, it runs OS X, which means that I can run iDraw, XCode, do .net Core 5 development (with Visual Studio Code) and a bunch of other development related things I simply cannot do with an iPad. It even runs Logic Pro X and Final Cut Pro X, although of course, performance is limited.

It only has a single USB-C port - this is something you have to carefully think about if you're interested in buying one, since that is also the charging port. I've looked at my stuff, and while I wish there was a second port, I can live very well with the single port. My iPhone tethers wireless, my D-SLR has an Eye-Fi Wireless Card, when I need a mouse or keyboard I use bluetooth, if I need to transfer data I use AirDrop or Dropbox and if I need to back up data, Time Capsule does that wirelessly. Around here, there are enough Apple TVs to allow me to share my screen wirelessly. There are exceptions of course, for example my NanoKORG Controllers required me to buy the $19 USB-C to USB adapter. I do think I'll return that in favor of the $79 adapter that has USB, HDMI and a USB-C port that allows me to charge the Macbook and use a USB device.

I like the touchpad a lot. It basically fells the same as the old touchpads, and after changing some settings (Scroll direction, right click when tapping the bottom right etc.) I don't see a difference compared to the previous touchpads. Which of course means that Apple is still the only laptop manufacturer in the entire industry that makes a good touchpad. The keyboard is interesting. There is almost no hub, and yet the keys feel positively clicky. It's a full size keyboard, and while I only had a few hours to use it so far, I like it.

But as you can see, this is not your primary computer if you do anything that requires power. It lives in an ecosystem and it shines if you have a lot of other Apple products. I can code perfectly fine and do enough stuff with Logic or GarageBand, but if I want hardcore video/audio editing or running a Windows VM with the full Visual Studio, the Macbook isn't the right system. In fact, the Macbook is inferior to the 11" Macbook Air in almost every single category - the Air is cheaper, faster, has better connectivity, can drive a 4K monitor, and is the sane choice if you want to do pretty much anything. But the Air only comes in boring 2011-silver-design, cannot compete with the gorgeous screen on the Macbook, is significantly bigger and heavier and has a cooling fan. I still keep my Lenovo E440 as my Windows 7 portable.

To quote Hawkeye: None of this makes any sense.

But I like the Macbook.

Macbook

Size comparison with the 10" iPad Air

Size comparison with the 10" iPad Air

The Dig

One of the more strange LucasArts adventures, The Dig is essentially a science fiction movie with some interaction. Originally released in 1995 during the "CD-ROM Multimedia" craze, it features writing by Orson Scott Card and is based on an idea by Steven Spielberg. All ingredients for a great experience?

The interface is a radical departure from LucasArts' previous verb interface, a trend that started with Sam & Max in 1993. There are no verbs, just a single "interact" action when clicking on stuff with the mouse. The inventory has to be opened by clicking on the little [i] box, and it contains an "examine" action. In a way, this foreshadowed the trend in the 2000's of only having two actions, "Interact" and "Look". I'll talk about verb design in a later post, but in general, this works well for The Dig because the cinematic experience is first. Michael Land's music helps with that as well - it's a true movie soundtrack, very atmospheric and while not driven as much by melody as e.g., his work on Monkey Island, it is an awesome support for the game.

The Dig

Now, I keep talking about The Dig as a cinematic experience. But how is it as a game? Unfortunately, it suffers from a bunch of issues that make it not nearly as much of a classic as most other LucasArts games. First, the writing. As said, Orson Scott Card had a large part in it. Whether you like him as a person or not, there is no doubt that he is one of the best serious science fiction writers, and as a result, The Dig has really great writing. Unfortunately, it also has a lot of it. Characters often ramble on for way longer than welcome, leading to long periods of watching instead of playing. There is also no way to skip single sentences like in more modern games - you can skip whole conversations, but you can't just skip the current sentence after you've done reading it. I'm pretty sure there is enough writing in there to make it a full blown movie, it's just that often it gets in the way of the gameplay.

Speaking of the gameplay, The Dig is not an entry level adventure, its puzzle design is obscure and (ha!) very alien. One reason is the art style - it's another radical departure from past LucasArts adventures which were comic-like. The Dig looks very realistic (for 1995), with some pre-rendered sequences. As a result, some things are somewhat hard to see or obscured by the background. You are also almost immediately thrown into a series of complex puzzles (for those who played it: The power generator puzzle felt way too hard for how early it was in the game. For those that haven't played it: 5x purple, 2x yellow, 1x red, then 5x purple, 5x blue and 1x red) with very little guidance. In a way, this fits the setting well because after all, you are on an alien world and your characters don't know anything either, but on the other hand it made it hard for me to hook me and make me want to keep playing.

Getting hooked is something LucasArts was really good at, mainly because of the world and the characters. In The Dig, neither is immediately interesting, but to be fair, I'm looking at this in 2015. The characters in the game are actually really well done, it's just that they don't start out very sympathetic and it takes a while to feel for them. Brink should've had more character development before a pivotal moment early in the game.

None of this is truly bad, but some of it really limits the appeal. It is more a like a science fiction movie that every once in a while remembers that it is actually supposed to be a game, and if you give it a chance it shines with some great (albeit not easily skippable) writing and (for the time) great voice acting. It deserves a lot of credit for showing how CD-ROM Multimedia can be done good and if anyone is planning an HD Remake of the game, adding skippable dialog lines, putting "Examine" on the right mouse button, and offering a slightly gentler difficulty slope would make it a true classic.

It's sold on Steam and GOG for six bucks at the time of writing. It reminds me a lot of Rendezvous with Rama and even though I have my gripes with it as a game, it is a fantastic experience.

My 2014 in Video Games

2014 was a somewhat crazy year overall - if someone would've told me that Seth Rogen and James Franco would be involved in one of the biggest network security scandals, I would ask them if they overdosed on Swift on Security. Anyway, let's talk about video games, because that stuff is fun and 2014 has been a fun year for me.

In March, Facebook bought Oculus VR for $2 Billion. In late december, there are still no real games that actually work on it, but more DevKits, Samsungs Gear VR, Sony's announcement of Project Morpheus and Googles Cardboard VR Kit. All this stuff is neat and my original Oculus Kickstarter Kit sure was impressive. But behind the hype and impressive technology, I'm still waiting for the actual games. Not just proofs of concept or fancy YouTube videos but real actual products. Because at the moment, I fear that VR's second incarnation is facing the same fate as the Kinect. (If someone says Augmented Reality now, it's important to remember that the Google Glass is dead in the water. I think that overall, wearables are too cumbersome but it will be interesting to see if Smart Watches can do something, despite their pathetic battery runtimes. I doubt it.)

Speaking of the Kinect: Dance Central was amazing, and I had high hopes for Fantasia: Music Evolved. I even made space in my living room. Fantasia has all the ingredients of a fun game, except for two things: The menu structure is weird and there is no real "Free Play" mode. This game is predestined to have some fun especially with children, but there is no way to just have fun without being stopped by the game. I guess that it's more suited for teenagers and older. It's a great game, I guess I just had the wrong expectation.

Early in the year, Might & Magic X: Legacy was released. I have blogged about the game before and even though it's not Game-Of-The-Year-good, it was an enjoyable trip down the memory lane, back to Parts 5 and 6. It's missing the giant story arc that made the first five games so memorable, but I got what I wanted out of it.

Many of my Kickstarters arrived - beginning with Redux: Dark Matters and Broken Age. Redux ironically isn't as good as the original DUX 1.5, but I enjoyed the soundtrack (especially Stage 6 Alarming Area, The End). Broken Age made headlines because it was split in two, with Part 1 being released in January and Part 2 still pending. I haven't played Part 1 yet because I want the adventure to be complete and play it as a whole. Despite the massive delays (There are lessons how going too far above the Kickstarter target is actually a bad thing as scope explodes), I'm hopeful that the game will be awesome - I've avoided reviews due to spoilers, but what I heard was positive.

In February, Broken Sword 5 followed, also split into two parts (Part 2 followed in April). I enjoyed it very much - it was classic Broken Sword again, with top notch voice acting and an engaging plot (I loved the Gnostics stuff). I wish that they would've extended the last location though, because I'd have loved to see more of the architecture and history.

Jane Jensen's Moebius: Empire Rising was the next adventure and the first one I'm on the fence about. Mainly because it was too much forced in one direction and I felt I was as helpless as the main character (who's kind of an asshole) and just had to go along with the plot (I called out the ability to say 'no' because Moebius just didn't give me a convincing reason to go along with the plot at the beginning.

Next up in May, one of the games I absolutely loved this year: Tesla Effect: A Tex Murphy Adventure. Yes, it is cheesy and technically unimpressive but a) It's Tex Murphy and b) it's a really enjoyable B-Movie. There was a bittersweet announcement that Aaron Connors was working on two more novels, the second which might be the basis of one last Tex Murphy game. I'd love them to remake the old games to have a more modern interface, but I guess the FMV just wouldn't hold up? If you like detective pulp fiction, I recommend picking up the book as well.

Wasteland 2 came out in September, and proudly held up the old school flag. The game's first act was significantly stronger than the second, where it lost a bit of its cohesiveness. I liked the turn based combat system and the dry, cynical humor in it. The mad monks were fun, and Damonta was a good finale to the first act. The second act had good set pieces - the Angel Oracle for example - but it just felt too loosely connected. Enjoyable nevertheless.

I'm still waiting for my Dreamcast version of Pier Solar HD but from what I'm seeing, reviews are good. It's out on Steam, so that's what I'll play once I find enough time. Jagged Alliance: Flashback is another kickstarter-backed game that I didn't have time to really play, although I immediately ran into a bug that made me lose the game - definitely an authentic Jagged Alliance game 🙂 It looks and plays good though.

Last but not least, Elite: Dangerous was released, with a lot of fanfare. The fanfare was mostly centered around the removal of offline-play. This is one of the caveat emptor lessons with Kickstarter: Just because you give money doesn't mean you actually get exactly what's promised. It sucks that the controversy takes away some of the hype of the game, but that fault lies in the creators. Overall though, 2014 has been a year where the fears of Kickstarter-backed games have been dispelled. There were many releases, and for the most part the games were good, or at least good enough to be worth the money.

Apart from Kickstarter, there have been a bunch of Indie and Semi-Indie games. Divinity: Original Sin was funded through Kickstarter, but I bought it regularly through steam. It's a bit confusing at the beginning (Who are we and what are we doing?) but it's one of the best isometric RPGs in recent years. Once it got going, I enjoyed the ride all the way to the end. It's one of the best games of 2014, indie or not. A true indie game, Escape Goat 2 came out on PC and PS4 and is a really fun puzzle game. It reminds me a lot of early 8-Bit games like Solomon's Key or Spherical, even though it's very different. In any case, I recommend playing it.

Speaking of Goats: Goat Simulator is one of the most glorious games of the year, to the point of them adding a free MMO Simulator DLC. Words cannot do the game justice. One one side it's like a fart joke that's funny but going on too long, but on the other hand it never stops being funny. Whether you play it for 5 minutes or 5 hours, it's hilarious just because you discover so many more ways to break things.

On the topic of glorious releases: Suikoden II was finally released on the playstation network, for PS3 and PS Vita. This is one of the best RPGs ever made, and we've been asking for years to get it on the PSOne classics store. It's $9.99 and the only excuse for not buying it is if you only have a PS4, because for some stupid reason Sony doesn't have PSOne Classics support on their flagship console. This might be a good time to look into a PS Vita, because not only do you get Suikoden I and II, a non-messed up version of Final Fantasy VII and all the mainline Persona games, including both parts of Persona 2. It also has the HD Remaster of Final Fantasy X and X-2 available for it.

Another console that had a great 2014 was the Wii U. Donkey Kong Country: Tropical Freeze is everything we love about Donkey Kong Country, including the unforgiving difficulty level. Mario Kart 8 is worth the price of a Wii U alone. The character roster is a bit hit-and-miss, but the vehicles are fun, the track design is amazing and the DLC is actually worthwhile (Link including a motorcycle and the Dragon track are worth the price of the first DLC pack alone). I hear great things about Super Smash Bros., but I could never get into any of the Smash Bros. games, so I have nothing to say except that the Wii U has a big enough roster of great games - some exclusive - that makes it a worthwhile console.

There were also a number of AAA game releases. Castlevania: Lords of Shadow 2 continued the story of the first part - a story that I absolutely loved. The game itself has some rough edges (e.g., stupid stealth sections) and I guess Castlevania purists despise the lack of exploration options, but what they've done with the Belmont heritage was really enjoyable. Note that Part 2 starts out with spoilers - playing it first kinda ruins the surprise at the end of the original Lords of Shadow.

Another sequel I had been looking forward to was Dragon Age: Inquisition. It was worth the wait, the game is amazing and a worthy entry in a series whose mainline games are all worthwhile. Extra Bonus points for not repeating the Mass Effect 3 ending SNAFU (which killed the series for me - I doubt I'll buy the next Mass Effect game on release).

The last game I bought this year was Telltale's Game of Thrones. It's basically an interactive episode of the show with Quick-Time-Events disguising as a game attached to it, but that's ok. It really is Game of Thrones, with all the intrigue and murder that makes the books and TV show so addicting. I'm always torn about Telltale: They know how to tell awesome stories (also see The Wolf Among Us, Back To The Future or The Walking Dead), but the episodic nature of their games often cause weak parts in the middle because they have to put in an ending to an episode that's really just glue between the preceding and succeeding one.

Last but not least, a sad note: Ralph Henry Bear, possibly the first video game pioneer and father of the Magnavox Odyssey passed away in December. It's interesting to see how far video games have come, and how far they still have to go.

faml – A Markup Language for browsers and node.js

A common request on many websites is to offer some light formatting capability for a user: Bold, Italic, Links, maybe lists. It should not clutter the markup too much and allow little room for error.

John Gruber's Markdown is one of the most popular markup languages, but it has a few features that I commonly need to tweak or remove altogether. For my needs, I have customized a Markdown parser to remove features (recently the excellent stmd.js), but I've just decided to create a little markup language of my own:

faml - A Markup Language

The syntax may be inspired by Markdown, but it is really its own thing. I only included the things I need, and there is generally just one way of doing things (e.g., emphasis is added through asterisks). The code is based on stmd.js but heavily changed and broken up differently.

You can check out the source, documentation and JavaScript files on GitHub or play with it in the browser. It is also published to npm, allowing you to just npm install faml. I have example code for web browsers and for node.js.

The current version is 0.9 because I'm still working things like the tree that the parser returns (it contains a bunch of unneccessary stuff), adding tests, and giving it a nice homepage.

But it's there for people to play with 🙂

var parser = new faml.FamlParser();
var renderer = new faml.FamlRenderer();
var input = "test *with emph*";
var parsed = parser.parse(input);
var rendered = renderer.render(parsed);
console.log(rendered);

Standard Flavored Markdown Tips

Today, some of the biggest users of Markdown have given a gift to the Internet: Standard Flavored Markdown (Read more in Jeff Atwood's Blog Post)

I played with it for an hour and I'm absolutely in love with it, for three reasons:

  1. It's rock solid and mature - Try nesting Ordered and Unordered Lists in any combination and see it just do the right thing, something many implementations struggle with
  2. It comes with a reference implementation in C and JavaScript
  3. The JavaScript implementation is easy to extend (I have not done anything with the C version)

I was able to replace the Markdown parser in our current application with the stmd.js reference parser and got up and running immediately.

Here are some tips:

The Parser and Renderer are two different things

Instead of just taking Markdown and giving you HTML, stmd.js consists of a separate Parser and Renderer. This is massively useful, because it means you can either massage the parsed markdown tree before you render it, but you can also impact how the Markdown is rendered without messing up the parsing code. Look at this example:

var parser = new stmd.DocParser();
var renderer = new stmd.HtmlRenderer();
var input = "this **is** a\r\n" +
            "test.\r\n\r\n" +
            "With Inline-<b>HTML</b> as well";

var ast = parser.parse(input);

var html = renderer.render(ast);

document.getElementById("output").innerHTML = html;

Set a breakpoint (with Firebug or whatever JavaScript debugger you use) and look at the glorious ast. Look at the collections of children, at the tokens, and then you might see why this is so great: You can monkey around with this, without having to worry about HTML rendering.

Treat newlines as linebreaks

This is possibly the #1 request people have when they first try out Markdown. Normally, you need to have two spaces at the end of the line to make it a newline, otherwise it's a space.

The parser correctly determines a simple newline as a Softbreak token. The default renderer renders Softbreaks as \n, that is a HTML newline which doesn't translate into an actual line break. This is trivial:

var renderer = new stmd.HtmlRenderer();
renderer.softbreak = "<br/>";

Now, every linebreak inserts a proper <br> tag.

Disallow all HTML

Markdown allows Inline-HTML, since the original audience were programmers/bloggers. However, in some environments it may be required to disable any and all inline-HTML. To disable all HTML parsing, we tell the Parser to not generate any Html tokens:

var parser = new stmd.DocParser();
parser.inlineParser.parseHtmlTag = function() { return 0; }

All HTML Tags will now be interpreted as Str tokens and thus escaped on rendering.

Read the Source Code

The Source is on GitHub, and I highly recommend reading through stmd.js to understand how it works and where the extensibility points are. I wish that the Parser and Renderer were in two separate files, but it's still very straight forward. Yes, there is a Regex which parses HTML, but since Markdown doesn't just support any HTML but rather a defined subset, this is fine.

You should almost never have to edit stmd.js directly. Monkey patch, yes. But that can be in your consumer code.

This library is a gift.

Thank you, Standard Flavored Markdown team.

Windows Group Authentication and ASP.net MVC 4/5/Web API problems

I'm working in a Windows environment, where I want to authenticate users using a Windows Security Group. For example, foo\mstum is in the group foo\users and I want to tell ASP.net to only allow users in foo\users to access the site.

This is usually simple, just add this in <system.web>:

<authorization>
    <allow roles="foo\users" />
    <deny users="*" />
</authorization>

Now, there are two problems with this when using a modern (that is, ASP.net MVC 4 or 5 or Web API) application: It doesn't work.

Why? Because by default, Simple Membership is enabled, and this doesn't support Windows Groups at all - you can check the source code for WebMatrix.WebData.SimpleRoleProvider.

The solution is to add an appSetting that disables Simple Membership:

<appSettings>
    <add key="enableSimpleMembership" value="false"/>
</appSettings>

Now ASP.net is back to the previous behavior of using the System.Web.Security.WindowsTokenRoleProvider which does support Windows Groups.

There is a second gotcha though: It seems that the WindowsTokenRoleProvider does not support Universal Security Groups. In my tests, only Global or Domain Local security groups showed up when calling GetRolesForUser. I have not found out why that is and if there is a way to have it support Universal Security Groups. Do note that Distribution Groups ("Mailing Lists") are not supported in any case.

Through the Fence

I shot my first two rolls of 35mm film in 15 years or so, and as expected, the majority of pictures only serve as a way for me to understand what the different camera settings do.

One of the photos that came out well is this shot of the Sand Canyon Bike Trail in Irvine, CA, shot through the fence on the Bridge over it.

It was shot on Black & White film (Ilford XP2 Super 400) on a Nikon FG 35mm SLR Film Camera with a 50mm lens at an aperture of f/22. That way, the background is in focus (I have a photo with f/3.5 and blurry background as well, but it's not as effective).

The one thing that I dislike is that the right side lacks detail - I think that underexposing it a little might have been a better choice. I love the way the film grain looks. Unlike Digital Camera Noise, the grain doesn't look like a compression artifact and gives it a nice, vintage note.

Loading Film into the Nikon FG 35mm SLR

I'm experimenting a bit with photography right now. Following a question on Photo StackExchange, I ended up buying two film cameras, the mentioned Nikon N80 and also a Nikon FG.

Loading 35mm Film into the N80 is straight-forward, while it's not immediately apparent how to load it into the FG. Hence, I made a Video:

Hope this helps others 🙂

Video Games and the Ability to say ‘No’

Imagine Philip Marlowe turning down the job from General Sternwood at the beginning of The Big Sleep. Or Bilbo Baggins standing his ground and not join Thorin Oakenshield's company in The Hobbit. Or if Han Solo refused to take Luke and Obi-Wan in Star Wars.

There wouldn't be a story. Books and Movies work because they have characters make choices that put them or others in situations which advance the plot. Books and Movies are also passive mediums where the audience can only follow along with the road that's already set out for them.

Video Games on the other hand are interactive mediums. While one can argue that the audience is still just following along a predetermined road with only a few forks to choose from -- basically, Choose-your-own-adventure-Books with graphics -- there is still a far greater amount of customizability and choice possible.

Unfortunately, most video games don't include an option to just say 'No' to something that happens in-game.

For example, in the begining of Moebius: Empire Rising, the main character gets an offer from a client. The dialogue seems to allow me to just tell them 'No'. But then, nothing else happens. I can go back to the starting location, but there is nothing else there to do. There is no consequence, and worse, there is no driving force to make me change my mind.

There is simply no explanation why I have to say 'Yes' to the client.

Similarly, Indiana Jones and the Last Crusade doesn't include an option to turn down Donovan's offer at the beginning, but there is a good reason for that: Indy's father has gone missing on the very same mission. This at least gives me a strong reason to go along with it.

Saying 'No' doesn't have to lead to a satisfactory ending. In the same Indiana Jones game, we get to meet Hitler in Berlin:

Notice the option that says 'Throw a punch'? I believe most games nowadays wouldn't have it, they might even make the whole thing a cutscene. Why? Because doing so has the guard in the back kill you, leading to a game over screen.

And that's fine. Not every choice a player can make is required to lead to a happy ending in the story. Ending the story prematurely due to the decisions of the player is a valid option. But boy, did it feel good to select that 'Throw a punch' option.

In Shadowrun Returns: Dragonfall (the excellent DLC campaign), the game starts with a friend being killed and the player taking over her old team. There is no choice here, no way to just say 'Boy, shadowrunning is to dangerous, I'm out!' That may be okay because once again, a clear motive is given.

But as you stand before the Final Boss, you hear about the Evil Plan. And I thought 'Hey, that's kinda good actually, I no longer want to stop you'. Except that wasn't an option. Of course, immediately after I heard about The Price To Pay, and I thought 'Whoa, that's a bit steep.' But again, no option to just say 'Sure, I'm in!' I wouldn't have expected a successful outcome - maybe my team would turn against me, or maybe the Final Boss would've killed me because there are no partners in this project.

Either option would've been fine and one can argue that there is a choice in case I had made a different choice earlier. (It's hard to write these postings while avoiding spoilers, so the only thing I can say is that the second-to-last mission is the one with the real choice).

It's hard to get this right. Not having meaningful choices is often worse than not having choices at all because in the first case, as a player I immediately see all the unrealized potential while in the second case it may be easier to string me along, unless it's too obvious. I think the second is nowadays called Cinematic Experience because strictly linear gameplay has a negative connotation to it.

More modern games often use a morality system - Renegade/Paragon in Mass Effect, Dark/Light side of the Force in Knights of the Old Republic, even the alignment in many Dungeons & Dragons games. Very often though, these systems are much too confined, to absolute, literally too black/white. The dark path is often the psychotic mass murderer, while the light path ends up with a character that's holier than Mother Teresa. Try to play a mafia boss who has no qualms nuking an entire city but donates a lot of his money to his local orphanage because he loves children and likes kittens. This post on Dorkly describes some of the issues better.

But even with a morality system, there is often no way to just say 'No', often it's just the choice between saying 'Yes' through diplomacy (light) or force (dark).

The Fallout series made a more concious effort to have choice in the game - the epilogues reflect upon the choices, letting us know what happened to the peopel we've interacted with. Mass Effect 3's ending - as insulting as it was - also did get that part right.

But again, these games didn't offer the option to say 'You know what? Screw you all, I'll retire to the countryside and become a farmer!'

Choices add cost - it's the dilemma of creating content that a single player may never see. Yes, all the content in the game will be seen by the playerbase as a whole, but often not by a single person. So why spend money on 'optional' content when a more linear, cinematic experience offers more bang for the buck?

Because it's boring to me. Video Game characters are flat and boring compared to movie and book characters - there is no Michael Corleone, no Keyser Soze, no Vivian Sternwood in gaming. Sure, there are a lot of memorable characters and moments, but even the more memorable ones only reach Jack Bauer level at best. They are puppets, not driven by choice but driven by an external force that's often too intrusive to the story.

Giving the player the option to say 'No', to walk away from things their character doesn't want to do helps fleshing out the character, making more use of the interactive medium. Sure, punish me for it, give me an early game over screen because I didn't stop the Final Boss. But leave that decision up to me. Maybe I just flee, not caring if the Final Boss destroys my planet. Maybe that drives me insane and my character commits suicide a few years later. That's fine, because it was the result of a choice that I made as a player, not a choice that I was predetermined to do.

Quantic Dream did great efforts here with Fahrenheit/Indigo Prophecy and especially with Heavy Rain, games in which my character had a good reason to start the quest but offered me freedom to choose how to go on from there, with the consequences of my actions shown to me. It's not perfect, but Heavy Rain is possibly one of the best positive examples.

People are creative. Look at all the 'Fan Fiction' written for The Sims, a game devoid of much inherent story and entirely choice-driven. Some things eventually become part of the game lore (the tragic accident of a family involving a pool with no ladder in The Sims 3), but what's more important, as a player I have a feeling that I'm part of an interactive medium. I'm basically playing with dolls, making up my own story as I go along.

There has to be a better way to merge the Story-less/Choice-driven nature of The Sims with the Story-heavy/Choice-less nature of most other games. I'm looking at the Indie-developer scene here, the people that gave us Papers, please, Fez, or the before-mentioned Shadowrun Returns (which arguably benefitted from the rich source material). I feel that if such a game will exist, it will come from an Indie studio.

Help us, Indie-wan Kenobi, you are our only hope for a Keyser Soze or Vivian Sternwood.

Some Ruby concepts explained for .net developers

I'm normally a .net developer, it's been my bread and butter for the past seven years and will be for several more. But it's also important for me to keep in touch with other languages out there, including Ruby. Here's my personal cheat sheet to remember naming conventions.

Method Names are lower case and use underscores, as do Method Arguments. The result of the last expression is automatically returned - there is no direct equivalent of void, although nil can serve that purpose.

def my_method(some_argument)
  1 + 1 # implicitly returns 2.
end

Local Variables are also lower case with underscores, and no special var keyword is required to declare them.

def some_method
  my_variable = 2
  1 + my_variable
end

Instance Variables - that is, a non-static field in a class - are prefixed with @. Somewhat surprisingly, they can be declared within a method.

class MyClass
  def do_stuff
    @test = 4
  end

  def testing
    2 + @test
  end
end

myc = MyClass.new
puts myc.do_stuff
puts myc.testing

This outputs 4 and 6. If I remove the puts myc.do_stuff line, this throws an error: test.rb:8:in '+': nil can't be coerced into Fixnum (TypeError).

Constructors are methods called initialize:

class MyClass
  def initialize(initial_value)
    @test = initial_value
  end

  def testing
    return 2 + @test
  end
end

myc = MyClass.new(3)
puts myc.testing

This outputs 5. Instance Variables are private by default, but Ruby has three special ways to declare a variable as public: attr_accessor, attr_reader and attr_writer. Changing the class to this:

class MyClass
  attr_reader :test

  # .. rest as above
end

myc = MyClass.new(3)
puts myc.test # outputs 3
myc.test = 4  # undefined method 'test='

So attr_reader is like public dynamic Test { get; private set; } in .net, while attr_writer is like { private get; set; } and attr_accessor is like { get; set; }.

To create property getters and setters, just create methods. In the end, that is what attr_reader etc. are doing, just like the .net auto-property syntax creates actual methods on compilation.

def test=(value)
  puts "I'm a property setter for @test!"
  @test = value
end

def test
  puts "I'm a property getter for @test!"
  return @test
end

Supposedly, attr_ methods are faster than manually implementing methods - not sure if it's true, but they are definitely the recommended way if you don't need actual logic in your getters and setters.

The syntax above used a Ruby symbol, as evidenced by the colon - :test. This is the concept that I took the longest to figure out. In a way, symbols are like interned strings in .net, since the same symbol will always mean the same thing whereas instances of strings may not be reference equal despite having the same content. Generally, Symbols should be seen as constant identifiers (they are in fact immutable). I recommend this blog post for some more information, but interned string seems to be the best .net analogue I could come up with.

Class Variables are static properties. In method names, self. is the equivalent of a static method. There are some caveats when inheriting with regards to static properties.

class MyClass
  @@static_var = 8

  def initialize(my_value)
    @instance_var = my_value
  end

  def testing
    @instance_var + @@static_var
  end

  def self.static_var=(value)
    @@static_var = value
  end
end

myc = MyClass.new(3)
puts myc.testing  # 11

myc2 = MyClass.new(4)
puts myc2.testing # 12

MyClass.static_var = 10
puts myc.testing  # 13
puts myc2.testing # 14

Constants are not prefixed and use SCREAMING_CAPS syntax.

class MyClass
  MY_CONSTANT = 20

  def testing
    4 + MY_CONSTANT
  end
end

myc = MyClass.new
puts myc.testing # 24

Class Inheritance uses < BaseClass syntax. Like .net, Ruby does not support multiple inheritance but unlike .net, there are no interfaces.

class MyClass
  def initialize
    @test = 4
  end
end

class MyDerivedClass < MyClass
  def testing
    2 + @test
  end
end

myc = MyDerivedClass.new
puts myc.testing # 6

Modules in Ruby are a bit like single-namespace assemblies in .net. Modules can contain Constants, methods, classes, etc. The include keyword is like using in .net.

module MyModule
  SOME_CONSTANT = 20

  def MyModule.say_hello
    puts "Hello!"
  end
end

class MyClass
  include MyModule

  def testing
    MyModule.say_hello
    4 + SOME_CONSTANT
  end
end

myc = MyClass.new
puts myc.testing # Hello!, followed by 24

Modules do not support inheritance, despite them being like classes (in fact, Ruby's class class inherits from the Module class, which inherits from Object). What's somewhat noteworthy is that constants do not need the Module name, unless there is something "closer" in scope.

class MyClass
  include MyModule

  SOME_CONSTANT = 30

  def testing
    puts 4 + SOME_CONSTANT            # 34
    puts 4 + MyModule::SOME_CONSTANT  # 24
  end
end

The double colon (::) was described as the namespace resolution operator on Stack Overflow.

There is obviously a lot more to Ruby that doesn't translate 1:1 to .net, but I hope that the above code samples make it a bit easier to understand Ruby as a .net developer