Sunday, December 15, 2013

Ludum Dare: I Dared

Whoa. I did it.

Here we see about 1.9% of the 48 Hour Competition entries for Ludum Dare 28.  Mine's third from the left on the bottom row.
Yep, I finished a game for Ludum Dare 28. And seriously, I'm actually surprised that I succeeded. I'd never created a full HTML5 game before, and I thought it was probably kind of a fool's errand to try to do one in less than 24 hours. But I made it.
(Less that 24 hours, but more than 12, at least. I wasn't needed continually at the movie shoot, and managed to get in a little work on the game there, and likewise a bit at the Solstice party. Still, if I had to estimate the total time I put in at the game, I... I guess I'd put it somewhere between 15 and 20 hours? I think?)

Oh, it's a flawed game, certainly. There's plenty I'd have liked to do differently, if I had more time. But it's a complete game, with five levels (though I'd have liked to have more, of course), and a working level editor.

If anyone wants to try it out, here's the game. And you can see the source files here, should you care to look.
The final art assets for the game.  There's so much blank space mostly because at first I'd intended to have multiple frames of animation for the player and monsters...
I guess maybe I should talk about the level editor a little more, since that's, you know, kind of supposed to be the subject of this blog and all. The level editor was actually the first part of the game I made, for the simple reason that I used it to make the levels, and before I could make the bit of actually playing the game, I needed to have levels to play.

In a recent post, I mentioned that the standard for tile-based editors was to have the user choose a tile from a menu, and then paint with those tiles. I went on to opine that it made since that this method was so widespread, since was probably the most user-friendly way of creating tile-based maps. That being the case, one might expect that I would use that method in making a level editor for a tile-based game of my own.

I didn't. No, I fell back on the old Lode Runner method of selecting tiles to lay down via a hotkey. (Though, unlike in Lode Runner, the tiles are actually placed with the mouse.) Why? Well, not because I thought it was really a better approach. Really, just because time was limited and it was easier to implement. That's it. Worse yet, there's no documentation of what key corresponds to what tile, so you have to figure it out by trial and error, I guess. In case anyone wants to make their own levels, though, here's a bit of a cheat sheet: (Tiles with more than one key listed can be placed in multiple directions; the keys listed correspond to the directions up, left, right, and down, in that order.)
Blank floor tile
Cracked Wall
Locked Door
Fireball Machine
Monster Type 1
Monster Type 2 (fireball spitter)
Monster Type 3 (invulnerable to arrows)

An early test of the level editor
I do not expect to win any awards. (I'm not sure what awards there are anyway.)   Even if there weren't more than 1200 entries (wow!), I'd be under no delusion that my first attempt at an HTML5 game would have any chance of placing. I wasn't in this for the competition. I'm just happy to have finished a game.

And hey, if I managed to finish a game on my first time attempting Ludum Dare, and after having gotten such a late start and having so many other commitments to deal with... yeah, I'm definitely doing this again next time. Unless it happens to fall on a weekend even busier than this one, I guess.

For the record, here are a few things I would have liked to have done differently, had I had more time:
  • Better graphics. Obviously. In particular, I'd have liked the player and the monsters to be animated. I'd originally intended for them to be, but I realized there'd be no time to do multiple frames of animation if I still wanted to have time left for the coding. Had I more time, I'd also intended for the player sprite to have different graphics for the direction he's facing. And maybe also for the item he chose.
  • More levels. This is another big one. Five levels is something, but it isn't much. I'd intended for a theme for the levels to be that there's a fairly obvious and straightforward way through with one item, but if you wanted to pick up the gem you'd have to use a different tool and take a less obvious and more tortuous route.
  • Better collision detection. Yeah. Sometimes the player kind of slides his shoulder through a wall. I was trying to improve this right up until the deadline, with limited success. I think I know now what I'd have to do to fix it, but of course now I don't have time.
  • Boundary enforcement. Unless your map is surrounded by walls, there's nothing prohibiting monsters, or even the player, from wandering off the edge of the map and getting lost. For this reason, I recommend surrounding all your maps by walls. (Though unfortunately I realized after the submission deadline has passed that there is a way to break out of the walls and wander out of bounds in one of the game's built-in levels... oh well.)
  • More error catching in general. The program's pretty sloppy right now in general as far as letting the user do things it probably shouldn't. For instance, it's possible to put in multiple starting points in a map. This doesn't crash the program, or anything—basically, because of how the program reads the map, I'm pretty sure it should just use the lowest starting point, or in the case of a tie the rightmost of those tied for lowest—but it still should probably have been disallowed.
  • As briefly referenced in the instructions, I'd wanted to have pressure plates that would create or cancel walls of energy or something elsewhere in the maps.  I realized pretty early on that I wasn't likely to have time to implement that, though, which is a bit of a pity since it could have led to some nice puzzles.
  • Sound. A scream when the player falls in a pit, a crackle of a fireball... would have added something.
  • A more attractive intro and instructions. The all-text intro that's there now was of course quick and easy to create, but some graphics and a better layout would have greatly improved it.
  • A better win routine, too. Slapping "You win!" over the screen in big letters is arguably somewhat anticlimactic.
  • Cookies to keep track of what level the player reached if he quits the game and comes back to it later.
  • Possibly implementing some simple data compression on the maps, so they're not all stored as strings exactly 256 characters long with lots of repetition.
  • A catchier name. Seriously. "Underequipped"? What was I thinking?

The screenshot of my game I submitted to the Ludum Dare site.
Next post will be about Eamon, I promise.

And for now... I'm going to get some sleep.

Here Goes Nothing: Ludum Dare 28

Well, I said I'd have more free time starting after the 9th, but that seems to have been a little premature; while I did have an important deadline to meet on the 9th, it turned out there was a little more to do that I got a few days' extension on, as well as other things to catch up on that I'd put off because of that deadline, so my schedule didn't clear up quite as quickly as I had (rather unreasonably) expected.

And I'm afraid this weekend I won't have another post on Eamon or 001 just yet. They're coming, I swear. There will be another post on Eamon soon. But something else came up this weekend that... kind of took priority.

See, in one of my first posts, reader Zenic Reverie posted a comment asking if I'd given any thought to participating in Ludum Dare. Now, Ludum Dare, for those who don't know (and didn't just follow that link to find out), is an activity that involves creating a complete game, from scratch, in 48 hours, following a given theme. I'd been aware of it before, and it's something I'd always sort of wanted to get into. I've participated in a number of other limited-time creation activities: NaNoWriMo, 24 Hour Comics Day, the 48 Hour Film Project. (Well, okay, that last isn't a solo activity, but I wrote the script and composed the score for a completed entry in the project.) As I posted in response to Zenic Reverie's question, "the main reason I haven't tried Ludum Dare is that I don't think I have enough experience in game creation to be able to work fast enough to create a game in 48 hours."

But then, I went on to write, I shouldn't let that stop me... I succeeded on my first attempt at 24 Hour Comics Day despite never having created a comic before. So I decided that yes, I'd go ahead and do it, "[a]ssuming it doesn't fall on a day I have a commitment I can't get out of".

A wallpaper showing all the games from Ludum Dare 21 (from here)

Well, I thought I was subscribed to the site and would get updates about Ludum Dare, but apparently not, because I didn't find out till a few days ago that Ludum Dare 28 was taking place... this weekend. As in, right now, as I post this. And unfortunately, I do have several commitments this weekend.

Also not helping matters is the fact that for some reason I'd assumed Ludum Dare started Saturday morning, when in fact it turns out it started Friday night, at about 6 p.m. Pacific Time. Had I known that (and really, there's no good excuse for my not having been more assiduous about checking the website for the exact starting time), I would have had a good extra evening to work on the game. As it was, I checked on Saturday morning to find that it had already started. Not that I had time to work on it that morning; I had several commitments that day, and while I was able to think about game ideas while driving to and from the places I needed to go, I wasn't able to actually get started on the game until around 6 p.m. Saturday. That means a full day lost.

And really, it's more than that, because I'm not without commitments Sunday, either. I have to be at a movie set at seven a.m., and then I've promised to come to a Solstice party in the afternoon. Which means really my window for working on the game ends before 6 a.m., and even if I stay up all night (which at this point I guess I will; there'll probably be coffee at the film set) I've really got less than twelve hours. (There's a chance I may have a sliver of time to work on it between the movie shoot and the Solstice party, or after said party, but it's not something I can count on.)

And of course that's not taking into account the time I'm taking to write this blog post, I guess.

What have I got done so far? Well... I've got the graphics. They're not great, but they'll do, I guess. That gives me a few hours to do all the coding.

My graphics, such as they are.  Pixel art is not my forte.

Oh... and as for what program I'm using to create the game, well, I'm not. I'm just coding an HTML5 game. I have worked a little with HTML5 canvas programming before, but never created a full game with it. So my attempting to write a full game in a few hours is... probably unrealistic. And yes, it has crossed my mind that this may be a hopeless cause, and that I should probably just give up. But... I want to do this, to set a precedent for myself. If I make excuses for not participating in Ludum Dare this time, even if they're really good excuses, then it's that much easier to make excuses for not doing it next time, too. But if I forge ahead and do my best to finish a game despite all my commitments and obstacles, then I'm that much more likely to do it next time. I don't expect to do well in the competition. I'm not sure I even really expect to finish the game. But I'm going to try. Yeah, it's possible the game won't get done. But if I don't make the attempt, it definitely won't get done.

The game will be called "Underequipped".

And, in keeping with the subject of my blog, it will include a level editor.

When and if I get it done.

Saturday, December 7, 2013

A Brief Glance Ahead

On the one hand, I have a big deadline on the 9th that I've really had to focus on, which means I haven't really had time to work further with Eamon (or any other game creation programs) and have more to blog about. On the other hand, I don't want to go more than a week without updating again. So, in a compromise likely to satisfy nobody, I decided to make a brief update today just outlining my plans for the blog's immediate future.

The good news is, though, that after the 9th, my free time should increase dramatically, and I ought to be able to post much more often for a while. Well, I do have further deadlines at the end of the year, but that's still a few weeks away, so I'll be able to justify devoting at least a little more time to the blog.

This image has something to do with what I'm working on.  That's all I'm saying.
So here are my plans for the next few posts: The next post is probably going to be a second look at Eamon; for several reasons, I planned to play a few more existing Eamon adventures before really getting into making mine. (As I think I mentioned in a previous post, I've already found a few things I was wrong about in my last Eamon-related post.) After that, I'll probably have a post on mapping in Eamon, followed by one about generating other content in Eamon, and finally on customization (i.e. editing the Eamon source code for effects specific to the adventure). Then probably a wrap-up post about Eamon. So... at least four more posts on Eamon, maybe more if it turns out I have enough to say about one of those aspects to fill multiple posts.

I expect the posts about Eamon to last, at most, another month, and possibly significantly less depending on how much I manage to get done over the holidays. After Eamon, I'll be going back in time a bit more in my chronological crawl... I said before that Eamon was the first game creation system I could find, but while that remains more or less true, now that I've added level editors to my purview, I have found some earlier games with level editors. Specifically, so far the earliest game I could find with a level editor was a strategy game called Starfleet Orion, released way back in December 1978. Like most level editors, I don't expect Starfleet Orion to justify more than one blog post, though; in fact, it will probably inaugurate a new label, "One and Done", for level editors that are covered completely in a single post. This will be followed by posts on a number of other programs that'll very likely also be "One and Done"s, such as Starfleet Orion's sequel Invasion Orion, a Magnavox Odyssey2 cartridge called Computer Intro! intended to introduce users to assembly-language programming (which admittedly makes its inclusion as a game-creation program a bit iffy, but the majority of the complete programs included seem to have been games, so it's arguable that that's what it was primarily geared toward), and a very rudimentary racing game called Dot Racer, before we finally get to another game creation system that may justify a slightly more in-depth analysis, 1981's Dungeon Definition Language.

Some of what we've got to look forward to.  (Images from eBay, the Digital Press "Room of Doom", AtariGuide, and, er, a screenshot collection maintained by an Italian C64 fan.)
Depending on how much progress I make with my 001 game in the meantime, as well as whether I run into anything interesting and unexpected worth blogging about, there may or may not be another 001 post mixed in there at some point. One likely candidate is a second post about mapping in 001, as I realized that the previous post about mapping dealt with creating individual maps, but not with how the maps are connected together—that'll probably be worth another post on its own.

So... sorry to not have been able to make a more substantive blog post this week, due to other urgent matters that have been occupying my time and attention, but I hope this taste of things to come has been... well, has been better than not posting at all, anyway. In any case, there'll be much more coming after the ninth.