11 minute read

After 14+ years of not thinking about it, I recently remembered my first public “open source” project called the RPG Integration Hack.

vBulletin

Back in high school most of my friend circle was active on a variety of message boards. Many of those message boards used forum software called vBulletin. I noticed some of those vBulletin message boards had unique functionality that was not seen anywhere else. One of them even had a small RPG game built-in to the message board. Every user on the message board had an RPG character. The more you posted to the forum, the more your RPG character would level up, granting them more health points (HP) and magic points (MP). Many of the mechanics were based on the Final Fantasy series.

Eventually I discovered vBulletin.org, the holy grail of vBulletin message board modifications. At the time, the modifications (“mods”) were called “hacks”, because the installation process for modifications required forum administrators to literally modify the source code of their vBulletin message board. Thus, the admin would “hack” up the source code to install the mod. The long-term maintenance costs of such a system were horrific for two reasons. First, every time vBulletin was upgraded the admin would have to manually re-apply the mod to the new version’s source code. Second, if two or more mods tried to change the same line of code then administrators would either have to resolve the conflict on their own or would have to reach out to the mod’s author for guidance. Most administrators were not programmers, so they frequently reached out to the mod’s author for guidance. And most mod authors weren’t familiar with every other mod that was available to be installed, so sometimes it became a 3-way game of telephone.

For example, here’s one user’s support request from March of 2003:

Now the problem is i can’t make the stats and stuff show on the postbit. Is it the edit in showthread.php or functions.php that enable that option of putting the stats on postbit? Cause it’s on the RPGCP and the member profile and i’m usin the same strings but it’s not showin on postbit. Any suggestions? that would basically complete this hack for me!

As you can see, relying on administrators to edit files was error-prone.

This support request shows a common method for troubleshooting involved forum administrators granting mod authors “admin” access to the administrator’s website:

the X is still there, and my fourth item doesn’t show. Were you able to go into my Cpanel X to check out the database, or phpmyadmin?

Who needs to follow proper security processes when a forum’s RPG is at stake? Not that guy!

And here’s my response to a different support request:

Re-download the .zip file and re-upload rpgcp.php. The version you sent me is from 0.62.

So much pain!

As the author of a mod, it was bad enough dealing with the XY problem that adding “the site administrator didn’t modify the vBulletin source files correctly” to the list of reasons why the mod didn’t work was quite annoying.

Oh yeah, I forgot to mention that modifications also had their own versions. So administrators were responsible for making sure any time they upgraded a modification that it was compatible with their current version of vBulletin and all other modifications installed on their instance. Fun times!

Mods often modified the same critical lines of code, such as one of the database queries in showthread.php that queried for all posts in a thread. That query was frequently modified because it was the most efficient way to include additional data in rendered posts. For example, if every post needed to show the RPG character of the post’s author then the mod could add something like this to the “get posts” query:

SELECT ..., rpg_characters.*, ...
...
LEFT JOIN rpg_characters ON rpg_characters.user_id = users.user_id

Later in showthread.php, a foreach loop would iterate over the results in the query and send the query result for each post to a templating function that output the HTML for that post. The templating function would replace the RPG character’s variables in the template, e.g. $rpg_character.level, with the actual data from the query.

There was a separate mod called vbHacker that could generate an install / uninstall script for other mods. It removed quite a bit of pain but it was not perfect. Many administrators didn’t trust mods that required installation using vbHacker.

I’m the admin now

At some point I became an admin of a vBulletin message board and wanted to have the best RPG system available. That meant I had to install 5+ mods, resolve conflicts, and keep the mods working during upgrades of vBulletin. It was super painful.

I had taken some Visual Basic and C++ programming classes in high school, so I didn’t have too much trouble reading the PHP code of vBulletin. However, I had never learned about relational databases so all of the SQL queries in vBulletin were initially quite foreign to me. No less than three vBulletin upgrades later I was desperate to get a handle on resolving mod conflicts on my own, so I dug in and started learning through trial and error.

The virtual private server host I used gave me access to cPanel, which let me install phpMyAdmin. Through phpMyAdmin I was able to play around with the database - querying, updating, deleting - using the same SQL commands I saw in the vBulletin source code. After reading enough code and executing enough SQL commands I was able to connect enough dots that I felt somewhat confident in modifying the vBulletin source code on my own.

Taking matters into my own hands

So at this point I was familiar with most of the RPG mods on vBulletin.org and understood their similarities and differences, both at a UI level and in the code, and I very much wanted to rid myself of the painful conflict resolution process required to update vBulletin to new versions. So I did what any programmer would do.

I created my own vBulletin mod!

Of course, I didn’t start from scratch. I simply combined all of the existing, well-known RPG mods into a single mod and added a few features. You could say I was “integrating” the mods together into a super-mod that didn’t have all of the source code conflicts. It also de-duplicated data in the database and provided a seamless experience from character creation all the way to “battles”.

Actually, it wasn’t that seamless. It was my first large project and I learned a lot as I went along. I think some of the first people who installed the mod experienced significant downtime due to bugs in my code. Whoops!

When it came time to release it I had to make the most important decision for any project: I had to pick a name. As you can tell from the title of this post, the name I picked was the most literal name possible: the RPG Integration Hack. It was a “hack” (a.k.a. modification) that “integrated” all of the other RPG hacks into a single uber-hack.

Clearly, I’m not the next Al Ries.

The initial reactions to my mod were somewhat positive:

Someone releases a battle hack!, sto pthe presses, hell just froze over – Brad

OMG, hell has frozen over! Save me from doom! And don’t let hellsatan drive on the ice! – Link14716

I even received praise from the author of one of the other mods included in my mod:

Nice hack. And i thank you for askign permission about my hacks being used. You are truely a responcible hacker Just don’t drink and hack It does not work well – zajako

I’m guessing he was speaking from experience!

Maintenance begins

I spent the next few months frantically iterating on the mod. I added features, fixed bugs, handled support issues, etc. Looking back now, I see I hadn’t quite learned some fundamental rules of software development. For example, consider my reply to a user’s feature request for heal spells:

I had not thought of heal spells. I will try to add that tomorrow. You can wait for that version if you want, it shouldn’t take too long to make. – 06 Dec 2002

What was I thinking when I promised to implement a new feature and have it ready less than 24 hours later? That’s absurd!

I released a new version of the mod 2 days later. There’s no mention of heal spells.

Another fundamental rule of software development I didn’t follow was making the mod user-friendly and/or documenting the mod’s behavior. For example, here’s how administrators were expected to make potions that restored HP, MA, or HP:

  • If the COST of the potion is divisible by 10, then the potion will replenish HP. Examples: 20, 100, 220, 350, 11111111110
  • If the COST of the potion is divisible by 5, then the potion will replenish MA (MP). Examples: 15, 25, 5555555, 124034535. Things that will not work: 150 (although 150 is divisible by 5, it is divisble by 10 first, and is therefore considered a plus to HP potion.) 110, 117, and 239850.
  • If the COST of the potion is divisble by 2, then the potion will replenish MA AND HP. Examples: 62, 78, 1239848476. Things that will not work: 310, 55, 17.
  • If the COST of the potion is an odd number (not divisible by 2), then it does nothing in battle and is considered a dummy potion.

Did you get all of that? It’s super easy to remember and use, right?

My naivete was a two-way street. Yes, it led me to make promises I couldn’t keep and unintentionally disappoint users along the way. However, it also drove me to continuously improve the mod. I had real users who liked my mod. I didn’t know where the project was going but every time a new user posted feedback I got an adrenaline rush. It was addictive and I assumed it would last forever.

Spoiler alert: it didn’t last forever.

The downfall

The last post I made on vBulletin.org was dated 25 Sep 2003. The post gave no clue that it was going to be my last. So why did I stop responding after September 2003?

It wasn’t due to college workload. By September of 2003, I was a sophomore in college and while the workload was definitely heavier than my freshman year it was still very manageable.

It also wasn’t due to World of Warcraft. I eventually played that game for 40+ hours per week as a junior and senior, but the game wasn’t released until November 2004, a full year after I ghosted the users of my mod.

The reason came down to my inexperience as a software developer. My laptop was made by Toshiba. I wanted a large amount of disk space for a reasonable price, so I was forced to buy a 5400 RPM hard drive. Transferring data to and from the drive was fairly slow. I had a CD-RW drive, but CDs were expensive and time consuming to create. Who has time to perform incremental backups to CDs every day?

All of those factors encouraged me to practice bad developer hygiene: I never backed up my code.

In late September of 2003 my hard drive crashed. All data was lost, including my original mod for vBulletin v2 and my unreleased rewrite of the mod for vBulletin v3. After working on the mod for 2+ hours almost every day for months on end I was devastated to lose my unreleased source code. Yes, I could always re-download my original version of the mod and start the rewrite from scratch, but my motivation had collapsed.

I was also very embarrassed. What was I going to tell the users of my mod? That I was too lazy to back up my code on a regular basis? I didn’t want to have to go through that. In my mind it was too big of a deal.

So I ghosted my users. And I’m sorry I did that. They deserved better.

Retrospective

On the bright side, I learned my lesson. I still have copies of my code from the rest of college and beyond, despite going through 5+ desktop computers, 2+ laptops, and more hard drive failures. Of course, these days it helps to have cloud services that make it easy and cheap to store data reliably and securely.

Out of curiosity, I recently tried to re-download my mod from vBulletin.org but I couldn’t. The mod was “archived” a long time ago and cannot be downloaded any more. Dang!

Despite being abandoned, my mod continued to evolve without me. A developer named “Revan” took my mod and updated it for vBulletin v3. He released it under the same name: RPG Integration Hack v3. The mod eventually became so popular that it received it’s own sub-forum on vBulletin.org. Not many mods can claim that distinction!

I’m happy Revan was able to do that and thankful he stepped up when I did not.

Interestingly, one of Revan’s last posts on the forum is dated 20 Sep 2006 and says:

Haven’t been able to test it as of yet, having some problems with the comp that contains the files, as well as being busy with college these days. Sorry for the delay, sooner or later Ill get around to it.

His last post was almost exactly 3 years after my last post. Maybe September is just the natural end-of-life for RPG Integration Hacks.

Tags: ,

Categories:

Updated: