The year of gaming.

November 13th, 2008

Gamers have possibly never seen such a good season for gaming as perhaps this year. Never in my life can I remember a season with so many solid high-quality “must-have” titles.

It all started back on September 16, 2008 with the release of Star Wars: Force Unleashed. A decent title, not the best game ever but a worthy addition to the Star Wars line-up, and it told a relatively decent story arc, in comparison to Episodes I-III anyway. One thing that continutes to depress me is how much Lucas seems obsessed with making Vader a bitch. In either ending to this game the kid comes out of no where and totally hands Vader his own ass on a platter. It just makes the Lukes accomplishment later seem somehow less amazing. I mean, nobody, save the Emperor, should be able to take on Vader. And somehow this kid seems to take them both out, one after another, no problem. And jeez why did it seem like nobody knew what Jedi were in IV with all these Jedi running around killing stuff everywhere.

Anyway, two weeks later we got Fracture. Can’t really say this i a must-have title this year, but in a lesser year it would have been a more than acceptable addition. Then, a week after that on Oct 14, we were blessed with Dead Space, an amazing sci-fi/horror survival game. This game had heart. Amazing atmosphere! Oct 21, Fable 2. A solid update to the XBOX classic (multiplayer is the suck however, why two players over xbox live cant control their own camera is COMPLETELY beyond me, it makes no sense and whoever was in charge of that should be banned from making any decisions in the future…). Also that week we got FarCry 2, which bears little resembalnce to FarCry 1 but whatev, its cool.

Next was the epic Fallout 3. I don’t feel like I have even scratched the surface of this game, and it will probably warrant multiple play-throughs, so its easily going to consume a chunk of next year. November 4th, was got EndWar. I haven’t had a chance to pick this up yet, but I’ve heard good things. Just too many games to play and not nearly enough time. Friday of the same week, Gears of War 2 was released… I posted earlier how I feel about that… Amazing.

This week we got two solid titles that are almost polar opposites of each other. We got CoD: World At War which is all about shooting people and MirrorsEdge which is about shooting no one. I picked up MirrorsEdge today, mostly for Abby because I think she is sick of seeing me shoot things in Fallout and GoW2.

November 17th, a date which I seem to run into more often than I would like to, is the release date for Left4Dead. I’ve been looking forward to this game for a long time now, and am excited to the point of being about to pop that it is so close. This was going to be my big “MUST HAVE” title this year, but damn if I don’t love the hell out of Horde. Finally in early December, things get wrapped up with the new Prince of Persia title.

All I have to say is I’m glad I’m not a kid anymore, and can buy my own games. Because having to come up with a list of one or two games that my parents MIGHT buy me would kill me this season. Ahhh, the small joys of being an adult.

Hoarding the Dead

November 13th, 2008

Last weekend I got a chance to pick up Gears of War 2. I’m not that far into the single-player campaign, but thats not because it isn’t a solid improvement over the first (it is). The reason I haven’t dipped much into the single-player campaign is because I’ve fallen in love with Horde multi-player. Unlike most multi-player games where your opponents are always human (and frankly always better than I am), Hoard is a purely co-op multi-player experience. The idea is that you and four of your buddies are in basically arena and you have to hold your position for as long as possible. Simple, but deviously fantastic.

I’ve never felt this level of comradery with a group of total random stranger before. Usually, in team based games (like Team Fortress of the Battlefield series), even though there is a strong emphasis on “team” and working together. I’ve never felt like I really gave a damn if somebody else died. I mean I could be standing right next to a guy and he could take a bullet to the face, and I would think to myself, “Sucks to be him!” Mostly because I knew that 10 to 15 seconds from now he would respawn and it would be cool. No harm, no foul. Just as long as I didn’t die.

Horde is a completely different. The entire atmosphere reenforces the idea that the guy next to you is just as important as you. If one of your guys falls to the enemy, it just makes it that much harder for you to hold your position, and you have to cover more territory, making it even more difficult to stay alive. The thrill of running into a firefight, bullets flying around you, as you try to race against the Horde to get to your fallen teammate is intense.

Yes, intense is about the only word that I can use to describe it. I’m looking forward to getting a match going tonight with Ford, Declan, and Rashaan. It’ll be good times indeed.

Also this week, the Left 4 Dead demo went public (it hits the street mid-next week). Which is also a lot of fun. I will reserve final judgment of the game until after I’ve played the real deal. But so far, it’s going to be tough to edge out Gear of War 2 Hoard mode as the multi-player experience I’ve ever had.

Multiple Foreign Keys In Rails…

November 12th, 2008

So yesterday at work, I ran into a seriously interesting problem and its the first time in the three years I’ve been working with Rails that I’ve really butted heads with ActiveRecord. I’m not really sure if ActiveRecord won or I did, but I eventually got it to work. Luckily, I can blame most of the problem on will_paginate and my own laziness.

Here is the scenario: I’ve got a model, lets call it Items. Now Item belongs to Users by the way of user_id. However it is also possible for different User to temporarily rent an Item, this is represented using renter_id.

Now in Rails this is pretty straight forward:
class Item < ActiveRecord::Base
belongs_to :user
belongs_to :renter, :class_name => “User”
end
class User < ActiveRecord::Base
has_many :my_items, :class_name => “Item”, :foreign_key => “user_id”
has_many :rented_items, :class_name => “Item”, :foreign_key => “renter_id”
end

No problem, right? Well, what if i wanted a list of all items that a User has access to. I basically want a mySQL select of this:
SELECT * FROM items WHERE (items.user_id = user.id or items.renter_id = user.id)

What would I like to do is this:
has_many :items, :foreign_key => ["user_id", "renter_id"]

Unfortunately that was not to be. So my next idea was just to use a method that gathers both and passes it back. For example:
def items
my_items + rented_items
end

However, this is gloriously inefficient, requiring the entire collection to be gathered from the database then chopped up and paginated in Ruby. Bad idea… Besides, will_paginate doesn’t like working that way (which is a good thing)

After beating my head against rails and mySQL and trying to remember which comes first AND or OR. I finally broke down and decided to implement it old school using :finder_sql, which ended up looking something like this:
has_many :items, :finder_sql => 'SELECT * FROM items WHERE (items.user_id = #{id} or items.renter_id = #{id})'

(And yes the single quotes are quite important in this context because you want the literal string ‘#{id}’ to be evaluated later, not when the string is generated.)

And this will work fine for things like User.find(:first).items, and I was happy. Until I tried to do User.find(:first).items.paginate and it freaked the hell out (being unable to build a proper request from the finder_sql which is totally understandable). And again I fell into despair and hit up the rails api. And lo and behold I found the :extend key on has_many. What it allows you to do is define custom methods, usually finders or creators for the assocation, using the proxy reflection data that it provides it was “easy-ish” to accomplish what I wanted to do, by overwriting the paginate method from will_paginate and build the Pagination collection by hand, and the controller programmer is none the wiser that I have totally hijacked the ball.

It ended up looking something like this:
has_many :items, :finder_sql => 'SELECT * FROM items WHERE (items.user_id = #{id} or items.renter_id = #{id})' do
def paginate(page, per_page)
total_entries = proxy_reflection.class_name.constantize.count_by_sql proxy_reflection.options[:counter_sql].gsub(’#{id}’, proxy_owner.id.to_s)
WillPaginate::Collection.create(page || 1, per_page || 10, total_entries) do |pager|
pager.replace proxy_reflection.class_name.constantize.find_by_sql(proxy_reflection.options[:finder_sql].gsub(’#{id}’, proxy_owner.id.to_s) + ” LIMIT #{pager.per_page} OFFSET #{pager.offset}”)
end
end
end

Finally!

I’m really excited about the OutPacker

November 10th, 2008

I just heard about outpacker.com, a site dedicated to hiking, backpacking, and camping communities. I have no idea what they are planning, and I hope I get a beta invitation. I have been really slack in my hiking this year, I have only been out twice or three times and only to the north Georgia mountains, and only day-hikes. I feel like I slacked off in 2008 and hope to get back in the swing in 2009.

Amazing Indian Resturant.

November 7th, 2008

Today, I went to an incredible Indian place up in Marietta. Vatica Indian Vegetarian Cuisine‎/. The owner, I speculate he was the owner anyway, was hilarious. The food was delicious. It was exactly the kind of place I’ve always wanted to find. When you walk in, you don’t get seated, you just find a seat and sit down. There is no menu, you just sit, and they bring you whatever they are cooking. And it was delicious. My only regret is that I am currently on a diet, trying to get fit, and I couldn’t stuff myself nearly as much as my taste buds wanted to.

But I will definitely be back for more.