Tuesday, October 29, 2013

Rat Island feature complete



Ship it!

I've got several of the outstanding (I love both senses of that word - "not yet done" and "amazing") bits done, and my TODO list looks like it's really just polish at this point.

Some stuff I got done today:
  • Credited Dominique Crouzet for the hex art. They class up the place, and the art is CC-attribution, so a) it's a good thing to do and b) it's the right thing to do.
  • Guard combat working - I had built this already; combats that don't respawn and don't let you pass. I just had to allow combats to not have a sprite.
  • Rat King special victory condition - I made a fancy dialog (see the September game for the template), and it wouldn't show up. Rather than debug that, I added special victory text (see above screenshot).
  • Reset the player to the start position if they get defeated.
  • Reset the player's hit points and experience points to the start of their current level when they get defeated.
  • Tinkered with the camera after defeat - the camera should recenter on the player, even if they teleport back to the start. This seems like it's mostly working, but there's an issue if you get into combat as part of a long move (see TODO, below)
  • Made sure that items don't spawn (or respawn) on top of the player, on top of the exit, on top of other items, or on top of the start location.
  • Rejiggered experience ramp - you basically need to kill two monsters of your current level to level up.
  • Added level up/down cheats - just to debug, it goes faster if you're at level 15, rather than actually playing the game.
  • Added absurd levels - this is a game designed for one character, levels 1 - 10. It should say that on the box. (TODO). I added levels 11-20, mostly for my own cheating purposes. But if you're having a hard time fighting the Rat King, you can grind away at some of the level 9 monsters and get an edge.
And, as always, there are some things remaining to do:
  • Deploy - either bring my web server back up (probably reinstalling Fedora 19 along the way), or push to a web host (Amazon S3?). The quick solution will be just to push the game by itself. The longer solution will push all of the bigdicegames.com website.
  • The pathfinder can route you through combat, which can lead to multiple combats in a single "move". I don't think that's a bad thing, but it's weird. A long move through combat also lets the camera get out of sync with the player movement. Perhaps just snapping the camera to the player's location on arrival would fix that.
  • The pathfinder isn't smart - it just does a flood fill to find a path to the clicked location, and can take a long time to find a path. I could add a upper limit to the amount of time the pathfinder uses, and/or implement A* to make it faster. I don't think these are crucial; just don't click far away.
  • When the player arrives in combat, it wouldn't be hard to remind the player what their level and HP are at.
  • Fancy up the title screen - it's fancyish, but I can add more homage references there, including "An adventure for one character levels 1-10". 

Monday, October 28, 2013

Development proceeding - this just in, Grinding!


When I say "grinding", you either think of taking the rough edges off of metal, or you think of tedious combats to level up. I prefer to think of the latter as a player-driven ability to select the speed of the game and the level of difficulty, at least when it's not sloppy game design.

I won't claim terrific game design, but I will point to this dialog as evidence that you can now wander the island and find three different kinds of creatures to combat. If you defeat them, you gain experience, and perhaps level up, gaining hit points. If you flee, you return to where you came from (setting the stage for "guard" combats). If you are defeated, you ought to respawn with full hit points back at the start of the map. That doesn't happen yet.

Looking at the amount of work remaining, I should be able to wrap up a "shippable" version by the end of the month. Hopefully, my web server will be up and running by that time.

Sunday, October 27, 2013

Sneakernet, 2013 Style


Back when I was a kid, the closest thing we had to "the cloud" was walking around, moving files from computer to computer by carrying floppies.

These days, that seems so antiquated - except for the times when you decide to upgrade the OS on your fileserver, causing Postgres to fail, causing YUM to fail, possibly leading to shared libraries being truncated (or is that an independent problem that just happened to fail at the same time?)

So, today, I got a USB external drive, hooked it up to my laptop where I had been doing the development for the past few weeks, walked it over to my desktop development machine, copied the files over, and have managed to verify that all of the files are there and working, as the above screenshot evidences.

I had been hoping to get a lot of work done on the game today. The fact that I've got my development machine capable of doing development, that's progress from where I was on Friday, so that's good. There's a lot of stuff that I have on drives that I haven't yet figured out how to boot, so that's work to be done, sometime. There's a lot of features I need to get in to this game by the end of the month. (1GAM permits a few days of leeway, which I haven't yet allowed myself to take advantage of. Maybe this is the time.)

I find it interesting that the hexes on the right side of the screen here look purple on this monitor, while on the netbook I was developing on, they looked dark blue. Similarly, the darkened hexes that I was using for last month's game look nearly black on my phone. So, the lesson is of course to test out your game early and often and make adjustments as appropriate. Perhaps I should have some sort of brightness feature - an option in a settings menu, perhaps, or just some constants that I play around with and ship as suitable defaults.

Oh, while we're on "lessons learned": back up your stuff. Really. And, when you think it's a good idea to upgrade your system, back up your system first. And it might even make sense not to upgrade the system so much as build a new system from scratch (new hard drive, fresh OS) and bring your data with you.

Even if the game was in a state where I felt like I wanted to share a link to a version, the webserver is one of the machines that fell prey to the upgrades that seemed like a good idea at the time. I expect to be able to sort that out, hopefully by the end of the month. Probably plus a few days.

Monday, October 21, 2013


You may notice a few things different (spot the differences! Just like those fun games in the back of Highlights magazine!) about this screenshot compared to the previous screenshot.


  • more or less working buttons on the bottom of the screen - The "Attack" button works, the "Flee" button doesn't. There are "OK" buttons elsewhere that seem to mostly be working.
  • more stats in the grayish monster card on the left - The monster stats are kept in two completely separate places, written in two separate languages. So, maybe they're mostly in sync. I went through and created a full progression for hit points and experience points for the player and for monsters. I'm not sure it's going to be balanced to be fun, but there's a progression.
  • actual dynamic output of combat events in the right hand pane - it's not really enough to fully understand what's going on, but combat events are being displayed. Now that I write this, I see that it's very similar to The Bard's Tale's display.
There's still quite a lot to cram in, particularly the way that combat gets invoked when moving around on the map. Once that's in, there's a lot of revisiting and polishing.

Also, the blue tiles should have mountain icons, and the red sector of the map shouldn't be terrifying to people who know that lava=instant death.

Sunday, October 20, 2013

Seriously.


At some point, any sufficiently advanced game toolkit will have some means for supporting text displays. It's amazing to me how much work it is to get a baseline of functionality, and it amazes me how many different times I've done it - not that I've often gone far beyond the minimal baseline.

In the screenshot above, you'll see title text, which is baked in to the yellow background image. Beneath that is an informational card, which is its own image, and created in a Python (PIL) script. The text on the right, demonstrating simple text rendering, including word wrap of long strings, that's actually done by my JavaScript code, using a "sprite sheet" that I generated with yet another Python (PIL) script.

I'm using Jaws.js, which has a "SpriteSheet" class, which seems to be designed for sprite animation frames, but can be pressed into service for character letterforms. It has options for the frames to go in a strip to the right, or in a strip going down, but there's no facility for a 2D grid of frames, which seems like it might be a good thing to have.

This isn't even what I'd call "finished", in that there's sloppy stuff in there that I want to clean up, but it's probably good enough to get this particular game working. Good enough to ship.

Which is to say that I'm not done writing character rendering code. [sigh]

Saturday, October 19, 2013

Obstacles that block movement


I've hooked the visibility back up again and added in some terrain items that block movement and/or visibility.

Still no real gameplay.


Friday, October 18, 2013

Island Regions generated


I've been slacking, like I do. But I took the maze generation and reworked it. There are now three regions, with a border region between each.

Next up: generating passages between the island regions.

Then: putting monsters in.

Wednesday, October 2, 2013

September Game "Maze of the Rat King" bug fixed, time to start on October game

So, if you've been waiting to play the September game until I'm done with it, I now give you permission to hit http://bigdicegames.com/RatMaze/maze.html as I'm not going to be updating it further.

That sounds bad, let me rephrase: "Yay, the maze game is now full up with awesome, and it's ready to go!" Which sounds a little over the top. Somewhere in the middle, though, I'll say, yes, there's stuff that didn't get done (like any of these fixed time limit games), there's stuff I'm pleased with, and I'm happy to have working pieces to carry forward to the next game.

The last bit that I just fixed was a weird loading behavior - when I would load the game the first time, or one of my friends would load the game any time, certain assets wouldn't load, and the game would just show a black screen.

Turns out, what was happening was that I had a bug where I was launching the Jaws.js game framework twice. Jaws, like most Javascript engines, gets a lot of its work done through callbacks, so what was happening was that I'd set up a list of assets, the framework would issue asynchronous calls to load those assets, and would go away. Each time an asset would be loaded, it'd tally up the loaded asset (or failed load, if that happened, which it didn't in this case).

I was loading 23 assets, I was seeing 23 callbacks, but I was only seeing 20 loaded assets. It took me a while to recognize that 3 of those assets were being loaded twice, and it took me a while to recognize that I was launching the framework (and hence the loader) twice. Once I saw that, it made sense - the tile art was much smaller than the splash screen, and loading a 100x115 PNG twice is much faster than loading a 800x450 PNG, so some of the tiles would get loaded twice, the loader would say, aha, I've loaded 23 things, that's all I need, let's start the game. And then my splash screen code would leap into action and it'd all end in tears, as the first thing that I do is try to draw my biggest piece of art. Bam.

I'm not going to badmouth Jaws.js - it's so far been a pretty good tool, and I've been able to walk through the code pretty well. There are things that I'd change, and a few places where I've stitched in debugging code and a few places where I've stitched in new functionality. I really need to get back to the original author and share my experiences - even if he's not interested in my patches, I expect he'd appreciate knowing that it's getting use.

I do think that as I continue to make games with my toolbox of code, I'll lean less and less on Jaws.js and might eventually get rid of it altogether. I think right now, I'm using the asset loading and the keyboard/mouse/touch handling, which I could probably rewrite without much effort if I needed to.

I don't need to for the moment, so I won't.

Next up: Our hero has escaped from The Maze of the Rat King, and pursues him overland through adventures in the wilderness.