League of Legends, order from chaos

I don’t talk games very much so I am sorry if this analysis is fragmented.

If you thought DotA (Defense of the Ancients) was an unholy fount of bullshit, then you are like me. But the problem with DotA was not the game itself, but the people and the platform surrounding it. Warcraft 3’s creators could not possibly have foreseen that which the makers of DotA sought to create. League of Legends is what DotA should have been. A wholesome experience for the destruction of towers, and the killing of “mans”.

Riot (the studio) has produced an environment wherein people can engage in lane patrolling, unfettered, for the most part, by absurd balance issues, people leaving matches, and a generally unstable client under load. I am “all up on” League of Legends because they have done the game design equivalent of un-crumpling a piece of paper and making it almost perfectly flat. DotA was a disastrous affair that catered to the elite and the manic, requiring an intense knowledge of the entire system and allowing the elite few to exist as untouchables.

If you are not familiar with DotA, take Warcraft 3, remove all base building features, add about a billion new types of heroes, and throw it all into a sort of Tower-Defense style gameplay. “Heroes”, or in the case of League of Legends (LoL), “Champions” pursue various paths on the map referred to as “lanes” and assist their AI controlled minions in destroying a series of towers. Your opponent has an identical objective, hence the conflict. Opposing Champions typically meet at the minion battle line and strategically attempt to take each other out. The battle line is critical because while a single minion is no match for a champion, groups of them in addition to an assault from another player is certain death.

Players are enticed into battle to gather XP and gold to advance their characters, thus preventing them from “camping” their own towers. Killing another player offers a huge boost of gold and XP, and consecutive kills garner incredible bonuses. The choice between an aggressive style of play to push the enemy territory and build your character is opposed to that of risking your life.

Unlike DotA, dying in LoL is not an automatic loss. I can remember many DotA matches where the first team to have 2 or 3 deaths would quite the game immediately. LoL is not like that. You can literally turn the tides, barring major disaster, such as an opposing player stringing together a massive kill streak. Even though dying is less significant than it was in DotA, it is still by far the worst thing you can do. In nearly all cases it is better to run than to risk death. The game balance is largely designed around entrapment and burst. Unlike DotA, there are very few godlike characters that are unkillable. In about 90% of cases, solid consistent play and smart teamwork and communication will trump auto-win characters and “builds”.

LoL ups the ante with a meta-character system that allows players to level up independently of actual matches, much like Battlefield 2, and I imagine, the newer Call of Duty games. This system adds several elements of customization to every player and can legitimately impact the Champions on an individual basis… for example, selecting meta-skills that boost offense and then picking a defensive player for a balanced character… or even still, selecting all defensive skills and then picking a defensive character for a juggernaut. In addition to those skills, aka “talents”, you can select 2 special abilities from a larger pool that are in addition to the Champion specific moves. These can be important linchpins, such as a powerful ranged attack for a slowish melee character, or an escape move for a vulnerable character.

Maybe the best part of the LoL is the business model. Taking their notes from the Xbox-live era, LoL is free, but you can buy points to spend on unlocking features. By default, the Champions available for usage change on a weekly basis. If you want to unlock a particular one for use at your desire, you have to unlock it. It can be unlocked for free by playing X number of games (which isn’t as bad as it sounds), or shelling out a few bucks for extra points. Powerful and popular characters cost substantially more than others, to help dissuade everyone from using the same types of characters. You can amass enough points to unlock a character for free in less than a days worth of play.

As mentioned, LoL combats some of the player-based issues with DotA. Leaving matches before their conclusion is flagged on your character for all to see when in game lobbies, character receive bonus points for never leaving matches, hopeless games can be legitimately ended by presenting a vote to surrender, which must be unanimously agreed upon by a team. This makes for a much more consistent and tolerable experience for new players.

LoL also has a matchmaking system referred to as “ELO”, which is intended to prevent new/bad players from being matched up against hardcore players. It seems to have its faults however, especially if a great player intentionally groups with a bad player, which seems to throw the system out of whack.

To round out LoL’s greatness is a very stable game client that runs smoothly at decent resolution, far better than Warcraft 3 did, surprisingly. On the flip side, LoL’s “lobby” component, built in Adobe AIR and Flash, is unstable by comparison and has several flaws and quirks that can be frustrating, but by no means inhibiting to your experience.

As icing on the cake, the full compendium of all the characters, items, and skills are available for viewing throughout the games presentation, helping new players learn the game without having to consult 3rd parties or get beaten down in practice matches.

The game is free. It’s quite good. It’s gotten high marks from respected outlets. It’s worth looking at.

Basic Scalable MouseEvent’s for AS3

One of the first things that amateur Actionscripters bang their head against when learning AS3 is the usage of Events. Particularly, click events. This is because in AS2 you can get a lot of web-like functionality (read: hyperlinks) with throw-away code such as this…

1
2
3
my_clip.onMouseDown = function() {
     getURL("some URL");
}

This is easy stuff, and you can sling it painlessly around on an as-needed basis with little fear of having to do a rewrite on the function itself in the sort of typical micro-projects that AS2 users tend to work on. The deal is that AS3 doesn’t allow this at all, not even close. The bare minimum AS3 click event looks like this…

1
2
3
4
5
6
my_clip.addEventListener(MouseEvent.CLICK, onClick);
 
function onClick(e:MouseEvent):void
{
     navigateToURL(new URLRequest("some URL"));
}

A whopping 5 lines compared to 3. But code length never actually seems to be the issue. For whatever reason, the idea of making actual declared functions as opposed to just assigning them to a property seems to jump start the conscience of journeyman AS2′ers and they realize that it just seems wrong. Indeed, it is wrong. A casual analysis of this will reveal the harsh truth that unless you do something different, you’re going to end up writing an infinite number of new functions to handle every possible click in your application.

So here’s how to not do that, and how to get it so that you can boil down some of similar click events into a single smooth function that will make your life easier.

The first step is to understand dynamic properties in AS3. In AS2 you’ve probably seen this

1
someObject.randomPropertyName = "random value";

In AS2 you can basically sling properties around at will. Well, in AS3 that’s tightened up, you can only do this with generic Objects and MovieClips. Stick with me, this will be important. The summary of the approach is to put your pivotal value onto your event target object as a dynamic property? Hoobah-whaaa? Well, let’s say all you are doing with a set of click events is making hyperlinks. You can just put your hyperlink target right on the clickable MovieClip (remember, it HAS to be a MovieClip. No buttons, no sprites).

1
my_clip.myURL = "http://www.google.com";

Whoa now! Let’s get the event going.

1
2
3
4
5
6
my_clip.addEventListener(MouseEvent.CLICK, onClick);
 
function onClick(e:MouseEvent):void
{
     navigateToURL(new URLRequest(e.currentTarget.myURL));
}

Viola! What we are doing here is accessing the e.currentTarget property of the event. This points to whatever was clicked. That of course is our MovieClip, which has the custom myURL property on it. This code will run. So all you need to do now in order to make similar links is make a new click, set the myURL property, and point it at the same function.

An important technical note here so that you understand what the deal is. e.currentTarget is actually of type Object. You can access the myURL property because, like MovieClip, Object allows custom properties. Since e.currentTarget is of type Object, if you need to access MovieClip specific methods, such as gotoAndPlay, it would be considered a good practice to formally cast the e.currentTarget variable to a MovieClip before doing so, that way your intent is clear. That looks like this…

1
2
var currentClip:MovieClip = MovieClip(e.currentTarget);
currentClip.gotoAndPlay(2);

iPhone app complete

I finished, with some help, my first iPhone app. I think I have to withhold the name as not to falsely take individual credit, but it was done under contract for reallyMedia.

My iPhone application for Chico’s is only now starting to become recognizable from its raw, primordial form. I discovered, or rather deduced, that the only other company to get their site on the iPhone using the same eCommerce web framework that we use actually had their app developed by the people who created the entire framework. That’s convenient. So I think that unless a dark horse gets to market in the next few months, I’ll be the first person to get this eCommerce platform adapted to the iPhone who isn’t actually a paid employee of the damn platform itself.

I’d say that the distinction is well founded. After all, we’re talking about a very hideous beast, a thing for which flowcharts were invented. That an outsider might conquer it handily is at least a footnote in the platform’s history. Comfort is taken in the knowledge that people can and do make an entire career and livelihood based on niche aspects of extending and modifying this eCommerce platform over and over again for the hundreds, nay, thousands of massive entities that use it. I’ve met them. So to be among the first to break into the growing mobile niche has me tempted to put the 2011 BMW on pre-order.

I just came back from vacation. I learned a few important things in my time away.

1) Making any residential space in the United States unavailable to broadband is inhumane in the information age. Almost worthy of a tax credit. My grandparents are on 56k, not because they want it, but because they don’t have a choice. Even traditionally “old people friendly” services like Yahoo are turning their backs on 56k users by upgrading to AJAX/PNG laden web mail interfaces that simply do not load on 56k. Luckily I was able to “opt out” to the older version, but does Yahoo seriously expect a 68 year old to know how to do that, or even what it means?

2) Apparently some people really like boats. I was on my way to the airport on Saturday and I passed by what had to be a 35 year old mobile home, scarred from decades of major hurricanes and featuring visible structural damage and even rotting. Parked next to it was a rather large fishing boat that would seat 4-6 comfortably with a large engine, gleaming in the sun as if recently washed. That somebody could own a recreational vehicle worth several times more than the place they eat and sleep may be an important training point in problem with red state economies… and, well, red states in general.

3) Broadcast news is a myth. I haven’t watched the CBS evening news since, well, the last time I was in the remote swamps of America. And it’s worse than ever. 15 minutes devoted to a killer whale… killing something, is not exactly keeping the public informed. I search in vain for pictures of Dan Rather outside the studio doors with a sledge hammer.

4) I applaud Sea World. You have a dangerous animal that did something violent and lethal, and in an age where overstated and dramatic apologies are demanded or even required, you’ve done the smart thing and said, and I paraphrase “it weighs 12 tons and has the brain of a fruit fly, what exactly did you expect”?

The most egregious thing I know.

I am completely annoyed with open source projects that insist you compile the source on your own machine, rather than offering a release binary. This has got to be the last vestiges of long-bearded engineering running through the veins of the software development ecosystem.

I propose a new rule, if you are going to ask for a donation to your crappy open source project, you MUST provide a functioning stable release binary. Failure to do so means nobody will ever listen to your marginalized opinions on software development ever again until the end of time.

People have projects to complete, and they can’t be bothered with your 15 step readme on how to configure your craptastic build tool with a 50 page appendix for every flavor of UNIX ever.

Give me a binary, or forfeit.

Javascript, day 4…

I’ve been charged with rewriting a huge chunk of Javascript on my employers eCommerce site.

This Javascript represents years of arcane and contradicting business logic, interface decisions made by boisterous merchandisers with little to no perspective on user interaction, and a data model that is scarcely translated in whole to the front-end.

I have often been accused in my career for building things from scratch even with there is functioning but imperfect code laying around. One of my first nicknames here was “The Chef”.

I am certain nobody will ridicule me for choosing to take this one from the ground up though. Santa Maria!

Every line is crafted with perfection, this API will be a symphony. They always knew the words, I will teach them the music.