Forty-Two

On gaming, programming, everything!
RSS icon Home icon
  • How Rice Works

    Posted on February 23rd, 2010 Jason No comments

    Rice is one impressive piece of software. I highly doubt I could have written this from scratch (and for that I give Paul Brannan huge accolades for his work) but after working with and on this library for at least a year I probably could. Now that lead maintainership has been passed on to me, I’d like to take some time to explain exactly how Rice works, how one can dive in and help develop this library, and what my plans are for the near future as I work to make Rice and the rb++ suite; a full and proper replacement for SWIG when wrapping C++ libraries into Ruby (if you’re wrapping a pure C library, I highly recommend Ruby-FFI, though Rice will work).

    So with that, I’m putting together this post to help clarify exactly how the various parts of Rice work together, how the entire process flows and more importantly helping anyone who’s wanting to learn and work on Rice with a solid starting point (or at least officially crooked). After reading this, anyone should be able to understand the various classes in Rice, and have an idea on where certain functionality lives when looking to add features, or address any bugs. So with that, we’ll start at the top.

    Read the rest of this entry »

  • Modern Christianity and Evolution

    Posted on October 4th, 2009 Jason 1 comment

    I read a very disturbing statistic recently: 39% of Americans believe in Evolution. I found this surprisingly low number in a recent article about a new movie on Charles Darwin’s struggle with his life, his faith, and his Origin of Species here:

    http://www.telegraph.co.uk/news/worldnews/northamerica/usa/6173399/Charles-Darwin-film-too-controversial-for-religious-America.html

    The article does make some very good points. In America, religion rules. This can be seen especially today with the massive political upheaval of the recent elections, where we’ve got the “religious right” (mainly Christian, which I’m most familiar with) against the “secular left” fighting it out to the bitter end. What I have been trying to understand is why do less than half of all Americans believe in Evolution and how can we solve this? Is there a glaring and unrecoverable conflict between Evolution and Christianity? Is there any scientific evidence supporting either side? Is this an irrational, fearful reaction in the face of the unexpected and the new? And more importantly, why is it most Americans are so against Evolution while almost everyone else in the world has happily accepted the theory?

    Read the rest of this entry »

  • Game design lessons learned from World of Warcraft – Part 3: PvP and PvE

    Posted on June 22nd, 2009 Jason No comments

    So I’ll be honest. I’ve had a huge rant building up for some time now on how Blizzard has royally screwed up WoW, and continues to do so, because they have a flawed look at how to balance PvP and PvE gameplay together.

    I’m not going to write it because frankly, I’d never want to read it. So I’ve condensed my point into three simple words:

    BALANCE

    PVP

    FIRST

    You simply cannot have a PvE game and add PvP on top of it. PvP is player skill, PvE is just numbers. One could go to the extreme and say that they can’t co-exist, but I’m not quite convinced this is true. Close, but not quite.

  • Adobe Flash 9 & 10 Security Requirements

    Posted on June 3rd, 2009 Jason No comments

    For those of us messing and working in Flash, the transition from Flash 8 through to Flash 10 have been rife with some major changes in the security model that allows a local Flash application to communicate with the outside world. Adobe, knowing that these are big changes, had its developers write pages, pages, and pages of documentation describing the where what how and why of these updates.

    Problem is, it’s very hard to find the simple How-Tos for common situations in all this text. I spent many days scouring and tinkering to figure out the security solution to my application: a flash-based video viewer that would connect into a server and display Motion-JPEG frames that get streamed in.

    Hopefully I’ll help save someone else the same hours of research and playing with this problem. My solution is such:

    You first need up a simple service on the server you want to connect into that serves the crossdomain.xml content that defines your security policies.

    I use a modified version of the service found here: http://www.lightsphere.com/dev/articles/flash_socket_policy.html. It’s updated to be a full Daemon process, so you need Proc::Daemon and Proc::PID::File installed.

    Please note:

    <site-control permitted-cross-domain-policies=”all”/>

    is the required addition to make this script work with Flash 10. Also, if you are worried about corporate firewalls blocking ports < 1000, simply change $port to something bigger, and add the following to your Flash client:

    And you're good to go!

  • The GOP is precisely that…

    Posted on May 27th, 2009 Jason No comments

    Grandiose and Old.

    I have to say, I’m impressed. I was appalled at the atrocities perpetrated by the Bush administration, especially now as more information gets leaked out, but what’s going on now is mind-boggling at best, and at worst will decimate our country to where we’ll never recover.

    I refer, of course, to the constant Republican QQ-ing and stonewalling about the choices the Obama administration is making.

    Ever time I hear a prominent Republican talk on TV, on the radio, or read something on the Internet, I hear nothing but “waaah waaah I’m not getting my way anymore so I’m going to make life difficult for everyone who doesn’t see things my way, waaah waaah!” Ironic, this, as it’s the old-folks that are acting like 8 year olds who aren’t getting their way.

    Aparently, some of these people need a refresher for what THEY had a hand in for the past EIGHT YEARS:

    • DOUBLING our National Debt from ~$5 trillion to > $10 trillion
    • TWO wars, one justified one not
      • The justified war in Afghanistan has been under-manned and assumed to be a “quick romp” to clear out the Taliban. Guess who’s back in power and even stronger?
      • The unjustified war in Iraq has destroyed the friendships we had with many countries around the world and has made even MORE people angry at America, leading to MORE terrorists. Iraq will fall into civil war between Sunni and Shiite as soon as we leave, just you watch.
    • Decimation of personal liberties through acts like the Patriot Act and the Digital Millennium Copyright Act (What did Benjamin Franklin say about safety and liberty?)
    • Secret prison camps. Torture guidelines, Guantanamo Bay, Detention without Trial
    • … and who knows what else we’ll find out about in the coming years

    You guys have done a TERRIBLE job at running the country. Why should we trust, or even listen to, anything you guys have to say? You complain about lack of bi-partisanship, but then you don’t ever budge on your stances on bills. You guys are going to fight the new Supreme Court nominee (well, you’re probably still pissed that the exiting justice, David Souter, made you guys look like idiots, but I digress), only because it’s Obama’s choice, not one from your party.

    You guys might mostly disagree with Limbaugh, but come on, you are all working towards Limbaugh’s ultimate hope, the “failure” of Barack Obama.

    Do you care about this country? Or do you only care about your personal “values” that get thrown out of the window anyway once you’re in power?

    Congratulations on losing most of the young vote (like myself), that’s really going to help you get back into power in the future. Oh and grats on alienating the Hispanic vote, and most of the Black vote too. In fact, the women vote is going to the Democrats as well (thank you Limbaugh!)! If anything, the self-inflicted implosion of the GOP has been very entertaining to watch, but the delusion that the party is still as relevant now as it was 20 years ago is causing far more damage than good.

    That said, there is a simple solution to this problem:

    Grow Up.

  • Game design lessons learned from World of Warcraft – Part 2

    Posted on May 1st, 2009 Jason No comments

    While Part 1 touched on abstract decisions affecting game design (and admittedly turned into a rant by the end, I’m kind of bad at that), part 2 here will focus on a few of Blizzard’s design decisions for WoW that we can learn from, and in Part 3 I’m going to touch on my ideas and observations on the game’s PvP and PvE.

    Now of course I can’t list, or even think about, most of the design decisions that have helped towards making WoW the massive success that it is, but there are a few decisions, both good and bad, that have hit close to home for me, decisions that I have to work with or around every time I play. Were I to be on the WoW dev team, these are some of the things I’d be recommending.

    Read the rest of this entry »

  • Embedding IRB into your Ruby application

    Posted on April 2nd, 2009 Jason No comments

    A feature I realized would be very helpful to have in rb++ is a debugging console. Basically, I wanted the ability to drop into an irb session and have available to me the internals of rb++ and rbgccxml, all set up for the sources I’ve specified for the given extension.

    Turns out, this is a lot harder to figure out than it would initially seem. The irb code is quite complex and nothing there is documented in any way shape or form. Also, searches around the Internet came back with results that were some six years old, and while helpful, did not pertain to my particular case.

    Then I remembered that ruby-debug does exactly what I’m looking for. A quick glance in that code got me the code snippet I needed.

    require 'irb'
     
    module IRB # :nodoc:
      def self.start_session(binding)
        unless @__initialized
          args = ARGV
          ARGV.replace(ARGV.dup)
          IRB.setup(nil)
          ARGV.replace(args)
          @__initialized = true
        end
     
        workspace = WorkSpace.new(binding)
     
        irb = Irb.new(workspace)
     
        @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
        @CONF[:MAIN_CONTEXT] = irb.context
     
        catch(:IRB_EXIT) do
          irb.eval_input
        end
      end
    end

    And it’s use is quite simple. When you want to drop into an irb session, you simply do

    IRB.start_session(binding)

    and you will have a code prompt with all data available at your finger-tips.

    See the related rb++ commit

    You use this feature in rb++ as follows:


    ruby your_extension_file.rb console

    From there, start playing around with the parsed source tree using either @parser or self.namespace to get started.

  • Game design lessons learned from World of Warcraft – Part 1

    Posted on March 28th, 2009 Jason No comments

    Given that I love gaming, and I love programming, it’s only natural that I put the two together. Now while I haven’t yet gotten deeply into game development and design, I have become acutely aware of design decisions made in the games that I play, and I like to take mental notes of what works, and what doesn’t. I also spend a lot of time watching game-related news and lurk the GameDev forums to keep up-to-date on the latest game development trends and advances.

    I figured, now that I’ve got a blog, it’s time to start taking more permanent notes on the design decisions, both good and bad, of the various games I play. To start, I’m going to pick on the 800lb Gorilla in the room, World of Warcraft (known here on out as WoW). This is the first of what will be a multi-part series of articles, as I tend to delve in to rants and ramblings at time. However, I will try to keep it all coherent. So, without further ado…

    Read the rest of this entry »

  • Blog Named!

    Posted on March 26th, 2009 Jason No comments

    That’s right, I decided on a name. Being a huge fan of Douglas Adams, and especially the Hitchhiker’s Guide to the Galaxy, it seemed only right to pay homage to such a great author and fantastically weird story.

    So the choice of theme made, the name came down to two: Forty-Two, otherwise known as The Answer, or Slartibartfast, because the name really doesn’t matter. I was leaning towards Forty-Two, and with an extra vote from a good friend of mine, it became the name.

    I’ll probably update other parts of the site to fit the theme, like the subtitle and the categories. All in all, feels good to have a solidly named site.

    Now, what do you get when you multiply six by nine?

  • There are two hard problems in Computer Science…

    Posted on March 21st, 2009 Jason 1 comment

    Cache invalidation and naming things, and the latter is most definitely not a Computer Science-only problem. I have no idea what to name this blog, so for now, it’s going to remain un-named until either a good suggestion comes along, or inspiration hits me.