Thursday, March 25, 2010


Best bug/exploit ever. In crashRun, when you throw a flare or a grenade, you are allowed to select its landing spot. I realized the other day that I was actually bothering to check if there was a clear path to the target square, resulting the player's ability to bank grenades around corners:

# # ##
# # #

Ie., the player would be able to toss a grenade to the asterisk.

I fixed this by drawing a line (using the Bresenham algorithm) to the target square to make sure there's a clear path. Monsters don't yet interfere with the throw (I guess the player is logging the item) but that's something I need to look at.

Also, the larger issue is that there are two different methods in the game for the throwing and shooting. When you use a grenade or a flare you pick your target square as described, when you fire a gun you must pick a direction, with the consequence that you must fire along a cardinal direction. I kind of like that, because it forces the some tactical maneuvering, but it seems kind of ugly having the two different methods.

Perhaps at some point I'll switch to DoomRL style targeting, though.

Wednesday, March 24, 2010

Err, 0.4.1 :P

While I did conclude last post with "Onward and upward to 0.5.0!", I ended up making a slight detour to a little place called 0.4.1. The game was crashing for someone on Windows XP; Pygame was failing to initialize and it appeared as though it was having trouble with the sound driver. Annoying because crashRun doesn't have sound :P

But in any case, I found a forum post from someone who had a similar issue in their own project and their fix worked for us as well. So, I pushed out 0.4.1.

Git proved pretty handy. I'd started a new branch for 0.5.0 so I switched back to my 0.4.0 branch, made the fix, checked that into a new branch and then merged those changes onto my master branch. For good measure, I then deleted the 0.4.0 branch since it was superseded by 0.4.1. Next, I cherry-picked (cherry-plucked?) the commit containing the fix into the 0.5.0 branch. I should do some reading about other folks' git workflows.

My first few commits for the 0.5.0 branch have been UX enhancements. When you hit the action command, the game skips broken doors and automatically attempts to unlock locked door using your lockpick. (At the moment there is only one kind of lockpick in the game so it doesn't bother asking you which to use if you are carrying more than one) Also implemented "bump to open/unlock doors", which makes cruising around the dungeon much easier.

I suspect that, as in Angband, this is going to result in me blundering thoughtlessly through the dungeon and dying a lot when I play...

Auto-unlock and bump-to-open are configurable options -- the first configurable options -- so I had to build a screen where the user can set and save them.

Sunday, March 21, 2010

0.4.0 Released!

Alright, I've posted crashRun 0.4.0 on the website. The "official" announcement is on the rgrd newsgroup:

Yesterday, I got an executable version of the game working using Py2Exe so Windows users won't need to have Python and PyGame installed before running crashRun.

0.4.0 is available from the downloads page:

And now, onward and upward to 0.5.0!

Tuesday, March 16, 2010

End of codesprint, 0.4.0 almost

I finished up my codesprint and actually got a lot of what I wanted done on 0.4.0. Lots of my time was spent with tweaking and bug-fixing, but big new stuff include:
  • Expanded character creation. Your background is randomly rolled and determines which skills you begin with. You can chose to go shopping before the mission begins and thus customize your equipment (or stick with the 'standard kit'). I also dropped gender from the creation screen since it has no in-game use.
  • Created the map generation for the two-level "proving grounds" section of the dungeon. The idea is that the proving grounds are where the AI tests its new creations, so there will be a lot of tough monsters featured, but also some caches of nice equipment the player might risk trying to get. There are also pools of acid and toxic waste laying around.
Last night I wrote some AI for monsters that can shoot at the player. Borrowing from nethack, the character can only fire in the eight cardinal directions so I figured I should limit the monsters the same way, so I came up with a behaviour routine where the monster tries to move so that he has a shot at the player. I've created one type of "mech" enemy that uses this behaviour and I'd like to have a few more to include in 0.4.0.

Another type of enemy I want to create is cyborg. These guys will have guns and inventory that they can use (and I might apply that behaviour to a few more intelligent types of monsters as well). So they'll pick which gun to use, reload it, etc. They will also grab useful items from ground.

Now that my codesprint is done I can't spend all my spare time on crashRun, although I'll try to keep up with making one or two commits per day.

0.5.0 will be another "more stuff" edition and feature a cyberpunk analogue for what are potions in fantasy roguelikes as well as a lot more in-game information in the form of data files found in cyberspace (I have only a few token ones at the moment).

Thursday, March 11, 2010

I finished the first of the really big new 0.4.0 things on Tuesday: handedness. You can now hold one or two items in your hands, and some weapons are two-handed. For example, somewhat arbitrarily, the katana and the baseball bat are both two-handed. I realize that both of those could be swung one-handed, but I haven't thought of a non-awkward user interface way to specify that you are wielding a single item with two hands instead of one.

If wield two melee weapons, you will automatically do two-weapon combat. If your secondary weapon is a firearm, you'll only attack with the primary hand. This is mainly because ammunition is a precious commodity in the game so I don't want to force the player to waste any. Maybe I get let the player select their combat mode? I guess I'll find out via criticism if/when crashRun has actual players :P

I also added a bunch of new items and a few new features.

The two major new features for 0.4.0 that I still need to do are (1) expanded user creation, including an optional shopping trip before you begin and (2) the next section of the dungeon, which is still half-nebulous in my mind.

Tuesday, March 9, 2010

Codesprint Day Two

Last night I added a new item (instant coffee!) and a new monster (zombie scientist!) and coded what is basically a joke involving the two of them. Writing the joke wasn't entirely a waste of time, as it will actually be useful for other game situations.

I also shrunk the size of the prologue level in the hopes that it'll be interesting. A couple of bugs were squashed. One minor (a display glitch when a thrown item hit a wall) and the other more serious -- an infinite loop that occasionally happens in the tower generator code. I'd never seen it before because it seemed to happen only when generating really small towers, and about 1 times in 20. Of course, it might have been possible for it to happen in the larger levels, but was perhaps very rare.

Tonight I will work on having handedness in the game, in the sense of the player being able to wield something in each hand and the various consequences of that.

Monday, March 8, 2010

crashrun Code Sprint!

Last week I happened to pop by and saw the announcement for the annual Seven Day Roguelike contest, which is going on this week. I gave some brief thought about participating, because I do have an idea for another roguelike game that has been floating around in my brain. But I decided that game idea would be far too big for a week's worth of coding.

I did decide, however, that it would be a good week to dust off crashRun's source, which had been sitting neglected on my hard drive for a year. In the spirit of the 7DRL game, I'm devoting as much of my spare time this week as I'm able to crashRun and I'm going to try to get everything done that I want to for 0.4.0.

It feels like a tall order, however. Here was the feature list I posted on crashRun's livejournal back in February 2009:
  • configurable key commands (my friend Val asked for it)
  • universal Use command (so you can "use" ammo, for instance instead of needing the reload command)
  • monsters that won't necessarily be awake, active and hunting the player from the get-go. This allows some options for stealth. Need to design how noise will wake-up monsters (explosions, gun shots, eetc.) [In progress]
  • EMP devices and effects (both on robots and the player's equipment)
  • a few different kinds of beam and laser weapons
  • tranq guns and tasers
  • machine guns and ammo (A couple of handguns, too)
  • Instant coffee
  • a few other pieces of equipment and a couple new uses for existing items
  • Ghosts-in-shell (dead characters may show up as monsters in cyberspace)
  • A trap or two for meatspace
  • varied character backgrounds, which will affect your starting skills
  • Character will have two hands. You'll need to weild both your gun and your melee weapon (or flashlight if you want to use it) Maybe have duct tape that allows you to tape flashlight to your gun?
  • A chance to shop and pick your equipment before you're sent into the game. Will keep a quick-play option for players who don't want that kind of detail.
  • The next two levels of the complex.
On top of that there are a few new monsters and items I'd like to add.

Much of yesterday was spent testing and debugging (although I did get some new features implemented). After I was done coding for the day, I also uploaded crashRun's source to github.