Hackathon, Day 2

As I write this, it is the morning of the second day of the Hackathon. I’ve been able to pursue my idea, but, as these things tend to go, it hasn’t played out at all how I’d planned. I spent last night turning over the first day in my mind, and now I find myself reassessing.

Here were the goals I had set for myself before the Hackathon:

1) Nail down the character, items, NPCs, areas and basic mechanics such as accessing inventory, exploring a room, combat, conversation, levelling up and so forth. Mechanics will be governed by functions and may be simplified further if required.

2) Build a simple, linear game using each major element and mechanic at least once.

3) Build a web interface over the game.

4) Playtest.

5) Expand game, if enough time remains

As of this morning, I’m still on point one, with no realistic way to move past it in the time remaining. The first room is in place, as is the player-character, some plot items and a sample creature. I’ve also roughed out the combat function and the examine item function, and identified where I need to write other functions to ensure those two behave as I need them to.

To be honest, I’m not terribly surprised. The game mechanics I was hoping to implement prove more complex to build than is realistic for the timeframe, even with additional simplifications. I’m thinking I’ll have to go back to the drawing board at the end of this and decide what, specifically, I hope to accomplish, and how I might more realistically carry that out.

I’m not particularly upset about all this. I ended up working with only one other person, Jacqui. Her strength is in project planning and documentation, and she ended up putting together an impressively through document mapping out all the object relationships a game like this needs. It’s given me some serious food for thought. While it would have been nice to have an experienced coder working with me, planning of this kind is so important, and I’m no doubt better off for it. I’m still happy with how much the two of us accomplished, given our respective skill sets.

Today, I’m going to keep plugging away at functions. If I’m really productive, I might be able to start testing one or two. Jacqui, alas, is down with a back injury, so I’m flying solo.

While it’s clear that the task is much bigger than I expected, I’d like to keep going for a bit longer before I decide whether it’s worth continuing this development path. I’ll have to decide once the even wraps up. I want to continue with the idea, and I still think it’s going to be a great way to learn more about how JavaScript works.


Meetups and Hackathons

I’m still plodding along in Codecademy; it’s been busy enough that while I’ve been able to set aside a bit of time daily for it, I’m still approaching the midpoint of the JavaScript modules and have yet to delve as deeply as I’d like in the book I picked up.

However, I found a local JavaScript community meeting this week, Exchange.js, and attended one of their meetings yesterday. I’ve got a way to go before I can follow much of what they’re discussing, but the group turned out to be friendly to both newbies and questions. It was soon clear that part of the point of the group is to discuss concepts and implementations that not everyone can expect to be familiar with, so they can find out more about them. I was able to have a number of good conversations once the presentations wrapped, and will be attending again next month.

The meeting drove home just how few and far between women are in programming language-based communities, though – I was one of only three attending, and one of the others was a business owner trying to get a conceptual handle on what her employees are developing. It’s stranger than I expected. I’m curious to see how the web developer community compares, once I’ve seen more corners of it; my initial impression is that women are still outnumbered, but not nearly as badly. Regardless, I’ve yet to feel out of place or unwelcome.

One immediate side-effect of the meeting is that I’ve been persuaded to sign up for an upcoming hackathon, and will be prepping a pitch for it. I’m sticking with a game concept, as I still think it’s a great, scalable, learning exercise. The concept is still rooted in the text adventure, but I’m now wanting to integrate a simplified version of the D&D 4E ruleset, pare down the party to a single-character adventure and perhaps adapt a game module for the gameplay. I’ll lay out the rough design here in a future post.

JavaScript, PHP and Planning my First Solo Project

So JavaScript has been going well. I’ve been going through CodeAcademy’s modules at a satisfying pace.

In particular, it turns out that my background in PHP has been really helpful. The two languages are more similar than they are different:

PHP vs JavaScript

A comparison of basic PHP and JavaScript.


And so on. If/else is structured the same way, right down to the curly braces, and I won’t be surprised to find out loops are too.

The choose-your-own-adventure module was a disappointment, though – it was plunked in so early on that it didn’t convey any of what I’d hoped. Instead of the rough outline of a complex set of possible inputs and outcomes, it set up a yes/no scenario and completed. There’s a second one forthcoming that may be a bit more what I have in mind, but I’m not holding my breath at this point.

That said, I’m confident I’ll be ready to try out the more complicated version on my own in another day or so. I’m aiming for an experience similar to Zork, or, if I can get myself to the point of including static graphics, the early King’s Quest games. Here’s what I’m picturing:

An interface in which users are encouraged to type key words and phrases to proceed, based on the context provided.
Multiple outcomes, anticipating two to five possible user inputs, plus a set of fail messages (“I don’t understand ‘popsicle’”) which may include some easter egg type responses for some input.
Testing user responses will require string matching, with the strings run through a change to uppercase or lowercase function to ensure user input can be case insensitive.
Outcomes are loading into a variable when the user has made a valid choice, with one  other designating the encounter. Layered if/else or switch/case statements then pass the user to the appropriate next encounter.
I’d need at least two functions: One to allow users to quit/restart based on a preset keyword, and one to bring up play instructions.

I expect this would give me the complexity I want while being appropriate for my current skill level. As my skill level grows, I can use it as a framework to practice on. I’m aiming to include some HTML5 and CSS3, and an interface permits users to type directly into a field in the page rather than relying on a series of annoying on browser popups.

I’ll make the game in progress available through my University of Alberta homepage.

Learning JavaScript via Interactive Storytelling

To heck with PHP for the moment. I’m taking on JavaScript. I had been waiting for the book I’d ordered, Marjin Haverbeke’s Eloquent JavaScript, to show up in the mail, but now I can’t wait.

Why? It goes like this: I have a Humanities background, so writing and interpretation are like comfortable old sweaters for me. I’d been tossing around ideas for projects I could take on to further my programming and web skills, and hit on the notion of putting together either a choose-your-own-adventure style story or text adventure.

I’m well aware that this is not a new idea – people built novels using HyperCard stacks in the late 1980s and 1990s, while web-based hypertext novels were trendy in the mid to late 1990s. I’m not in it for originality, just to give myself something concrete to center my learning around.

However, I’m not interested in just building another webpage. I want something a bit meatier, that users can interact with on a level beyond clicking one of a few prompts, that can dynamically react without requiring a new page to load. I figured JavaScript would be a good option to implement the idea, and ordered the JavaScript book to teach myself enough that I can figure it out myself.

This morning, I was browsing through CodeAcademy’s stand-alone modules, and stumbled on…a beginner-friendly tutorial for building a JavaScript choose-your-own-adventure.

Go figure.

I’m delighted to be even less original than I thought. The only thing better than hitting on a good idea is finding out that there’s lots of support out there for that idea.

So here goes. I’ll be working on the introductory modules this evening, and I’m aiming to get far enough along to tackle the game module by Monday.