Blog

Make it Open - YPNgine

YPN logo during the YPNgine era

YPNgine: Download

Sometime in 2003 I became the administrator of YPN. Not entirely sure why, but there it was. As all the other admins left, so went their involvement in the future engine of YPN, partyfish. For reasons I cannot remember, I too stopped development of partyfish even though it was near complete.

But, I didn't drop the idea of a new engine and leave YPN in the capable hands of sasq2 and phpBB. No, I began writing my own CMS: YPNgine. Even with just a handful of months of PHP experience, I'd tasked myself to create a multi-user CMS with various levels of administration, a document library and fully functional forum that needed, at least to the users, all the functionality of the old phpBB. No small task indeed.

But I pounded away at it no doubt learning many, many things along the way. I even opened it up to a public beta, though I cannot for the life of my think of where this was hosted (somewhere on an FSF server, no doubt).

Going through the changelog comments I left int the source files and performing a delta against the final post on this thread, YPNgine took somewhere in the range of two months to develop. I do remember quite keenly when I actually turned this thing live. The first week was nothing but bug reports and security issues. They all got squashed, but in the end between the issues and the requested features, I decided that the entire model I had built YPNgine around was unsustainable, but that's a story for a different day.

I am actually writing this post because I am releasing all of the source code from the last "build" of YPNgine to the public. You can use that link at the top, or download it here.

The Revenge of Bottomembly

A few days ago I was out walking and reminiscing, as I am wont to do. While I was doing this, I recalled some of my first web related programming projects, most notably YPNgine. Considering it was my first major PHP outing, I pulled off quite a feat. Writing a message board is no small task. However, there was one part in particular that I was mulling over: the censor.

If you happen to be a former YPNer, you may recall seeing many references to "bottomembly". Carrying over the censor find/replace list that had been used on phpBB before it, all instances of the character sequence "ass" were summarily replaced with "bottom". Now I am being very choosy when I say "character sequence" and not "word" as the censor couldn't differentiate words.

This oversight was brought to my attention my young programmer self struggled to figure out a solution. Here's what I wound up doing:

Code: php
  1. // Copyright (c) 2003 Matt Hackmann
  2. // Full copyright info in index.php
  3. function censor_post ($body)
  4. {
  5. $query = "SELECT * FROM bannedwords";
  6. $result = db_Query ($query);
  7. $body = " ".$body;
  8. $body = str_ireplace ("assembly", "ytrewq", $body);
  9. $body = str_ireplace ("assum", "asd;ljf", $body);
  10. $body = str_ireplace ("glass", "glss", $body);
  11. $body = str_ireplace ("hello", "hllo", $body);
  12. for ($i = 0; $i < db_num_Rows ($result); $i++) {
  13. $row = db_fetch_array ($result);
  14. $body = str_ireplace ($row["blocked_word"], "", $body);
  15. }
  16. if ($body == " ")
  17. $body = "Censored";
  18. $body = str_replace ("asd;ljf", "assum", $body);
  19. $body = str_replace ("ytrewq", "assembly", $body);
  20. $body = str_replace ("glss", "glass", $body);
  21. $body = str_ireplace ("hllo", "hello", $body);
  22. return $body;
  23. }
  24. ?>

As you can see, I started hard coding in a list of safe words, replacing those instances with a random (or not so random) string of characters, run the censor and then convert those strings back to the safe words. This was a list I kept expanding on as they were found during normal conversation on the forum. I giggle as I look at this list and think of what the censor was doing to those words: bottomume, glbottom and hecko.

It's just something that I, eight years later, have to look back on and chuckle about.

Have you ever hated yourself?

Sounds like the title of one of the many things I see copied and pasted onto a MySpace bulletin. Before anybody cries foul, I don't hate myself. I'm a very content person and more or less happy with who I am. And beside, I'm going to a kick ass school (one month from yesterday) so life is pretty sweet.

However, the last few days I took a trip to the past and came face to face with my younger, stupider, teenage self. What started out as a kind of fun little programming project quickly brought home that, yes, I was a complete douche bag. It was just a small project to keep me occupied (which it did), but...

I restored the old YPN message board. It was kind of fun to read some of the old stuff from before I came on, but the minute I started getting to my posts the pain came on. It was obvious that I was... different. I was trying to fit in a crowd of very different people but I thought I was cool like them. If I saw something that pissed me off (and it didn't have to be much) I'd make some idiot remark instead of just shutting up and moving on. When I came to power it was obvious it went straight to my head. Most of that is more apparent in the days after the old phpBB forum (which I have not gone through), but it all begins right there.

For your enjoyment I have provided a list of all the groan moments:

Visual Basic - In which I become kage-chan's bitch/lackey

Comp Specs - Reopening a locked thread, and check out my triple post at the bottom. That eraser trick was pretty sweet, though. Too bad mechanical mice are non-existant anymore.

PHP Viewer - No comment

Siblings - I'm still not good in ethical debates which is why I avoid them like the plague.

Workaround for when "ass" is in nonvulgar words (like bottomembly) - devusb - I told you this happened before me :-P.

I look back on these posts and think to myself "surely that wasn't me," but I'm the only person on the internet with the dxprog moniker. It had to be.

Life as an Internet Microcelebrity

If you frequent digg you no doubt saw this a while back. For those who don't enjoy clicking links to find out pertinent information, it's a page that calculates how "famous" you are on the internet. I'll say this isn't entirely foolproof. All calculations are done via google search results, but it gives you somewhat of an idea about your... uniqueness.

Anyways, for fun I fed the information for a search of "dxprog" in and it turns out I've got 10/10 points for being a microcelebrity. Cool, I suppose. But like I said, it's more about uniqueness and the fact that I've stuck with one online moniker through my entire time on the internet helps. It also helps that I am the only person going by dxprog. The little calculation wouldn't work nearly as well if there were others who went by that handle.

This may sound egeotistical, but every once and again I google myself just to see what's been indexed about me. I've kept a fairly open internet life so it's not hard to turn up a bunch of relevent results. First thing that pops up is this site, followed by my Digg profile, Digital Double/my Smackjeeves profile and a couple of videos. Sadly, the first video is the one that I loathe with all the hatred I can muster. But, that aside, this is a pretty good synopsis of myself as it stands currently.

The origins of my online presence, however, are seemingly lost forever in the Sea of Digital Bits we call the internet. All that exists of my very first web page is gone and since YPN has been screwed, none of that exists either. Actually, that's not true. YPN's entire history is sitting on a CD-R on my desk. Every last iteration, from sasq2 to Tetra 2. I've even got the unfinished beta of partyfish. But, I digress.

There are a few old things that are harbored on the same disc as said YPN stuff that I've lovingly added to the archives (see the 2003 stuff on the right there). Nothing terribly interesting or deep, but it gives some insight as to what I was doing at the time (not a whole hell of a lot). But, then again, I was only sixteen and not much was really expected of me.

Well, this has been yet another fun trip down memory lane. Not sure why I post these things, but in twenty years it'll be interesting to go back and read everything. I'll probably think about myself now what I think of my former self: what a douchebag.

A History of Me - Part 1

For lack of anything else to write I will begin a series of autobiographical articles about me (ego bloating time ;-)). Before I start that, though, I'll give a quick rundown of the week. I rebuilt our shelves this week: painted them white and added some proper braces. Looks pretty good. I also, more or less, finished the docs module which is nice. Now I can start work on the various game stuff I want to do (hooray :-D!).

But now on to the main subject. This entry's subject is: A Walk with Computers: My Journey through Technology

My first experience with a computer would probably be the old TI Dad had. Every once in a great while Dad would crack it out and I'd knock myself out pressing random buttons. I thought it was pretty cool to just be pressing buttons.

I'm not sure when I first came into contact with PCs, but I'd be willing to bet my money that it was one of my relatives. My Uncle Darin had an 8088 and he'd sometimes let me play Concentration or Wheel of Fortune. My Uncle Kurt, rest his soul, had the Mother Goose game. I loved that little game. Not only did it look nice but, hey, it made noises aside from beeps! Of course, in retrospect it's still just beeps.

I always pined away for the day that we'd have a computer of our own. Whenever I'd go over to my grandparents house they'd have these boards that I'd pound nails into every time I came over. I claimed I was building a computer (lol). But, the years went by and it seemed the day would never come.

That day wouldn't come until the spring of 1997 when Dad took his old 486 home to do work at home. The first time he fired up MSPaint was magical. My favorite thing to draw was the Death Star blowing up Alderaan (we'd just seen the Special Edition of A New Hope). Then came the day that literally changed my life. All hip to learn about this new frontier I got some little kiddie books out of the library on computers. In the back of one of them was a couple of programs written in QBasic. Thinking about it now it was a good thing that computer had a Win95 upgrade because otherwise QBasic would not have been on there and I wouldn't be writing this now. But, anyways, I put in those programs and was just blown away by the fact that a normal human being like me could program the computer. So I started "reverse engineering" their code and taught myself how to use QBasic. It took a long time before I finally got to the level of making an actual game.

It was early 1999 and the game was Plane Attack, an ASCII based Battleship style game (though the enemy jumped around to random spots). If you were in line with the enemy you'd have the option to shoot it (which was a guess the number thing). My next game, and first time to dabble in graphics, was "Mario Mash". You'd move little Mario towards a turtle and jump on it. Exciting, eh?

By the time '99 came around the magic of the 486 was starting to wear off. Games were on the market that we couldn't play. For a while the problem was a lack of sound hardware but then it was 3D accel cards and Pentiums that became all the rage. Luckily I didn't have to suffer too long because in September of '99 we bought the first Dell. Around the same time, on the day my grandpa died IIRC, I also bought an old Mac Plus at a garage sale (and now that I think about it I think we still owe that lady $5 bucks...). That only lasted about half a year, though. A gift card of mine got shoved into the disk drive so I opened it up and got it out, but when I got every thing back together the drive didn't work. My guess now is that I had the cable in backwards but I knew of no such thing back then.

My next big step in programming would be the day I got VBasic for my birthday. I'd seen the thing sitting at our local Staples during the 486 era, but it certainly wasn't up to the task. Up until I got it, which was in 2000, I'd kind of forgotten about it. So that first night I was trying to write a game. I'd done some experimenting with VBA for Excel so I knew a little bit about what I was doing, but not much. Needless to say I didn't succeed. Eventually, over the years, I learned about WinAPI and DirectX and that's basically where I am today, though I did pick up some C++ along the way somewhere. That probably came in when I started:

Web development! Before the turn of the century the library had gotten computers with Internet acces. Of course this was another exciting realm for me. I could find sites about Final Fantasy 3 and listen to the music while away from the console! The site I liked in particular still exists today (and it hasn't changed a bit): Final Fantasy III, The Ultimate Page. The newness of the Internet wore off over time and I wanted to make my own presence on the web. Where the heck I learned about Geocities I don't know, but I did and the big debut was on June 1, 2000. We had just found out that Mom was pregnant with our first sister so that was the big headline. I used the WYSIWYG editor they had which served well for a time. It wasn't until Christmas of 2000 or 2001 when I used a gift card to buy a bargain book on VBScript. Hilariously I couldn't tell you anything about VBScript because for me that book was an HTML primer. So I made my first HTML website and loaded it up. For the time it looked pretty cool. Every so often I'd want to add new features and I'd rewrite the site from scratch. Then came the day where that static HTML just wasn't going to work anymore. I was trying to make a poll but couldn't figure out how to write the parameters file to the server.

Now before I can finish _that_ story I have to start another. One day when I was at Lucky's VB Gaming site and I figured I'd actually look at his links page. There was a link for a so called "Young Programmers Network" and I was instantly intrigued. Not too much before I had tried to start this kind of a group on Yahoo! to see if there was anybody else out there with my kind of talent (I was so naive) so to see that somebody else had actually done such a feat blew me away. So I signed up and made my debut: A VB game contest. So thus I was indoctrinated into the YPN, the next big thing in my life. I do need to explain that this is where my infamous nickname of dxprog started. At the time I had begun writing games utilizing DirectX and I figured that was fitting: DirectX PROGrammer.

Also, something else I should mention. Somewhere in 2001, I believe, I started yearning to have my own PC. We had just hit the eBay scene and computer parts were abundant and cheap (if you got ones that were old enough :-P). So I figured I'd build myself and old 486. Well that was stupid. As far as I got was the processor. I believe at my Dad's 40th birthday party I told my Uncle Darin about that dream and I was hitting him up for spare parts (I also bugged my Uncle Dan. These poor guys :-P). Anyhoo, my birthday rolled around and I got a package from UPS. Back then that was a rarity. It was from Darin and inside was his old P133. I was eccstatic to say the least. I holed myself up in my room and took the thing apart and put it back together and installed Windows and made out with it... okay, not really ;-). But it wasn't too long after (or maybe at the exact same time) that my Uncle Dan came up from Pheonix. And he brought several box loads of stuff. Talk about guy heaven! Of course, over the years I've upgraded (gone through 2 monitors with bad cables) and now I'm pretty much happy with my system (though I kind of want an 80GB HDD, or anything bigger than what I've got :-P). There was one point where computer hardware was more fascinating than writing software. I ate, breathed, and slept the stuff. But I guess it wore off at some point because I'm not like that nearly as much anymore.

Okay, now that all that's out if the way I can continue with the web site quest story. I was trying to figure out how to do that so I asked my pals at YPN. I can't tell you how I figured out how to get ASP going or any of that, but I did and began my journey on web programming. It was around the same time that I saw some pictures of XP in a magazine. I couldn't believe that that was Windows. So I named my first completely ASP driven site: Matt's Page XP. When that proved inadequate I rewrote it from scratch and I still have the code for that one. But I didn't like _that_ either so I rewrote it again this time I actually named the engine, Fishion I (notice the beginning of the fish names), and I called it The M Zone.

So things were working out quite well for me. I was writing games and making web sites. The only thing I wanted was to be a moderator of YPN (yeah, I wanted it). The opportunity showed up when KaGez put out a "help wanted" for the new YPN engine: partyfish. I said I'd help and he signed me on. My first job was to write the search engine. And, surprisingly, I did it. It was bloody slow, but it worked. But after that things went downhill: whenever I'd add a feature something would break down. This kept happening until I said "SCREW IT!" and started over from scratch. That engine I called YPNgine and it was pretty good for my level at that time (I'd been working with PHP for about 4-6 months). That actually made it to release and served YPN for a while, until it too started to break down under the stress. That's when I sat and said "HEY! I need to make something that is going to work in any situation and can be easily patched or upgraded." I had been reading a book on game programming that utilized object oriented programming and the light clicked: Tetra was born.

The first things I did on Tetra was make some homemade cache and templating modules. Tetra became something so powerful and simple to work with that every site I've created since that February day in 2004 has had Tetra at its core. And I hate to ring my bell here but I believe that it's probably my finest work.

With all this web development, though, I didn't have much time for game programming. I mean, I was running YPN, I was running the site for the parish and somebody from Arkansas wanted me to make a wbe site for them too. So I'd been swimming in a buttload of web work with little room for anything else. Until one day just a couple months ago. I was prowling around Gamedev.net and there was an article about a VisualBasic game contest. I figured, "Hey! Here's my chance to finally make a game and maybe get something out of it too." Oh I got something out of it (and I'm not just talking about the prize ;-)). I decided to make a clone of my favorite puzzle game: Tetris Attack. I'd tried to do this before but horribly failed. But my resolve to make it this time around had never been stronger. I wanted a game to enter that contest and I wanted a legal version of my favorite game, so I began. Things were going great. I had things figured out and working. But I have this real problem of when I hand my program to somebody else the bugs pop up. So I decided to turn the game over to the pros at tetrisattack.net. This was probably the smarted choice I made. The first couple of weeks killed me. "This doesn't work right" "The real game wouldn't allow this" "Your physics are really borked!". It made me want to cry, but I got the problems worked out and it turned out to be a winner (literally). I learned a lot and the completely scriptable sidekick guy formed the basis for a game I currently have planned (but to tell you about it now would be a crime ;-)).

So there it is. Basically my entire history involving computers. I look back now and realize I forgot about some of my early VB game ventures (Space Shoot II, Space Invaders and Eat), but you get the gist of it ;-). Stay tuned for part II: My First Love: Nintendo!