Free Rails Book at Leanpub + RailsFTW update

A month and a half to go to build up my street cred for RubyConf PH

Seriously, though, I’ve spent the past month working on stuff related to my upcoming talk, namely, about teaching Rails. At the top of the list was converting and formatting my old outdated Rails 3.0 book to Leanpub‘s markdown dialect.

Long story short, the book is now available there for online viewing. I’ve also gone the Humble Bundle-esque “Pay-what-you-want” for e-books scheme for people interested in giving me money to support my other writing endeavors.

In other news, I’ve finally updated RailsFTW to Rails 4.0.2 and Ruby 2.0 (2.1 is still unstable for Windows). Head over to the site and grab it while it’s hot.

Obligatory Hearthstone post from a former Magic player

Now that Hearthstone, Blizzard’s foray into online collectible card games and agile software development, is now in open beta, you’d expect Magic: the Gathering players of old to make their own obligatory blog posts on the game. Luis already wrote his which focused on constructed play, so in this post, I’ll be covering fundamental game concepts and limited (Arena) play.

Winning a 12-2 two days ago helped.

Getting Started

I know, it’s tempting to just plunk down $$$ for a hundred or so packs and start building your decks after finishing the tutorial, but IMHO it’s better to go through the following first:

  • If you haven’t done it yet, read the absolute basic tips over at the Game Guide i.e. Innkeeper’s Lessons.
  • Go through all the Basic and Expert AI Practice as all heroes. Not only will this give you an idea what hero you’re comfortable with. Note that the Expert AI can be difficult without additional cards so you may want to level up your heroes to level 10 first before tackling them.
  • The Practice grind also gives you a lot of gold – 100 for defeating all Basic, 100 for all Expert, 100 for leveling up a hero to level 10, and 100 for collecting every card in the Basic set (by leveling all classes to level 10).
  • Grind out the rest of the basic quests: 1 pack for first Play mode game, 100 gold for first 3 Play mode games, at least 1 pack from finishing your first free Arena game, and 95 dust for disenchanting your first card.

After that, you’re free to choose how you’ll go about playing the game, whether you aim for depth or breadth, constructed or limited, go pack buying or going infinite, casual or hardcore, etc.

If you’re going the cheap route, though, you should consider using your free dust on 2 Harvest Golems as they are a good addition to most entry-level decks.

CCG Fundamentals in Hearthstone

Hearthstone, at its core, is a traditional CCG in the vein of Magic: the Gathering and Yu-Gi-Oh. Because of this, many of the fundamentals from those games transfer well into the former. Unfortunately, new players still stick to the same mindset from those games leading them to use strategies and tactics that aren’t as effective in Hearthstone as they are in their previous games. Let’s look at some of them:

Card Advantage and Tempo

Imagine you’re back in 1994 and you’ve just opened your first Magic starter deck and just begun reading the rules. After learning that the game is all about reducing your opponent’s “life points” from the initial 20 to 0, you think that life gaining cards like Healing Salve and Stream of Life are powerful cards since they prevent you from losing the game.

After playing hundreds of games and reading magazine articles on Magic strategy, you’d eventually learn that life points aren’t really important – what matters more is the number of cards that you can utilize over the course of the game. This is because the game is mostly symmetric like chess: both players start with the same number of life (20) and cards in hand (7), and receive the same resources per turn, drawing 1 card and playing 1 land for mana. Knowing this, players who spend resources to have a net card advantage over the opponent will have more chances to win than those who don’t.

For example, playing Ancestral Recall to draw 3 cards (net 2 cards for 1 mana) is better than using a Lightning Bolt to kill an opponent’s creature (net 0 cards for 1 mana) is better than using Healing Salve to gain 3 life (net -1 card for 1 mana).

And it’s not just cards and mana, players eventually learned that life is an expendable resource for drawing cards. Necropotence looks bad on the surface as it prevents you from drawing a card per turn, but when you realize that you can draw up to 7 cards for a mere 1 life for each card, you’ll understand why it’s one of the most iconic cards in Magic history, dominating tournaments back in 1996 (dubbed “Black Summer“) and serving as the influence behind Warlock’s ability in Hearthstone.

For years, Card Advantage was the concept you had to focus on in order to win games. However, players noticed that the game resources related to card advantage (cards vs life vs mana) did not include one important game resource: turns. If you take advantage of the resources that you get per turn faster than your opponent (sometimes at the expense of card advantage), you put yourself in a better position to win the game. This concept of getting “time advantage” rather than card advantage is what Tempo is all about.

Oversimplifying the theories, card advantage tells you that life doesn’t matter – winning at 1 life is no different from winning at 20 life, while tempo tells you that in certain situations, cards don’t matter – you can win with 0 cards in hand while your opponent has 7.

Now that I’ve introduced card advantage and tempo, it’s time to introduce the biggest concept that a former Magic player must learn in order to win more games in Hearthstone:

Tempo is more important in Hearthstone than Card Advantage

…all because Hearthstone did away with Magic’s lands and instants.

For the lay person, removing these was an obvious choice in a simplified CCG like Hearthstone. Removing lands removes mana screw and mana flood, the most challenging/annoying parts of playing Magic. Removing instants takes away the problems related to timing like how to let an opponent interrupt a series of plays. Both of these have not-so-obvious effects on card advantage vs tempo:

No lands mean a lot less dead draws. On a classic card advantage scenario, you use 1 good card to take out 2 or more good cards from your opponent. For example, a turn 4 Wrath of God annihilates weenie decks that emptied their hand on turn 3 especially when you consider that 33% of their next draw will be a useless land card. On the other hand, a turn 4 Consecration against a Warlock murloc deck isn’t going to be that game-ending since it’s very likely that they’ll be able to draw 2 good replacements on the next turn.

The 10 mana limit prevents control decks from utilizing their card advantage efficiently in the late-game. Classic control decks in Magic tend to end the game with 15 or more lands in play allowing them to play large threats on the board while still having enough mana available for other spells. You can’t do the same in Hearthstone where you’ve got a 10 mana limit: the only way you can efficiently use a heavy card advantage in the late game is to have cheaper threats as you can play them multiple times in a turn.

Buffs are more powerful. Another classic example of card advantage is to blow up the creature in response to it being buffed; the buff fizzles and it becomes a 2-for-1 trade. You can still blow up the creature next turn in Hearthstone, but it would be more difficult and the damage has already been done. Or in the case of Power Overwhelming, the game is already over.

You die sooner. I don’t have a rigorous numerical analysis behind it, but I feel that that if you look at how minion and spell damage scales with regards to mana, the initial life total should have been 40 instead of 30 if the game wanted to match Magic’s damage scaling. This damage scaling has the odd side effect where non-suicidal aggro decks consistently win at turn 6 while control decks can win within 2 turns of achieving control of the board. This also means that wasting card advantage early on is more often than not a good tactic to use in order to survive initial onslaughts. And one of those card disadvantage tactics is…

Life gain is more viable. Apart from keeping you alive for a crucial turn or two, life gain can also be used to heal your minions, something not usually needed in Magic since damage is healed at end of turn.

In short, if you’re seeing yourself lose often even though you know you’ve got your card advantage covered, your lack of tempo focus may be the problem.

Mana Curve

Way before tempo was a buzzword, players already knew that the ideal composition of a CCG deck was many low-cost cards and few high-cost cards. Plotting it on a graph, you’ll see a distribution curve with a positive skew. This is the mana curve.

In Magic, the main reason behind why you’d want a good mana curve is to avoid dying to mana screw: having many 3 or lower casting cost cards mean that you can still survive even though you only drew 3 lands on the first 10 turns. In Hearthstone where there are no lands, mana curve is still important though this time it’s more for tempo than not dying from bad shuffles. The game interface even provides you with a mana curve display for your deck.

There are no hard and fast rules about what is the ideal mana curve looks like as different decks (and in turn, different heroes) have different mana curves. The aforementioned Warlock murloc deck are mainly 1-2 cost cards while a Druid control deck is skewed towards 4-5 cost cards. Hero abilities have a major impact on the mana curve since you can get away with flat or ugly mana curves just by spamming your abilities.

Arena Tips

Anyone planning to go infinite (i.e. play indefinitely without paying) has to learn how to play Arena to augment their daily quest earnings. Again, this game mode shares some similarities to their CCG counterparts (Limited format in Magic) while having some quirks that may tip off veterans.

There are tons of articles out there discussing Arena strategy so I’ll try to make this short.

For the first 15 – 20 picks, just get the best card. Unlike in Sealed Deck where you can see your entire pool of cards and in Booster Draft where you can influence your later picks by signalling, you have no control in what type of cards go your way. This means that the most obvious strategy, picking the best card without caring about the big picture, is the most consistent strategy for the first half of the picks.

Forget combos and card synergies. You may think that having only 30 cards and no-penalty mulligans means that you’ll pull off combos more consistently in Hearthstone. Turns out that the high tempo nature of the game weakens most of these combos, not to mention that the random nature of the picks prevent you from getting combo pieces consistently. You’re better off using high quality cards on their own or have a deck-level synergy rather than force combos.

For example, Secretkeeper + Secrets or Ancient Brewmaster + Battlecry minions are less effective than Questing Adventurer + deck full of good 0-2 cost cards and Taunt minions.

Know the best cards for Arena. Harvest Golem, Sen’jin Shieldmasta, Acidic Swamp Ooze.. there are a lot of “top arena picks” lists out there so it shouldn’t be hard to do your research. When in doubt, at least have a baseline:

  • 1 mana – should at least be 2/1 or have a good ability
  • 2 mana – should at least be 3/2 or have a good ability
  • 3 mana – should at least be 3/3 and have a good ability
  • 4 mana – if it’s not better than Chillwind Yeti, think hard about picking it.
  • and so on…

Round out your mana curve at the final 15-10 picks. While it’s tempting to get your 2nd Flamestrike or Sprint, the latter part of the picks should be more focused on making your deck more consistent.

Pick minions over spells. This one’s straight out of Magic: minions deal continuous damage while spells are mainly one-shot deals. Hero abilities also mean you always have a 2-cost spell in your arsenal. Having 10 spells is pushing it, limiting your deck to 5-7 spells is much better. (Unfortunately, Hearthstone only shows the mana curve and you have to manually count your spells.)

One last thing…

Due to the non-interrupting nature of the game, sooner or later you’ll figure out this important tip:

At the start of every turn, always check if you have enough damage to kill your opponent.

Everyone misses lethal once in a while, but it’s always their fault when they do. So try your best not to miss lethal. :D

On Certificates, Diplomas, and Grades

Lately I’ve been preaching about meritocracy and how actual skills and experience matters more than pieces of paper though I’ve never really directly talked about them yet.

And so I decided to take some time and summarize my thoughts on what people from the last century thought are absolute requirements in getting a job.

Continue reading “On Certificates, Diplomas, and Grades”

Retirement

My 7-month paid gig(s) this year confirmed my hunch: that I was permanently damaged by the crazy stuff that happened around 7 years ago and I could not tolerate working with bullshit without further reducing my lifespan.

So yeah, I’ve retired from professional web development so that you guys wouldn’t wake up to the news that Bry committed suicide because of work related stress.

Instead you’ll wake up a few years from now to the news that Bry committed suicide after finally succumbing to his decades long battle with depression. LOL

So what now?

I’ll still be doing volunteer work i.e. the usual stuff I’ve been doing for the past few years. My earnings this year plus the odd teaching job that I’ll be taking every few months should be able last me for the rest of my days.

Yay~~! No corporate or startup shit for me!

Long-term Backup Solutions 2013

I just realized how much disk space my videos eat up. PhRUG videos have now reached > 100GB, and with the new HD camera I’m expecting to use more space soon – Startup Weekend Manila 5 videos alone ate up 20+ GB and that’s just a 3.5 hour playlist.

So let’s take a look at the current long term backup solutions:

AWS

Cloud based
cheapest is Glacier at ~₱0.40 per GB / month, typical is S3’s ~₱3.20 per GB / month

pros

  • convenient, can be automated, takes no physical space

cons

  • costs pile up as time goes by e.g. ~₱4,800 per TB/yr for glacier, 8x that in S3
  • backup and restore speed limited by bandwidth

Hard Disk Drive

Hard Disk Drive
~₱2.00 per GB, not cheap initially, but cheaper on the long run

pros

  • backup and restore is fast and easy esp if you have an external docking station

cons

  • if not filled, it’s not “around the cost of 5 months of Glacier”
  • not sure how many years a rarely used HDD will last

DVD

recordable DVD
similar cost to HDD ~₱2.00 per GB

pros

  • somewhat convenient, combines the “spend only as you need” of cloud and possible long term storage of HDDs

cons

  • backup process is slow (writing is faster than cloud-based, but switching disks take time)
  • finding quality media that would last years requires trial and error
  • takes up more physical space than HDD when you reach terabyte levels

Tape Drive

Tape Drive
browsing around Newegg tells me they hover around ₱4.00 per GB

pros

  • small, built for long storage life

cons

  • have to find a tape drive to borrow (business opportunity!)
  • backup is slow, though still faster than cloud-based on crappy broadband

Any other thoughts on long-term backup?