June 30th, 2007 Luke
I just finished the first 24 hack I’ve ever done.
What’s a 24 hack, you ask?
It’s pretty simple, actually. You take a project, like building a webapp or something, and give yourself 24 hours to build a working prototype with all the main features that you want.
I started at midnight on June 28th, and finished at 11:30 PM June 29th. According to my stopwatch application, the entire development process took 10:01:52, which would be worth $135.42(CDN) if I was paying myself my current wage for it.
What did I build, though?
I built a browsergame(no surprise there). It’s called “Trapper” for now(hopefully a working title), and it’s actually not ready to ‘release’, per se. Even though it’s in a good prototype stage, I didn’t spend any time securing it and it doesn’t have any content other than debug content just yet.
It’s a game based around trapping animals. Users spend their money to buy traps, and different types of traps can catch different amounts and kinds of animals. Users then set their traps, apply camouflage(if they have any - it affects how quickly the animals accumulate in the trap), and wait. When they check their traps, the time between when it was set and when it was checked is retrieved and used to determine how many of the animals the user caught. The user then receives a pelt for each animal they caught. For the moment, these pelts just get sold at the trading post, in order to make money to buy more traps. As the user catches more animals, different trading posts will become available to them based on what they’ve caught. These different posts will buy different pelts, and sell different traps and camouflage. Their prices will also vary.
This is the first project I’ve done like this. And it was fun, and now that it’s after the fact I’m looking back and going “yeah, that was really cool”. But I also learned a few things.
-
Sleep when you need to
Originally, I had planned on finishing the entire project in 12 hours. However, at about 4:30 in the morning my coding speed was slowing significantly, and my eyelids were beginning to droop. I realized that I would be more productive if I went to sleep now, and was therefore well-rested for the next bit of coding.
-
If there are two ways to solve a problem and you only know one, use the one you know
While having an issue with the “Set Traps” page, I asked a friend for some help. He introduced me to perl’s grep function, which solved the problem beautifully. The actual code looks like this, now:
my @settableTraps = grep { !exists $animals{$_->{animal} } } @traps;
Whereas it used to be an ugly nesting of foreach loops. But after solving this problem, I came upon another problem that had to do with testing whether a user fulfilled the requirements to visit a specific trading post. I tried to use grep to solve this problem, but quickly realized that I didn’t quite understand how to. I lost 3-4 hours just grappling with grep, and trying to get it to solve my problem. In the end, I just used two foreach loops. But thinking about it now, it would have been MUCH faster to have used the two foreach loops before I wasted 3 hours on grep. I could have spent the time I gained adding features or something.
-
Tools make a big difference
I gave myself an hour to build the template for Trapper. It’s a very sparse template. But every once in a while while I was developing, I’d notice some odd irregularities. These virtually always had to do with my CSS, and Firebug helped me track down what was going wrong within a matter of seconds instead of minutes. Also, using Smultron’s stored and hotkeyed snippets, I was able to drastically reduce finger strain AND typing time.
-
Sketch it out
While I was working on Trapper, I would occasionally come to an issue that I hadn’t thought of before I got started. Things like “how should a trading post be laid out?”. These were problems. In my case I ended up creating HTML mockups of two different ideas I had for laying it out, and just point-blank asking a friend “which one of these do you like better?”. But it would have been faster if I’d had it pre-sketched originally.
-
When in doubt, trust your gut
No, this isn’t about what to do when you get hungry. It’s about what to do when you have a tiny issue that’s bothering you. I had this issue with some of Trapper’s templates: they bold different segments of their messages to(hopefully) draw attention to what’s going on. In some cases, there will be 3 bolded terms out of a sentence made up of 4. In those situations, I would often look at my code and go “should I adjust what’s bolded and what isn’t?”. Ultimately, these are questions that only you will be able to answer. It’s your project after all; you should be happy with how it looks in the end.
All in all, I enjoyed it. Trapper was a project I’d had on the drawing board for a long time, but just hadn’t found the time to build. Who knew that 24 hours would be enough to kickstart the process? Now that I’ve built the basics, I can move on to tweaking and customizing and polishing, and I already have the sections that I always hated building originally.
Maybe I should make all my projects into 24 hacks, at least to start.
Posted in 24hack, Project | No Comments »
June 15th, 2007 Luke
I’ve started working on Parakeet 2 in my spare time. I’ve decided that this time around I’m going to do it differently, and focus more on getting everything working and working right before I ‘release’ Parakeet. Parakeet 1.0 was pretty cool, but also very buggy. There are a lot of things I wanted to add to it but didn’t, because the code was so buggy and convoluted that it was hard to get at. It was written more with the idea of “let’s finish this now” in mind than “how will I need to change this in the future?”, and it shows.
But Parakeet 2 won’t be like that. It’s going to have a couple new features:
- shared budgets
- date/time organization
- clean URL’s
Along with a whole bunch of tweaks that I’ve been sketching out over the last couple months. It’s also been redesigned to accomodate these new features, and I’m looking forward to rolling out the finished product.
It’ll be sweet.
Posted in Parakeet, webdev | 2 Comments »
June 11th, 2007 Luke
What makes up a puzzle?
I’m about to come up on my two months of summer vacation, and I’ve been considering my options in terms of making money, building sweet stuff, and keeping life non-cluttered. One of the things that I’ve decided to add to my ever-growing list of goals for this summer is making some sort of commercial-quality game; something that I can sell and distribute for $5/copy or something if I chose to.
Based on what I’ve been reading recently, the casual games market is the way to go for an aspiring game programmer; there are thousands of casual games out there to play, and websites like PopCap Games seem to be practically printing their own money! I’m not too worried about making money off of a game(although I won’t lie and say it wouldn’t be sweet), because this is more of a learning project than anything.
What makes a game casual, though? I had to define this before I tried to figure out what I would be building. I define a casual game as:
- fun to play
- easy to start - no 15-minute opening cutscenes
- little to no time investment required
- little to no storyline
That’s my list. A casual game, in my opinion, will be fun to play, and for the most part require almost no time to get going on. The idea is that you just start it up, play for 10 minutes while you’re waiting for something, and then go on with your day. The non story-based aspect of the casual game is listed because, as far as I can tell, there is little to no storyline behind a casual game. Generally there are just puzzles.
With that in mind, I decided that my best bet for making a game that would be easy enough to make and at the same time something people would play would be a puzzle game. But what makes something particularly puzzling?
I tossed around a few game ideas, but they all seemed to come down to being more action-based than puzzle-based. I realized that I needed to define the different elements of a puzzle, so that I could incorporate puzzling elements into my game. This is what I came up with:
- timers
- combinations
- automatic movement
I didn’t spend too long on the list, but that’s what I came up with. Virtually every puzzle in a game or otherwise that I’ve spent time on has incorporated one or more of those elements.
I’ve got a few ideas, now - I’ll be sketching them out some more over the next couple of weeks. For now though, I’ve at least got a basic framework of what a puzzle game needs to be.
Posted in Project, design, life, programming, puzzles | No Comments »
June 8th, 2007 Luke
This is a problem that was driving me absolutely batty a little while ago.
In ActionScript, there’s an ignoreWhite property that you can set to true for any XML objects that you’re using. This makes it so that this:
<menu>
<item>
test
</item>
<item>
testy
</item>
<item>
sixty-eight
</item>
</menu>
Will properly end up as “test”, “testy”, and “sixty-eight” if you were to create an array of items.
However.
Under Javascript, there is no ignoreWhite property. You need to make sure that whatever is outputting your XML is also removing the whitespace from it, because otherwise you’ll have issues. Your XML should end up like this, if you want the same results:<menu><item>test</item><item>testy</item><item>sixty-eight</item></menu>
Otherwise, you’ll end up with nodes in places you didn’t expect them to be, and values like “&tab;test” instead of the “test” you were expecting.
Posted in Ajax, XML, javascript | 1 Comment »
June 1st, 2007 Luke
Well, May has come and gone. That means it’s time to review it.
I managed to completely finish Militarism this month. It’s been picked up by a few people, and resulted in a pleasant spike of hits.
I also redesigned the home page; it now looks something like a web-based resum�© of sorts.
dnScoop tells me that girasquid.com is now worth $350, which is a good increase for this month($41) - my goal was to keep it snowballing and it looks like I’ve achieved that so far.
I haven’t made a cent off of AdSense or AdBrite this month. Oh well.
I did, at least, manage to attract a lot more unique hits this month. The total is 507 uniques, which is more than double last month’s value of 251. I’m pretty sure most of that is because you only get rewarded in Militarism if you’re recruiting unique users.
I’m slowly starting to work on Parakeet 2.0; there are lots of ideas for other projects coming so fast that it’s hard to keep them all organized.
Well, that was my may. How’d everyone else’s go?
Posted in monthinreview, postmortem, site | No Comments »