Building Browser Games: An Overview

The Rosetta Stone

Note: This is a very very old article and I don’t really endorse the idea that you do anything this way or using this tech anymore, however, here’s the new home for the code from this just so it doesn’t go missing forever. I just hate it when links are all broken and stuff goes missing on the net.

When I started reading the series of blog posts on the site Building Browsergames, I thought it was cool that somebody had started a project to build a persistent browser based game (PBBG) and shared the code. But it has gone a great deal further than that. Every post that features code is done first in PHP and then repeated again with Perl. Beyond that is the frequency of posts. Having worked on XPlus,, and finally I’ve heard about hundreds of game projects started by enthusiasts. I can tell you that the vast majority of them have grandiose ideas and then reality intrudes. After a while it gets hard or boring and they stop.

But not this time. Dozens of entries later, you can actually see a bunch of the pieces that make up a simple PBBG sitting there and there’s lots of interesting design advice to go with it.

Now it’s my chance to participate in the creation of this Rosetta Stone of programming, because that’s what it is. The original Rosetta Stone was a tablet carved with bureaucratic proclamations about taxes and statues, it’s value lay in the fact that it had the same text in both Greek and Egyptian languages and it gave us a key to begin decrypting hieroglyphics. Maybe this one isn’t quite up to that level, but it gives us a place to start discussing PBBG design and it gives us that in both Perl and PHP. My contribution is a simple one. I’ve gone back and started rewriting all the same code again, this time in Ruby on Rails.

Perhaps someone else will add Python with Django versions of everything or Java and some mix of technologies. I don’t know. But whatever happens, this might prove helpful to someone looking for a language to learn, looking to learn about PBBG building, looking to learn programming, or looking to move from one language to another. For me personally it was an attempt to both improve my own basic skills at Ruby and Rails as well as hopefully adding to something that might prove helpful to others.

The entries as they stand today:

Designing Your Game’s Database
The Registration Page
Why You Should Be Hashing Sensitive Data
Using Configuration Files
The Login Page
Cross Site Scripting: What It Is And How To Prevent It
A Flexible Stats System
Implementing A Flexible Stats System
Implementing An Email Confirmation System
Getting Started With A Templating System
Making Your Forms Auto-Focus
Making Your Forms Remember Their Values
A Brief Design Document
Putting It All Together
Adding Stats
Displaying A User’s Stats
A Simple Combat System
Creating The Bank
Healing Your Players
Forcing Users To Log In
Designing A Flexible Items System
Retrieving Items
Reducing Repetition
DRYing Out Our Database Connections
DRYing Out Our Stats
Securing Our Hashes
Simple Cron
Using The "On-View" Method Instead Of Cron
Buying Weapons
Swapping Weapons
Integrating Weapons Into Our Combat System
Buying Armor
Integrating Armor Into Our Combat System

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s